xunge/DecIR huggingface dataset:
int test_longlong() {
  int i;
  long long sums[2] = {0};
#pragma acc parallel loop
  for (i = 0; i < 8192; i++) {
#pragma acc atomic
    sums[0]++;
#pragma acc atomic
    ++sums[1];
  }
  for (i = 0; i < 2; i++) {
    if (sums[i] != (8192)) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_longlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2000,-0x8(%rbp)
jge    1162 <test_longlong+0x52>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <test_longlong+0x1f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a7 <test_longlong+0x97>
movslq -0x8(%rbp),%rax
cmpq   $0x2000,-0x20(%rbp,%rax,8)
je     1194 <test_longlong+0x84>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ae <test_longlong+0x9e>
jmp    1199 <test_longlong+0x89>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <test_longlong+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_longlong() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 8192
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%10 = load i64, i64* %9
%11 = add nsw i64 %10, 1
store i64 %11, i64* %9
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%13 = load i64, i64* %12
%14 = add nsw i64 %13, 1
store i64 %14, i64* %12
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %5
18: ; preds = %5
store i32 0, i32* %2
br label %19
19: ; preds = %32, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 %24
%26 = load i64, i64* %25
%27 = icmp ne i64 %26, 8192
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %36
31: ; preds = %22
br label %32
32: ; preds = %31
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %19
35: ; preds = %19
store i32 0, i32* %1
br label %36
36: ; preds = %35, %28
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
define i32 @test_longlong() {
ret i32 0
}
int unsigned_cmp(const void *a, const void *b) {
  const unsigned *pa = (const unsigned *)a;
  const unsigned *pb = (const unsigned *)b;
  if (*pa < *pb)
    return -1;
  else if (*pa > *pb)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<unsigned_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jae    113a <unsigned_cmp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <unsigned_cmp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jbe    1158 <unsigned_cmp+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <unsigned_cmp+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @unsigned_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ult i32 %5, %6
%8 = icmp ugt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int nnint(double);
int modehprob(int n, int a, int m) {
  double v;
  int mode;
  v = (double)(a + 1) * (m + 1) / (double)(n + 2);
  mode = nnint(v - 0.5);
  return mode;
}


x86 assembly (clang, -O0):
<modehprob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <nnint@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modehprob>:
add    $0x1,%esi
cvtsi2sd %esi,%xmm1
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
add    $0x2,%edi
cvtsi2sd %edi,%xmm2
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
addsd  0xecb(%rip),%xmm0
jmp    1030 <nnint@plt>

LLVM IR (-O0):
define i32 @modehprob(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = sitofp i32 %13 to double
%15 = fmul double %11, %14
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 2
%18 = sitofp i32 %17 to double
%19 = fdiv double %15, %18
store double %19, double* %7
%20 = load double, double* %7
%21 = fsub double %20, 5.000000e-01
%22 = call i32 @nnint(double %21)
store i32 %22, i32* %8
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
define i32 @modehprob(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sitofp i32 %4 to double
%6 = add nsw i32 %2, 1
%7 = sitofp i32 %6 to double
%8 = fmul double %5, %7
%9 = add nsw i32 %0, 2
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = fadd double %11, -5.000000e-01
%13 = tail call i32 @nnint(double %12)
ret i32 %13
}
void sigtdie(n) { sig_die("Killed", 0); }


x86 assembly (clang, -O0):
<sigtdie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <sig_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigtdie>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <sig_die@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Killed\00"
define void @sigtdie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @sig_die to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Killed\00"
define void @sigtdie(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @sig_die to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
void *pdf_aes_e_new(char *final_key, int key_len, unsigned char *iv) {}


x86 assembly (clang, -O0):
<pdf_aes_e_new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @pdf_aes_e_new(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i8* undef
}
int rightrot(unsigned int x, unsigned int n) {
  if (n == 0)
    return x;
  else
    return ((x >> n) | (x << (32 - n)));
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <rightrot+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <rightrot+0x3b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %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 i32, i32* %4
store i32 %9, i32* %3
br label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = lshr i32 %11, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = sub i32 32, %15
%17 = shl i32 %14, %16
%18 = or i32 %13, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %10, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshr.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int ioctl(int, int /*<<< orphan*/, int *);
int usart_dataAvail(int fd) {
  int result;
  if (ioctl(fd, FIONREAD, &result) == -1)
    return -1;
  return result;
}


x86 assembly (clang, -O0):
<usart_dataAvail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1145 <usart_dataAvail+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <usart_dataAvail+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_dataAvail>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
je     112d <usart_dataAvail+0x1d>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @usart_dataAvail(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @FIONREAD
%7 = call i32 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @usart_dataAvail(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @FIONREAD
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
int oph_output_data_free(char **output, int num) {
  int i;
  if (output) {
    for (i = 0; i < num; i++)
      free(output[i]);
    free(output);
  }
  return 0;
}


x86 assembly (clang, -O0):
<oph_output_data_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <oph_output_data_free+0x55>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <oph_output_data_free+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <oph_output_data_free+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oph_output_data_free>:
test   %rdi,%rdi
je     114f <oph_output_data_free+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <oph_output_data_free+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <oph_output_data_free+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
pop    %rbx
pop    %r14
pop    %r15
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @oph_output_data_free(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = icmp ne i8** %6, null
br i1 %7, label %8, label %25
8: ; preds = %2
store i32 0, i32* %5
br label %9
9: ; preds = %19, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i8**, i8*** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
br label %19
19: ; preds = %13
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %9
22: ; preds = %9
%23 = load i8**, i8*** %3
%24 = bitcast i8** %23 to i8*
br label %25
25: ; preds = %22, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @oph_output_data_free(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
%15 = bitcast i8** %0 to i8*
tail call void @free(i8* %15)
br label %16
16: ; preds = %14, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int, size_t);
void uninitvar_setvbuf(void) {
  FILE *stream;
  char *buf;
  int mode;
  size_t size;
  (void)setvbuf(stream, buf, mode, size);
}


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

x86 assembly (clang, -O2):
<uninitvar_setvbuf>:
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
define void @uninitvar_setvbuf() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = load i32*, i32** %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = load i64, i64* %4
%9 = call i32 @setvbuf(i32* %5, i8* %6, i32 %7, i64 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_setvbuf() {
%1 = tail call i32 @setvbuf(i32* undef, i8* undef, i32 undef, i64 undef)
ret void
}
/* Variables and functions */
int atexit(void (*)());
int c_atexit(void (*arg0)(void)) { return atexit(arg0); }


x86 assembly (clang, -O0):
<c_atexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1130 <atexit>
add    $0x10,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<c_atexit>:
jmp    1120 <atexit>
cs nopw 0x0(%rax,%rax,1)
nop

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

LLVM IR (-O2):
define i32 @c_atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @atexit(void (...)* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void ETH_WKUP_IRQHandler() { default_handler(); }


x86 assembly (clang, -O0):
<ETH_WKUP_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <default_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ETH_WKUP_IRQHandler>:
xor    %eax,%eax
jmp    1030 <default_handler@plt>

LLVM IR (-O0):
define weak void @ETH_WKUP_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @ETH_WKUP_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void for_statement(int flag) {
  for (int i = 0; i < flag; i++) {
  }
}


x86 assembly (clang, -O0):
<for_statement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <for_statement+0x2d>
jmp    111f <for_statement+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <for_statement+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @for_statement(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @for_statement(i32 %0) {
ret void
}
int negation_in_conditional() {
  int *x = 0;
  if (!x)
    return 0;
  else
    return *x;
}


x86 assembly (clang, -O0):
<negation_in_conditional>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <negation_in_conditional+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112c <negation_in_conditional+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @negation_in_conditional() {
%1 = alloca i32
%2 = alloca i32*
store i32* null, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 0, i32* %1
br label %9
6: ; preds = %0
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @negation_in_conditional() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void my_printb16(char c) {
  if (c > 15)
    my_printb16(c / 16);
  if (c % 16 > 9)
    my_putchar(((c % 16) - 10) + 97);
  else
    my_putchar((c % 16) + 48);
}


x86 assembly (clang, -O0):
<my_printb16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xf,%eax
jle    114f <my_printb16+0x2f>
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
movsbl %al,%edi
call   1030 <my_printb16@plt>
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jle    1185 <my_printb16+0x65>
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
sub    $0xa,%eax
add    $0x61,%eax
movsbl %al,%edi
call   1040 <my_putchar@plt>
jmp    119e <my_printb16+0x7e>
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1040 <my_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_printb16>:
push   %rbx
mov    %edi,%ebx
cmp    $0x10,%bl
jl     1135 <my_printb16+0x15>
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <my_printb16@plt>
mov    %ebx,%eax
sar    $0x7,%al
shr    $0x4,%al
add    %bl,%al
and    $0xf0,%al
sub    %al,%bl
cmp    $0xa,%bl
mov    $0x57,%eax
mov    $0x30,%ecx
cmovge %eax,%ecx
add    %bl,%cl
movsbl %cl,%edi
pop    %rbx
jmp    1040 <my_putchar@plt>

LLVM IR (-O0):
define void @my_printb16(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 15
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sdiv i32 %8, 16
%10 = trunc i32 %9 to i8
br label %11
11: ; preds = %6, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = srem i32 %13, 16
%15 = icmp sgt i32 %14, 9
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = srem i32 %18, 16
%20 = sub nsw i32 %19, 10
%21 = add nsw i32 %20, 97
%22 = trunc i32 %21 to i8
%23 = call i32 @my_putchar(i8 signext %22)
br label %31
24: ; preds = %11
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = srem i32 %26, 16
%28 = add nsw i32 %27, 48
%29 = trunc i32 %28 to i8
%30 = call i32 @my_putchar(i8 signext %29)
br label %31
31: ; preds = %24, %16
ret void
}

LLVM IR (-O2):
define void @my_printb16(i8 signext %0) {
%2 = icmp sgt i8 %0, 15
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i8 %0, 4
tail call void @my_printb16(i8 signext %4)
br label %5
5: ; preds = %3, %1
%6 = srem i8 %0, 16
%7 = icmp sgt i8 %6, 9
%8 = select i1 %7, i8 87, i8 48
%9 = add nsw i8 %6, %8
%10 = tail call i32 @my_putchar(i8 signext %9)
ret void
}
void space() { return; }


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

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

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

LLVM IR (-O2):
define void @space() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ bar();
int baz(int);
int main(void) {
  if (bar())
    abort();
  if (baz(0) != 1)
    abort();
  if (baz(1) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <bar@plt>
cmp    $0x0,%rax
je     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <baz@plt>
cmp    $0x1,%eax
je     116e <main+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%edi
call   1040 <baz@plt>
cmp    $0x1,%eax
je     1188 <main+0x58>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <bar@plt>
test   %rax,%rax
jne    115c <main+0x2c>
xor    %edi,%edi
call   1040 <baz@plt>
cmp    $0x1,%eax
jne    115c <main+0x2c>
mov    $0x1,%edi
call   1040 <baz@plt>
cmp    $0x1,%eax
jne    115c <main+0x2c>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @bar()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @baz(i32 0)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @baz(i32 1)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @bar()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @baz(i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @baz(i32 1)
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}
/* Variables and functions */
float gasdev(int *);
float gaussian() {
  int seed = 0;
  return (gasdev(&seed));
}


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

x86 assembly (clang, -O2):
<gaussian>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <gasdev@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @gaussian() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call float @gasdev(i32* %1)
ret float %2
}

LLVM IR (-O2):
define float @gaussian() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call float @gasdev(i32* %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Opqa_Left(int value) {
  if (value) {
    cpc_key_press(0x42);
  } else {
    cpc_key_unpress(0x42);
  };
}


x86 assembly (clang, -O0):
<Joy_Opqa_Left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Opqa_Left+0x24>
mov    $0x42,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Opqa_Left+0x2e>
mov    $0x42,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Opqa_Left>:
test   %edi,%edi
je     112e <Joy_Opqa_Left+0xe>
mov    $0x42,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x42,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Opqa_Left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 66)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 66)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Opqa_Left(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 66)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 66)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
void *dropt_safe_realloc(int /*<<< orphan*/ *, size_t, size_t);
void *dropt_safe_malloc(size_t numElements, size_t elementSize) {
  return dropt_safe_realloc(NULL, numElements, elementSize);
}


x86 assembly (clang, -O0):
<dropt_safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <dropt_safe_realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropt_safe_malloc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <dropt_safe_realloc@plt>

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

LLVM IR (-O2):
define i8* @dropt_safe_malloc(i64 %0, i64 %1) {
%3 = tail call i8* @dropt_safe_realloc(i32* null, i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chroot(const char *path) {
  assert(!"NYI");
  return -1;
}


x86 assembly (clang, -O0):
<chroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chroot>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"NYI\00"
define i32 @chroot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @assert(i32 0)
ret i32 -1
}

LLVM IR (-O2):
define i32 @chroot(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 -1
}
void copy(char source[], char dest[]) {
  int i = 0;
  for (; (dest[i] = source[i]) != '\0'; ++i)
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <copy+0x48>
jmp    113a <copy+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void main() { print("Hello world"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define void @main() {
%1 = call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct varyad {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct varyad *);
void varyad_free(struct varyad *v) { free(v); }


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

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

LLVM IR (-O0):
%struct.varyad = type { i32 }
define void @varyad_free(%struct.varyad* %0) {
%2 = alloca %struct.varyad*
store %struct.varyad* %0, %struct.varyad** %2
%3 = load %struct.varyad*, %struct.varyad** %2
%4 = call i32 @free(%struct.varyad* %3)
ret void
}

LLVM IR (-O2):
%struct.varyad = type { i32 }
define void @varyad_free(%struct.varyad* nocapture %0) {
%2 = tail call i32 @free(%struct.varyad* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process(int, int);
int /*<<< orphan*/ start(int *, int *);
void blue_run(void) {
  int in_f;
  int out_f;
  start(&in_f, &out_f);
  process(in_f, out_f);
}


x86 assembly (clang, -O0):
<blue_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <start@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <process@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blue_run>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <start@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <process@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @blue_run() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @start(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @process(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
define void @blue_run() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @start(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @process(i32 %6, i32 %7)
ret void
}
void ROM_SysTickEnable() {}


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

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

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

LLVM IR (-O2):
define void @ROM_SysTickEnable() {
ret void
}
/* Variables and functions */
void *memchr(const void *s, int c) {
  register unsigned char *p;
  p = (unsigned char *)s - 1;
  do {
    if (*++p == (unsigned char)c)
      return (void *)p;
  } while (*p);
  return 0;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl 0x1(%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1145 <memchr+0x45>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <memchr+0x5f>
jmp    114a <memchr+0x4a>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
cmp    %sil,%cl
je     1122 <memchr+0x22>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @memchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8* %8, i8** %6
br label %9
9: ; preds = %21, %2
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %6
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i32, i32* %5
%15 = trunc i32 %14 to i8
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br i1 %17, label %18, label %20
18: ; preds = %9
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %26
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i8*, i8** %6
%23 = load i8, i8* %22
%24 = icmp ne i8 %23, 0
br i1 %24, label %9, label %25
25: ; preds = %21
store i8* null, i8** %3
br label %26
26: ; preds = %25, %18
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -1
%4 = trunc i32 %1 to i8
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %3, %2 ], [ %7, %10 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %4
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = icmp eq i8 %8, 0
br i1 %11, label %12, label %5
12: ; preds = %10, %5
%13 = phi i8* [ %7, %5 ], [ null, %10 ]
ret i8* %13
}
/* Variables and functions */
size_t expsize(size_t size) {
  size_t exp;
  exp = 4;
  while ((size_t)(1 << exp) < size)
    ++exp;
  return (exp);
}


x86 assembly (clang, -O0):
<expsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x4,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
cmp    -0x8(%rbp),%rax
jae    113a <expsize+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <expsize+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<expsize>:
mov    $0x3,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
cmp    %rdi,%rax
jb     1110 <expsize+0x10>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @expsize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 4, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = load i64, i64* %2
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @expsize(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 4, %1 ], [ %8, %2 ]
%4 = trunc i64 %3 to i32
%5 = shl nuw i32 1, %4
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, %0
%8 = add i64 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i64 %3
}
extern __attribute__((__gnu___)) double __attribute__((__const__))
cimag(double _Complex _Z) {
  return __imag__ _Z;
}


x86 assembly (clang, -O0):
<cimag>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cimag>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cimag(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @cimag(double %0, double returned %1) {
ret double %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void swap_direct(uint32_t *x, uint32_t *y) {
  uint32_t tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}


x86 assembly (clang, -O0):
<swap_direct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_direct>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap_direct(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
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_direct(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int test_imm_D6int32_reg(int val) { return ((val) & (0xD6 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_D6int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D6int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 214
%5 = icmp ne i32 %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_D6int32_reg(i32 %0) {
%2 = and i32 %0, 214
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gdt_init();
int /*<<< orphan*/ hang();
kmain() {
  gdt_init();
  hang();
}


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

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

LLVM IR (-O0):
define i32 @kmain() {
%1 = alloca i32
%2 = call i32 (...) @gdt_init()
%3 = call i32 (...) @hang()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @kmain() {
%1 = tail call i32 (...) @gdt_init()
%2 = tail call i32 (...) @hang()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void description() {
  fprintf(stdout, "\x1b[33m"
                  "Description: "
                  "\x1b[0m");
  fprintf(stdout,
          "Json pretty-print parser based on a recursive "
          "lexical analyser.\n\tThe input file is parsed to build a json "
          "object. If the object \n\tis correct, it will be "
          "pretty-printed to standard output\n\n");
}


x86 assembly (clang, -O0):
<description>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<description>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee8(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [23 x i8] c"\1B[33mDescription: \1B[0m\00"
@.str.1 = [189 x i8] c"Json pretty-print parser based on a recursive lexical analyser.\0A\09The input file is parsed to build a json object. If the object \0A\09is correct, it will be pretty-printed to standard output\0A\0A\00"
define void @description() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [23 x i8] c"\1B[33mDescription: \1B[0m\00"
@.str.1 = [189 x i8] c"Json pretty-print parser based on a recursive lexical analyser.\0A\09The input file is parsed to build a json object. If the object \0A\09is correct, it will be pretty-printed to standard output\0A\0A\00"
define void @description() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int AMCTimingEvent_Free(struct AMCTimingEvent *timeEvent) { return -1; }


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

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

LLVM IR (-O0):
%struct.AMCTimingEvent = type opaque
define i32 @AMCTimingEvent_Free(%struct.AMCTimingEvent* %0) {
%2 = alloca %struct.AMCTimingEvent*
store %struct.AMCTimingEvent* %0, %struct.AMCTimingEvent** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.AMCTimingEvent = type opaque
define i32 @AMCTimingEvent_Free(%struct.AMCTimingEvent* nocapture readnone %0) {
ret i32 -1
}
void exception_init(void) {}


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

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

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

LLVM IR (-O2):
define void @exception_init() {
ret void
}
/* Variables and functions */
int find3(int);
int /*<<< orphan*/ printf(char *, int, ...);
int reverse(int);
int main() {
  int find2 = 0x66;
  int find33 = 0xFF;
  find2 = find3(find2);
  find33 = find3(find33);
  printf("\ntwo 1s: %d\nthree 1s: %d\n", find2, find33);
  int rev = 0x6;
  rev = reverse(rev);
  printf("reversed of 0x6 : 0x%x\n\n", rev);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x66,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <find3@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <find3@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x6,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x66,%edi
call   1050 <find3@plt>
mov    %eax,%ebx
mov    $0xff,%edi
call   1050 <find3@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6,%edi
call   1030 <reverse@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0Atwo 1s: %d\0Athree 1s: %d\0A\00"
@.str.1 = [25 x i8] c"reversed of 0x6 : 0x%x\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 102, i32* %1
store i32 255, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @find3(i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @find3(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
store i32 6, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @reverse(i32 %11)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0Atwo 1s: %d\0Athree 1s: %d\0A\00"
@.str.1 = [25 x i8] c"reversed of 0x6 : 0x%x\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @find3(i32 102)
%2 = tail call i32 @find3(i32 255)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @reverse(i32 6)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void INT_Excep_USBA_D0FIFO2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_USBA_D0FIFO2() {
ret void
}
void __assert_fail(void) {}


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

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

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

LLVM IR (-O2):
define void @__assert_fail() {
ret void
}
int logicOr(int x, int y) {
  if (x || y == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<logicOr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111e <logicOr+0x1e>
cmpl   $0x1,-0xc(%rbp)
jne    112a <logicOr+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <logicOr+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicOr>:
test   %edi,%edi
setne  %al
cmp    $0x1,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @logicOr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 1, i32* %3
br label %13
12: ; preds = %8
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @logicOr(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp eq i32 %1, 1
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}