xunge/DecIR huggingface dataset:
void _memset(void *s, int c, int count) {
  char *xs = (char *)s;
  while (count--)
    *xs++ = c;
}


x86 assembly (clang, -O0):
<_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1145 <_memset+0x45>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1116 <_memset+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_memset>:
test   %edx,%edx
je     1120 <_memset+0x10>
push   %rax
mov    %edx,%edx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @_memset(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
br label %9
9: ; preds = %13, %3
%10 = load i32, i32* %6
%11 = add nsw i32 %10, -1
store i32 %11, i32* %6
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %5
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %7
store i8 %15, i8* %16
br label %9
18: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @_memset(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void *steppers_thread(__attribute__((__unused__)) void *buf) {
  ;
  printf("Main steppers' thread\n");
  while (1)
    usleep(1000);
  ;
  return NULL;
}


x86 assembly (clang, -O0):
<steppers_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    1138 <steppers_thread+0x18>

x86 assembly (clang, -O2):
<steppers_thread>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    1130 <steppers_thread+0x10>

LLVM IR (-O0):
@.str = [23 x i8] c"Main steppers' thread\0A\00"
define i8* @steppers_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = call i32 @usleep(i32 1000)
br label %4
}

LLVM IR (-O2):
@str = [22 x i8] c"Main steppers' thread\00"
define noalias i8* @steppers_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @usleep(i32 1000)
br label %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint16_t mem_loc = 0b1111111011111110;
  uint8_t lower_eight_bits = 0;
  uint8_t upper_eight_bits = 0;
  lower_eight_bits = mem_loc & 0b0000000011111111;
  upper_eight_bits = (mem_loc & 0b1111111100000000) >> 8;
  printf("mem_loc: 0x%04x\n", mem_loc);
  printf("lower_eight_bits: 0x%02x\n", lower_eight_bits);
  printf("upper_eight_bits: 0x%02x\n", upper_eight_bits);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfefe,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xfefe,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0xfe,%esi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0xfe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"mem_loc: 0x%04x\0A\00"
@.str.1 = [26 x i8] c"lower_eight_bits: 0x%02x\0A\00"
@.str.2 = [26 x i8] c"upper_eight_bits: 0x%02x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 65278, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, 65280
%9 = ashr i32 %8, 8
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"mem_loc: 0x%04x\0A\00"
@.str.1 = [26 x i8] c"lower_eight_bits: 0x%02x\0A\00"
@.str.2 = [26 x i8] c"upper_eight_bits: 0x%02x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 65278)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 254)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 254)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int ntohl(int);
uint32_t apply_subnet(uint32_t addr, uint8_t subnet) {
  if (subnet == 32)
    return addr;
  uint32_t mask = (2 << subnet) - 1;
  mask = ntohl(mask << (32 - subnet));
  return (addr & mask);
}


x86 assembly (clang, -O0):
<apply_subnet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jne    1133 <apply_subnet+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <apply_subnet+0x51>
mov    -0xc(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edi
call   1030 <ntohl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_subnet>:
push   %rbx
mov    %edi,%ebx
cmp    $0x20,%esi
je     112f <apply_subnet+0x1f>
mov    %esi,%ecx
mov    $0x2,%edi
shl    %cl,%edi
add    $0xffffffff,%edi
neg    %cl
shl    %cl,%edi
call   1030 <ntohl@plt>
and    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @apply_subnet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %23
11: ; preds = %2
%12 = load i32, i32* %5
%13 = shl i32 2, %12
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = sub nsw i32 32, %16
%18 = shl i32 %15, %17
%19 = call i32 @ntohl(i32 %18)
store i32 %19, i32* %6
%20 = load i32, i32* %4
%21 = load i32, i32* %6
%22 = and i32 %20, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %11, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @apply_subnet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 32
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = shl i32 2, %1
%6 = add nsw i32 %5, -1
%7 = sub nsw i32 32, %1
%8 = shl i32 %6, %7
%9 = tail call i32 @ntohl(i32 %8)
%10 = and i32 %9, %0
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ %0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_round();
scalar_t__ round(double);
void test_round(double d) {
  if (round(d) != round(d))
    link_failure_round();
}


x86 assembly (clang, -O0):
<test_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <round@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <round@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_round+0x3c>
mov    $0x0,%al
call   1040 <link_failure_round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_round>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <round@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <round@plt>
cmp    %rax,%rbx
jne    1149 <test_round+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_round@plt>

LLVM IR (-O0):
define void @test_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @round(double %3)
%5 = load double, double* %2
%6 = call i64 @round(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_round()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_round(double %0) {
%2 = tail call i64 @round(double %0)
%3 = tail call i64 @round(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_round()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void x_free(void *mem, char *file, unsigned int line) { free(mem); }


x86 assembly (clang, -O0):
<x_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @x_free(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @x_free(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
int rcu_preempt_needs_cpu(int cpu) { return 0; }


x86 assembly (clang, -O0):
<rcu_preempt_needs_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcu_preempt_needs_cpu>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rcu_preempt_needs_cpu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @rcu_preempt_needs_cpu(i32 %0) {
ret i32 0
}
/* Variables and functions */
int sprintf(char *, char *, float);
int print_f(char *buf, float val) {
  return sprintf(buf,
                 "%"
                 "g",
                 val);
}


x86 assembly (clang, -O0):
<print_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_f>:
lea    0xee9(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%g\00"
define i32 @print_f(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define i32 @print_f(i8* nocapture writeonly %0, float %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 %3
}
pbaddr(s, in) char *s;
unsigned long int in;
{
  unsigned char a, b, c, d;
  a = in & 0xff;
  b = (in >> 8) & 0xff;
  c = (in >> 16) & 0xff;
  d = (in >> 24) & 0xff;
  printf("%s %d.%d.%d.%d\n", s, a, b, c, d);
}


x86 assembly (clang, -O0):
<pbaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,-0x1b(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
movzbl -0x19(%rbp),%edx
movzbl -0x1a(%rbp),%ecx
movzbl -0x1b(%rbp),%r8d
movzbl -0x1c(%rbp),%r9d
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbaddr>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %ebx,%eax
movzbl %bl,%edx
movzbl %bh,%ecx
mov    %ebx,%edi
shr    $0x10,%edi
shr    $0x18,%eax
movzbl %dil,%r8d
lea    0xece(%rip),%rdi
mov    %eax,%r9d
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s %d.%d.%d.%d\0A\00"
define i32 @pbaddr(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, 255
%12 = trunc i64 %11 to i8
store i8 %12, i8* %6
%13 = load i64, i64* %5
%14 = lshr i64 %13, 8
%15 = and i64 %14, 255
%16 = trunc i64 %15 to i8
store i8 %16, i8* %7
%17 = load i64, i64* %5
%18 = lshr i64 %17, 16
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i8
store i8 %20, i8* %8
%21 = load i64, i64* %5
%22 = lshr i64 %21, 24
%23 = and i64 %22, 255
%24 = trunc i64 %23 to i8
store i8 %24, i8* %9
%25 = load i8*, i8** %4
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = load i8, i8* %9
%33 = zext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %25, i32 %27, i32 %29, i32 %31, i32 %33)
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s %d.%d.%d.%d\0A\00"
define i32 @pbaddr(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = lshr i32 %3, 8
%5 = lshr i32 %3, 16
%6 = lshr i32 %3, 24
%7 = and i32 %3, 255
%8 = and i32 %4, 255
%9 = and i32 %5, 255
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7, i32 %8, i32 %9, i32 %6)
ret i32 undef
}
int test_imm_2Bint16_mem(short *val) {
  return ((*val) & (-0x2B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Bint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffd5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Bint16_mem>:
movzwl (%rdi),%eax
test   $0xffd5,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Bint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -43
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_2Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -43
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ test_allocators();
int main(void) {
  if (test_allocators() != 0)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_allocators@plt>
cmp    $0x0,%rax
je     1141 <main+0x31>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <main+0x3d>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_allocators@plt>
test   %rax,%rax
jne    1126 <main+0x16>
mov    0x2eb4(%rip),%rax
jmp    112d <main+0x1d>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_allocators()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_SUCCESS
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @test_allocators()
%2 = icmp eq i64 %1, 0
%3 = load i32, i32* @EXIT_SUCCESS
%4 = load i32, i32* @EXIT_FAILURE
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
void glAttachShader(unsigned int program, unsigned int shader) {}


x86 assembly (clang, -O0):
<glAttachShader>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glAttachShader>:
ret

LLVM IR (-O0):
define void @glAttachShader(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @glAttachShader(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int wms_close(FILE *f) { return 0; }


x86 assembly (clang, -O0):
<wms_close>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wms_close>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @wms_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @wms_close(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay() { usleep(1000000); }


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf4240,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    $0xf4240,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay() {
%1 = call i32 @usleep(i32 1000000)
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = tail call i32 @usleep(i32 1000000)
ret void
}
/* Variables and functions */
int *malloc(int);
void outAlloc(int n, int **arr) {
  if (n == 0)
    *arr = NULL;
  else
    *arr = malloc(n * sizeof(int));
}


x86 assembly (clang, -O0):
<outAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1139 <outAlloc+0x29>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1152 <outAlloc+0x42>
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outAlloc>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
je     1122 <outAlloc+0x12>
shl    $0x2,%edi
call   1030 <malloc@plt>
jmp    1124 <outAlloc+0x14>
xor    %eax,%eax
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @outAlloc(i32 %0, i32** %1) {
%3 = alloca i32
%4 = alloca i32**
store i32 %0, i32* %3
store i32** %1, i32*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32**, i32*** %4
store i32* null, i32** %8
br label %16
9: ; preds = %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call i32* @malloc(i32 %13)
%15 = load i32**, i32*** %4
store i32* %14, i32** %15
br label %16
16: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @outAlloc(i32 %0, i32** nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = shl i32 %0, 2
%6 = tail call i32* @malloc(i32 %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32* [ %6, %4 ], [ null, %2 ]
store i32* %8, i32** %1
ret void
}
int use_external_header(void) { return 31415926; }


x86 assembly (clang, -O0):
<use_external_header>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1df5e76,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_external_header>:
mov    $0x1df5e76,%eax
ret

LLVM IR (-O0):
define i32 @use_external_header() {
ret i32 31415926
}

LLVM IR (-O2):
define i32 @use_external_header() {
ret i32 31415926
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Welcome to CS 158/159!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Welcome to CS 158/159!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Welcome to CS 158/159!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int qsort_cmp__uchar(const void *x, const void *y) {
  if (*((unsigned char *)x) > *((unsigned char *)y))
    return (-1);
  else
    return (*((unsigned char *)x) < *((unsigned char *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jle    112e <qsort_cmp__uchar+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <qsort_cmp__uchar+0x49>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__uchar>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setb   %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp__uchar(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = icmp slt i32 %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp__uchar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ugt i8 %3, %4
%6 = icmp ult i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ fabs(double);
double floor(scalar_t__);
double round(double x) {
  if (x >= 0.)
    return floor(fabs(x) + 0.5);
  else
    return -floor(fabs(x) + 0.5);
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116e <round+0x4e>
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeaa(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11af <round+0x8f>
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  0xe7b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xec5(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
movapd 0xec3(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd (%rsp),%xmm1
movapd %xmm1,%xmm3
andnpd %xmm0,%xmm3
andpd  %xmm2,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load double, double* %3
%8 = call i64 @fabs(double %7)
%9 = sitofp i64 %8 to double
%10 = fadd double %9, 5.000000e-01
%11 = fptosi double %10 to i64
%12 = call double @floor(i64 %11)
store double %12, double* %2
br label %21
13: ; preds = %1
%14 = load double, double* %3
%15 = call i64 @fabs(double %14)
%16 = sitofp i64 %15 to double
%17 = fadd double %16, 5.000000e-01
%18 = fptosi double %17 to i64
%19 = call double @floor(i64 %18)
%20 = fneg double %19
store double %20, double* %2
br label %21
21: ; preds = %13, %6
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = tail call i64 @fabs(double %0)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i64
%7 = tail call double @floor(i64 %6)
%8 = fneg double %7
%9 = select i1 %2, double %8, double %7
ret double %9
}
int test_imm_02uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x02 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_02uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_02uint64_lowword_reg>:
test   $0x2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_02uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 2
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int LZ5_sizeofStreamState() {
  return (((1 << (20 - 3)) + 4) * sizeof(long long));
}


x86 assembly (clang, -O0):
<LZ5_sizeofStreamState>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100020,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ5_sizeofStreamState>:
mov    $0x100020,%eax
ret

LLVM IR (-O0):
define i32 @LZ5_sizeofStreamState() {
ret i32 1048608
}

LLVM IR (-O2):
define i32 @LZ5_sizeofStreamState() {
ret i32 1048608
}
void send_addr(unsigned char addr) {
  (*(volatile unsigned char *)0x7020000C) = addr;
}


x86 assembly (clang, -O0):
<send_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x7020000c,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_addr>:
mov    %dil,0x7020000c
70
ret

LLVM IR (-O0):
define void @send_addr(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 1881145356 to i8*)
ret void
}

LLVM IR (-O2):
define void @send_addr(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 1881145356 to i8*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void ecrire_cr_ascii(FILE *fichier) { fprintf(fichier, "\n"); }


x86 assembly (clang, -O0):
<ecrire_cr_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecrire_cr_ascii>:
mov    %rdi,%rsi
mov    $0xa,%edi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ecrire_cr_ascii(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @ecrire_cr_ascii(i32* nocapture %0) {
%2 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}
/* Variables and functions */
int PAPI_is_initialized();
void papif_is_initialized__(int *level) { *level = PAPI_is_initialized(); }


x86 assembly (clang, -O0):
<papif_is_initialized__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_is_initialized@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_is_initialized__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_is_initialized@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_is_initialized__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @PAPI_is_initialized()
%4 = load i32*, i32** %2
store i32 %3, i32* %4
ret void
}

LLVM IR (-O2):
define void @papif_is_initialized__(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_is_initialized()
store i32 %2, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t le32toh(uint32_t little_endian_32bits) { return little_endian_32bits; }


x86 assembly (clang, -O0):
<le32toh>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32toh>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @le32toh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @le32toh(i32 returned %0) {
ret i32 %0
}
void omap_register_ion(void) { return; }


x86 assembly (clang, -O0):
<omap_register_ion>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omap_register_ion>:
ret

LLVM IR (-O0):
define void @omap_register_ion() {
ret void
}

LLVM IR (-O2):
define void @omap_register_ion() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add();
int /*<<< orphan*/ by_ptr_mm(int /*<<< orphan*/);
void add_by_ptr_mm(uint32_t x) {
  by_ptr_mm(x);
  add();
}


x86 assembly (clang, -O0):
<add_by_ptr_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <by_ptr_mm@plt>
mov    $0x0,%al
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_by_ptr_mm>:
push   %rax
call   1040 <by_ptr_mm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <add@plt>

LLVM IR (-O0):
define void @add_by_ptr_mm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr_mm(i32 %3)
%5 = call i32 (...) @add()
ret void
}

LLVM IR (-O2):
define void @add_by_ptr_mm(i32 %0) {
%2 = tail call i32 @by_ptr_mm(i32 %0)
%3 = tail call i32 (...) @add()
ret void
}
void g_completion_complete_utf8() {}


x86 assembly (clang, -O0):
<g_completion_complete_utf8>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_completion_complete_utf8>:
ret

LLVM IR (-O0):
define void @g_completion_complete_utf8() {
ret void
}

LLVM IR (-O2):
define void @g_completion_complete_utf8() {
ret void
}
void DMX2Free(double **mx) {
  free(mx[0]);
  free(mx);
}


x86 assembly (clang, -O0):
<DMX2Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMX2Free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @DMX2Free(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @DMX2Free(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
int DeadZone(int in, int size) {
  int out;
  out = in;
  if ((in < size && in > -size))
    out = 0;
  return (out);
}


x86 assembly (clang, -O0):
<DeadZone>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1133 <DeadZone+0x33>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jle    1133 <DeadZone+0x33>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeadZone>:
mov    %esi,%ecx
neg    %ecx
xor    %eax,%eax
cmp    %edi,%ecx
cmovge %edi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
ret

LLVM IR (-O0):
define i32 @DeadZone(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
%14 = icmp sgt i32 %11, %13
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %5
br label %16
16: ; preds = %15, %10, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @DeadZone(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = sub nsw i32 0, %1
%5 = icmp slt i32 %4, %0
%6 = select i1 %3, i1 %5, i1 false
%7 = select i1 %6, i32 0, i32 %0
ret i32 %7
}
/* Variables and functions */
scalar_t__ ispunct(char);
int /*<<< orphan*/ strcpy(char *, char *);
remove_punctuation(char *s) {
  while (*s)
    if (ispunct(*s))
      strcpy(s, s + 1);
    else
      s++;
}


x86 assembly (clang, -O0):
<remove_punctuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1176 <remove_punctuation+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <ispunct@plt>
cmp    $0x0,%rax
je     1165 <remove_punctuation+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
jmp    1171 <remove_punctuation+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <remove_punctuation+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_punctuation>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <remove_punctuation+0x35>
mov    %rdi,%rbx
jmp    113f <remove_punctuation+0x1f>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <strcpy@plt>
movzbl (%rbx),%eax
test   %al,%al
je     1155 <remove_punctuation+0x35>
movsbl %al,%edi
call   1040 <ispunct@plt>
lea    0x1(%rbx),%rsi
test   %rax,%rax
jne    1130 <remove_punctuation+0x10>
mov    %rsi,%rbx
jmp    1138 <remove_punctuation+0x18>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @remove_punctuation(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %21, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @ispunct(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 @strcpy(i8* %14, i8* %16)
br label %21
18: ; preds = %8
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %21
21: ; preds = %18, %13
br label %4
22: ; preds = %4
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @remove_punctuation(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @ispunct(i8 signext %5)
%8 = icmp eq i64 %7, 0
%9 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %8, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @strcpy(i8* %6, i8* %9)
br label %12
12: ; preds = %4, %10
%13 = phi i8* [ %6, %10 ], [ %9, %4 ]
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret i32 undef
}
foo(float f, float g) {
  float beat_freqs[2] = {f - g, f + g};
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @foo(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca [2 x float]
store float %0, float* %3
store float %1, float* %4
%6 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fsub float %7, %8
store float %9, float* %6
%10 = getelementptr inbounds float, float* %6, i64 1
%11 = load float, float* %3
%12 = load float, float* %4
%13 = fadd float %11, %12
store float %13, float* %10
ret i32 1
}

LLVM IR (-O2):
define i32 @foo(float %0, float %1) {
ret i32 1
}
/* Variables and functions */
int initgroups(char const *, int);
int g_initgroups(const char *user, int gid) { return initgroups(user, gid); }


x86 assembly (clang, -O0):
<g_initgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <initgroups@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_initgroups>:
jmp    1030 <initgroups@plt>

LLVM IR (-O0):
define i32 @g_initgroups(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @initgroups(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @g_initgroups(i8* %0, i32 %1) {
%3 = tail call i32 @initgroups(i8* %0, i32 %1)
ret i32 %3
}
char *wind_dec(char *str, int dec) {
  if (dec == 0) {
    return str;
  }
  str = wind_dec(str, dec / 10);
  *str++ = (char)(dec % 10 + '0');
  return str;
}


x86 assembly (clang, -O0):
<wind_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <wind_dec+0x26>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <wind_dec+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <wind_dec@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wind_dec>:
mov    %rdi,%rax
test   %esi,%esi
je     1155 <wind_dec+0x45>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movslq %esi,%rcx
imul   $0x66666667,%rcx,%rbx
mov    %rbx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rbx
add    %ecx,%ebx
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <wind_dec@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ecx
sub    %ecx,%ebp
add    $0x30,%bpl
mov    %bpl,(%rax)
add    $0x1,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @wind_dec(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %4
store i8* %9, i8** %3
br label %22
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 10
%14 = call i8* @wind_dec(i8* %11, i32 %13)
store i8* %14, i8** %4
%15 = load i32, i32* %5
%16 = srem i32 %15, 10
%17 = add nsw i32 %16, 48
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
store i8 %18, i8* %19
%21 = load i8*, i8** %4
store i8* %21, i8** %3
br label %22
22: ; preds = %10, %8
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @wind_dec(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i8* [ %12, %6 ], [ %0, %2 ]
ret i8* %5
6: ; preds = %2
%7 = sdiv i32 %1, 10
%8 = tail call i8* @wind_dec(i8* %0, i32 %7)
%9 = srem i32 %1, 10
%10 = trunc i32 %9 to i8
%11 = add nsw i8 %10, 48
%12 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %11, i8* %8
br label %4
}
Fatal(arg1, arg2, arg3, arg4) char *arg1, *arg2, *arg3, *arg4;
{
  printf(arg1, arg2, arg3, arg4);
  lexit(1);
}


x86 assembly (clang, -O0):
<Fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <lexit@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fatal>:
push   %rax
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <lexit@plt>

LLVM IR (-O0):
define i32 @Fatal(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i8*, i8** %9
%14 = call i32 (i8*, ...) @printf(i8* %10, i8* %11, i8* %12, i8* %13)
%15 = call i32 (i32, ...) bitcast (i32 (...)* @lexit to i32 (i32, ...)*)(i32 1)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @Fatal(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @lexit to i32 (i32, ...)*)(i32 1)
ret i32 undef
}
int unlink(const char *pathname) { return 0; }


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @unlink(i8* nocapture readnone %0) {
ret i32 0
}
__attribute__((no)) int fn3(int x) {
  asm volatile("" : "+r"(x) : : "memory");
  return x;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm sideeffect "", "=r,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @fn3(i32 %0) {
%2 = tail call i32 asm sideeffect "", "=r,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mem_alloc_tiny_func(size_t, size_t);
void *memcpy(int /*<<< orphan*/, void *, size_t);
void *mem_alloc_copy_func(void *src, size_t size, size_t align) {
  return memcpy(mem_alloc_tiny_func(size, align), src, size);
}


x86 assembly (clang, -O0):
<mem_alloc_copy_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <mem_alloc_tiny_func@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc_copy_func>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <mem_alloc_tiny_func@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @mem_alloc_copy_func(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %6
%9 = call i32 @mem_alloc_tiny_func(i64 %7, i64 %8)
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = call i8* @memcpy(i32 %9, i8* %10, i64 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @mem_alloc_copy_func(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @mem_alloc_tiny_func(i64 %1, i64 %2)
%5 = tail call i8* @memcpy(i32 %4, i8* %0, i64 %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G0_f(char *s) {
  debug("G0_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G0_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G0_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"G0_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G0_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"G0_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G0_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
unsigned short blueValue(unsigned short c) { return (c & 31) << 3; }


x86 assembly (clang, -O0):
<blueValue>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x1f,%eax
shl    $0x3,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blueValue>:
shl    $0x3,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define zeroext i16 @blueValue(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 31
%6 = shl i32 %5, 3
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @blueValue(i16 zeroext %0) {
%2 = shl i16 %0, 3
%3 = and i16 %2, 248
ret i16 %3
}
void *xinput_input_init(void) { return (void *)-1; }


x86 assembly (clang, -O0):
<xinput_input_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xinput_input_init>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @xinput_input_init() {
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @xinput_input_init() {
ret i8* inttoptr (i64 -1 to i8*)
}