xunge/DecIR huggingface dataset:
float mean_it(float m, int t, int v) {
  float ret = m + (v - m) / (double)(t + 1);
  return ret;
}


x86 assembly (clang, -O0):
<mean_it>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean_it>:
cvtss2sd %xmm0,%xmm1
cvtsi2ss %esi,%xmm2
subss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
add    $0x1,%edi
xorps  %xmm2,%xmm2
cvtsi2sd %edi,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @mean_it(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = load i32, i32* %6
%11 = sitofp i32 %10 to float
%12 = load float, float* %4
%13 = fsub float %11, %12
%14 = fpext float %13 to double
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
%18 = fdiv double %14, %17
%19 = fadd double %9, %18
%20 = fptrunc double %19 to float
store float %20, float* %7
%21 = load float, float* %7
ret float %21
}

LLVM IR (-O2):
define float @mean_it(float %0, i32 %1, i32 %2) {
%4 = fpext float %0 to double
%5 = sitofp i32 %2 to float
%6 = fsub float %5, %0
%7 = fpext float %6 to double
%8 = add nsw i32 %1, 1
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
%11 = fadd double %10, %4
%12 = fptrunc double %11 to float
ret float %12
}
int bang(int x) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @bang(i32 %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSet8BitBalanceLUT(char byBoardNum, char byChannel, char *pLUT) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSet8BitBalanceLUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSet8BitBalanceLUT(i8 signext %0, i8 signext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSet8BitBalanceLUT(i8 signext %0, i8 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int(isalpha)(int c) { return isalpha(c); }


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

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

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float farenheight, celsius;
  printf("Enter Farenheit Temperature:");
  scanf("%f", &farenheight);
  celsius = (farenheight - 32.0f) * (5.0f / 9.0f);
  printf("Celsius Equivalent %.1f\n", celsius);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xeaa(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe9a(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
addss  0xeb2(%rip),%xmm0
mulss  0xeae(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter Farenheit Temperature:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Celsius Equivalent %.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fsub float %6, 3.200000e+01
%8 = fmul float %7, 0x3FE1C71C80000000
store float %8, float* %3
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter Farenheit Temperature:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Celsius Equivalent %.1f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fadd float %5, -3.200000e+01
%7 = fmul float %6, 0x3FE1C71C80000000
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
int hash(s)
char *s;
{
  int result;
  result = 0;
  while (*s != '\0')
    result = (result << 1) ^ *s++;
  return (result & (512 - 1));
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x1ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %eax,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x1ff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = shl i32 %6, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = xor i32 %9, %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 511
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
char get_SW1(void) {
  char buf[2];
  int SW1;
  SW1 = open("/dev/rtswitch1", O_RDONLY);
  read(SW1, buf, 2);
  close(SW1);
  return buf[0];
}


x86 assembly (clang, -O0):
<get_SW1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x2(%rbp),%rsi
mov    $0x2,%edx
call   1040 <read@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_SW1>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xe(%rsp),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1040 <read@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    0xe(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/dev/rtswitch1\00"
@O_RDONLY = global i32 0
define signext i8 @get_SW1() {
%1 = alloca [2 x i8]
%2 = alloca i32
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 2)
%8 = load i32, i32* %2
%9 = call i32 @close(i32 %8)
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%11 = load i8, i8* %10
ret i8 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"/dev/rtswitch1\00"
@O_RDONLY = global i32 0
define signext i8 @get_SW1() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @read(i32 %4, i8* %2, i32 2)
%6 = tail call i32 @close(i32 %4)
%7 = load i8, i8* %2
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int S_IFBLK;
int mknod(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char const *);
int create_dev(const char *name, dev_t dev) {
  unlink(name);
  return mknod(name, S_IFBLK | 0600, dev);
}


x86 assembly (clang, -O0):
<create_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
or     $0x180,%esi
mov    -0xc(%rbp),%edx
call   1040 <mknod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dev>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <unlink@plt>
mov    0x2eac(%rip),%rax
mov    $0x180,%esi
or     (%rax),%esi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mknod@plt>

LLVM IR (-O0):
@S_IFBLK = global i32 0
define i32 @create_dev(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 = call i32 @unlink(i8* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* @S_IFBLK
%9 = or i32 %8, 384
%10 = load i32, i32* %4
%11 = call i32 @mknod(i8* %7, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@S_IFBLK = global i32 0
define i32 @create_dev(i8* %0, i32 %1) {
%3 = tail call i32 @unlink(i8* %0)
%4 = load i32, i32* @S_IFBLK
%5 = or i32 %4, 384
%6 = tail call i32 @mknod(i8* %0, i32 %5, i32 %1)
ret i32 %6
}
int mian(int argc, char **argv) {
  int i;
  if (argc == 0) {
    i = 1;
  } else {
    i = 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1121 <mian+0x21>
movl   $0x1,-0x14(%rbp)
jmp    1128 <mian+0x28>
movl   $0x2,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mian(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_clear_standard_data(void) {
  int fail;
  int precision = 0;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(864, &precision, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_clear_standard_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x360,%edi
lea    -0x8(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_clear_standard_data>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x360,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_clear_standard_data() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca double*
store i32 0, i32* %2
%5 = load i32*, i32** %3
%6 = load double*, double** %4
%7 = call i32 @_ada_use_c2phc4c(i32 864, i32* %2, i32* %5, double* %6, i32 0)
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @padcon_clear_standard_data() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @_ada_use_c2phc4c(i32 864, i32* %1, i32* undef, double* undef, i32 0)
ret i32 %3
}
DMtrigger() {
  int i = 0;
  i++;
}


x86 assembly (clang, -O0):
<DMtrigger>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @DMtrigger() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @DMtrigger() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ nc_advise(char *, int const, char *, int);
int nc_sync(int);
int ncsync(int ncid) {
  const int status = nc_sync(ncid);
  if (status != 0) {
    nc_advise("ncsync", status, "ncid %d", ncid);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ncsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <nc_sync@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1165 <ncsync+0x45>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xeb3(%rip),%rdi
lea    0xeb3(%rip),%rdx
call   1040 <nc_advise@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <ncsync+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncsync>:
push   %rbx
mov    %edi,%ebx
call   1030 <nc_sync@plt>
test   %eax,%eax
je     114a <ncsync+0x2a>
lea    0xecd(%rip),%rdi
lea    0xecd(%rip),%rdx
mov    %eax,%esi
mov    %ebx,%ecx
call   1040 <nc_advise@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ncsync\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncsync(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @nc_sync(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i32 @nc_advise(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"ncsync\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncsync(i32 %0) {
%2 = tail call i32 @nc_sync(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @nc_advise(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int check_hold(char *command, bool *press_only, bool *release_only) {
  if (command[0] == '_') {
    *press_only = true;
    return 1;
  } else if (command[0] == '^') {
    *release_only = true;
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<check_hold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
jne    1136 <check_hold+0x36>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1163 <check_hold+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5e,%eax
jne    115c <check_hold+0x5c>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1163 <check_hold+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_hold>:
mov    (%rdi),%cl
cmp    $0x5f,%cl
je     1111 <check_hold+0x11>
xor    %eax,%eax
cmp    $0x5e,%cl
jne    111c <check_hold+0x1c>
mov    %rdx,%rsi
movl   $0x1,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_hold(i8* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = load i8, i8* %0
switch i8 %4, label %8 [
i8 95, label %6
i8 94, label %5
]
5: ; preds = %3
br label %6
6: ; preds = %3, %5
%7 = phi i32* [ %2, %5 ], [ %1, %3 ]
store i32 1, i32* %7
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ 0, %3 ], [ 1, %6 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void mutexUnlock(uint8_t mutex) { mutex = 0; }


x86 assembly (clang, -O0):
<mutexUnlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mutexUnlock(i64 %0) {
ret void
}
/* Variables and functions */
scalar_t__ test(char *, int, int);
int main(void) {
  int errors = 0;
  errors += test("-5", -5, 10);
  errors += test("7FFFFFFFFFFFFFFF", 0x7FFFFFFFFFFFFFFFLL, 16);
  return errors;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
mov    $0xfffffffb,%esi
mov    $0xa,%edx
call   1030 <test@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x10,%edx
call   1030 <test@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0xfffffffb,%esi
mov    $0xa,%edx
call   1030 <test@plt>
mov    %rax,%rbx
lea    0xed2(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x10,%edx
call   1030 <test@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-5\00"
@.str.1 = [17 x i8] c"7FFFFFFFFFFFFFFF\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -5, i32 10)
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 16)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"-5\00"
@.str.1 = [17 x i8] c"7FFFFFFFFFFFFFFF\00"
define i32 @main() {
%1 = tail call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -5, i32 10)
%2 = tail call i64 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 16)
%3 = add i64 %2, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
void Profiler_EndMSAAResolve() {}


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

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

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

LLVM IR (-O2):
define void @Profiler_EndMSAAResolve() {
ret void
}
int test_imm_39uint16_reg(unsigned short val) {
  return ((val) & (-0x39 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_39uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffc7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_39uint16_reg>:
test   $0xffc7,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_39uint16_reg(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, -57
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_39uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -57
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wborder_set(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wborder_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_wborder_set+0x2a>
jmp    1170 <cmd_wborder_set+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wborder_set>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wborder_set+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wborder_set(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wborder_set(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ is_conditional_branch(int /*<<< orphan*/);
scalar_t__ is_unconditional_branch(int /*<<< orphan*/);
bool is_branch(uint32_t insn) {
  if (is_conditional_branch(insn) || is_unconditional_branch(insn))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_branch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <is_conditional_branch@plt>
cmp    $0x0,%rax
jne    114f <is_branch+0x2f>
mov    -0x8(%rbp),%edi
call   1040 <is_unconditional_branch@plt>
cmp    $0x0,%rax
je     115b <is_branch+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <is_branch+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_branch>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_conditional_branch@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_branch+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <is_unconditional_branch@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_branch(i32 %0) {
%2 = tail call i64 @is_conditional_branch(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_unconditional_branch(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
double drand48();
double unifrand() { return drand48(); }


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

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

LLVM IR (-O0):
define double @unifrand() {
%1 = call double (...) @drand48()
ret double %1
}

LLVM IR (-O2):
define double @unifrand() {
%1 = tail call double (...) @drand48()
ret double %1
}
void flipScreen(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBIntStatusEndpoint(uint32_t ui32Base) {
  uint32_t ui32Status;
  ASSERT(ui32Base == 0x40050000);
  ui32Status = (*((volatile uint16_t *)(ui32Base + 0x00000002)));
  ui32Status |= ((*((volatile uint16_t *)(ui32Base + 0x00000004))) << 16);
  return (ui32Status);
}


x86 assembly (clang, -O0):
<USBIntStatusEndpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntStatusEndpoint>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x2(%rax),%ecx
mov    0x4(%rax),%eax
shl    $0x10,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @USBIntStatusEndpoint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1074069504
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 2
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 4
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = shl i32 %17, 16
%19 = load i32, i32* %3
%20 = or i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @USBIntStatusEndpoint(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 2
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = add nsw i32 %0, 4
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = shl i32 %12, 16
%14 = or i32 %13, %8
ret i32 %14
}
/* Variables and functions */
bool startswith(const char *prefix, const char *s) {
  while (*prefix == *s) {
    ++prefix;
    ++s;
  }
  return *prefix == '\0';
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113f <startswith+0x3f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <startswith+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
mov    (%rdi),%cl
cmp    (%rsi),%cl
jne    1120 <startswith+0x20>
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%ecx
lea    0x1(%rax),%rdx
cmp    (%rsi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <startswith+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @startswith(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8* [ %10, %6 ], [ %1, %2 ]
%8 = phi i8* [ %9, %6 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = load i8, i8* %10
%13 = icmp eq i8 %11, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = phi i8 [ %3, %2 ], [ %11, %6 ]
%16 = icmp eq i8 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}
int c089(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c089() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c089() {
ret i32 0
}
void ssb_mipscore_init(struct ssb_mipscore *mcore) {}


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

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

LLVM IR (-O0):
%struct.ssb_mipscore = type opaque
define void @ssb_mipscore_init(%struct.ssb_mipscore* %0) {
%2 = alloca %struct.ssb_mipscore*
store %struct.ssb_mipscore* %0, %struct.ssb_mipscore** %2
ret void
}

LLVM IR (-O2):
%struct.ssb_mipscore = type opaque
define void @ssb_mipscore_init(%struct.ssb_mipscore* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ BN_bn2lebinpad(int /*<<< orphan*/ const *, unsigned char *,
                                  int);
void write_lebn(unsigned char **out, const BIGNUM *bn, int len) {
  BN_bn2lebinpad(bn, *out, len);
  *out += len;
}


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

x86 assembly (clang, -O2):
<write_lebn>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rax
mov    %rdi,%rbx
mov    (%rdi),%rsi
mov    %rax,%rdi
call   1030 <BN_bn2lebinpad@plt>
movslq %ebp,%rax
add    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @write_lebn(i8** %0, i32* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i32, i32* %6
%11 = call i32 @BN_bn2lebinpad(i32* %7, i8* %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = sext i32 %12 to i64
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8* %16, i8** %13
ret void
}

LLVM IR (-O2):
define void @write_lebn(i8** nocapture %0, i32* %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @BN_bn2lebinpad(i32* %1, i8* %4, i32 %2)
%6 = load i8*, i8** %0
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret void
}
void WpaEAPPacketAction(struct rt_rtmp_adapter *pAd,
                        struct rt_mlme_queue_elem *Elem) {}


x86 assembly (clang, -O0):
<WpaEAPPacketAction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rt_rtmp_adapter = type opaque
%struct.rt_mlme_queue_elem = type opaque
define void @WpaEAPPacketAction(%struct.rt_rtmp_adapter* %0, %struct.rt_mlme_queue_elem* %1) {
%3 = alloca %struct.rt_rtmp_adapter*
%4 = alloca %struct.rt_mlme_queue_elem*
store %struct.rt_rtmp_adapter* %0, %struct.rt_rtmp_adapter** %3
store %struct.rt_mlme_queue_elem* %1, %struct.rt_mlme_queue_elem** %4
ret void
}

LLVM IR (-O2):
%struct.rt_rtmp_adapter = type opaque
%struct.rt_mlme_queue_elem = type opaque
define void @WpaEAPPacketAction(%struct.rt_rtmp_adapter* nocapture %0, %struct.rt_mlme_queue_elem* nocapture %1) {
ret void
}
int a(int p1, int p2, int p3) {}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @a(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
void gtk_im_context_reset() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
char *fgets(char *buf, int size, FILE *file) {
  fread(buf, size, 1, file);
  return buf;
}


x86 assembly (clang, -O0):
<fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets>:
push   %rbx
mov    %rdx,%rcx
mov    %rdi,%rbx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fgets(i8* returned %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fread(i8* %0, i32 %1, i32 1, i32* %2)
ret i8* %0
}
void _cpu_int_disable() { __asm__("cli"); }


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

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

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

LLVM IR (-O2):
define void @_cpu_int_disable() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a = 1;
  a >> 2;
  printf("%d", a);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main() {
  const int a = 5;
  int *ptr = &a;
  *ptr = 8;
  printf("a: %d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x8,(%rax)
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
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    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"a: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
store i32 8, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"a: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void timer_handler(int signum) {
  static int count = 0;
  printf("timer expired %d times\n", ++count);
}


x86 assembly (clang, -O0):
<timer_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0b(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f02(%rip)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_handler>:
mov    0x2f16(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f0d(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@timer_handler.count = internal global i32 0
@.str = [24 x i8] c"timer expired %d times\0A\00"
define void @timer_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @timer_handler.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @timer_handler.count
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@timer_handler.count = internal unnamed_addr global i32 0
@.str = [24 x i8] c"timer expired %d times\0A\00"
define void @timer_handler(i32 %0) {
%2 = load i32, i32* @timer_handler.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @timer_handler.count
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef long long *__m128;

/* Variables and functions */
__m128 __attribute__((__always___, __nodebug__))
_mm_cvtsi64_ss(__m128 a, long long b) {
  a[0] = b;
  return a;
}


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

x86 assembly (clang, -O2):
<_mm_cvtsi64_ss>:
mov    %rdi,%rax
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define i64* @_mm_cvtsi64_ss(i64* returned writeonly %0, i64 %1) {
store i64 %1, i64* %0
ret i64* %0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int, int, int, int, int, int, int, int, int, int);
int main() {
  for (int i = 0; i < 100; i++) {
    foo(1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11.);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    118a <main+0x7a>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
movl   $0xa,0x18(%rsp)
movl   $0xb,0x20(%rsp)
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
sub    $0x8,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0xb
push   $0xa
push   $0x9
push   $0x8
push   $0x7
call   1030 <foo@plt>
add    $0x30,%rsp
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %1, label %2
}
void cealtesthook_run_verf() {}


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

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

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

LLVM IR (-O2):
define void @cealtesthook_run_verf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(int);
int /*<<< orphan*/ my_putstr(char *);
void my_show_wordtab(char **tab) {
  int i;
  i = 0;
  while (tab[i]) {
    my_putstr(tab[i++]);
    my_putchar(10);
  }
}


x86 assembly (clang, -O0):
<my_show_wordtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1170 <my_show_wordtab+0x50>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
jmp    1133 <my_show_wordtab+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_show_wordtab>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114b <my_show_wordtab+0x2b>
add    $0x8,%rbx
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <my_show_wordtab+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_show_wordtab(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @my_putstr(i8* %6)
%9 = tail call i32 @my_putchar(i32 10)
%10 = getelementptr inbounds i8*, i8** %0, i64 %7
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}