xunge/DecIR huggingface dataset:
/* Variables and functions */
double exp(double);
double dbtorms(double f) {
  if (f <= 0)
    return (0);
  else {
    if (f > 485)
      f = 485;
    return (exp((2.302585092994 * 0.05) * (f - 100.)));
  }
}


x86 assembly (clang, -O0):
<dbtorms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1138 <dbtorms+0x28>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <dbtorms+0x73>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115c <dbtorms+0x4c>
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xea7(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbtorms>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    113f <dbtorms+0x2f>
movsd  0xede(%rip),%xmm1
minsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm1
mulsd  0xeda(%rip),%xmm1
movapd %xmm1,%xmm0
jmp    1030 <exp@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dbtorms(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %16
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 4.850000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store double 4.850000e+02, double* %3
br label %11
11: ; preds = %10, %7
%12 = load double, double* %3
%13 = fsub double %12, 1.000000e+02
%14 = fmul double 0x3FBD791C5F88877F, %13
%15 = call double @exp(double %14)
store double %15, double* %2
br label %16
16: ; preds = %11, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @dbtorms(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fcmp ogt double %0, 4.850000e+02
%5 = select i1 %4, double 4.850000e+02, double %0
%6 = fadd double %5, -1.000000e+02
%7 = fmul double %6, 0x3FBD791C5F88877F
%8 = tail call double @exp(double %7)
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ 0.000000e+00, %1 ]
ret double %10
}
int complong(const void *arg1, const void *arg2) {
  long l1 = *(long *)arg1;
  long l2 = *(long *)arg2;
  if (l1 == l2) {
    return 0;
  } else if (l1 < l2) {
    return -1;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<complong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <complong+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115d <complong+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <complong+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <complong+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @complong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int abs(int i) {
  if (i < 0) {
    i *= -1;
    return i;
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1123 <abs+0x23>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <abs+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void os_stop_sample(int a) {}


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

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

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

LLVM IR (-O2):
define void @os_stop_sample(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, ...);
void handler(int sig_num) {
  printf("Segnale '%d' al PID: %ld\n", sig_num, (long)getpid());
  printf("%s", "\007");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x7,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Segnale '%d' al PID: %ld\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\07\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 (...) @getpid()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3, i64 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Segnale '%d' al PID: %ld\0A\00"
define void @handler(i32 %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %2)
%4 = tail call i32 @putchar(i32 7)
ret void
}
void path_002_expected_2(int a) {
  if (a) {
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <path_002_expected_2+0x16>
jmp    1116 <path_002_expected_2+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @path_002_expected_2(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 %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @path_002_expected_2(i32 %0) {
ret void
}
void ff_h264dsp_init_mips() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264dsp_init_mips() {
ret void
}
unsigned int nth_position(unsigned int num, int position) {
  return ((num >> position) & 1);
}


x86 assembly (clang, -O0):
<nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_position>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
char *my_strdup(char *);
scalar_t__ strcmp(char *, char *);
char *a_and(char *pcL, char *pcR) {
  if (strcmp(pcL, "TRUE") == 0)
    return my_strdup(pcR);
  else
    return my_strdup("FALSE");
}


x86 assembly (clang, -O0):
<a_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115c <a_and+0x3c>
mov    -0x18(%rbp),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116c <a_and+0x4c>
lea    0xea2(%rip),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_and>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xecb(%rip),%rdi
cmove  %rbx,%rdi
pop    %rbx
jmp    1040 <my_strdup@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i8* @a_and(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i8* @my_strdup(i8* %5)
ret i8* %6
}
void ff_hevc_put_hevc_pel_pixels32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels32_10_avx2() {
ret void
}
int to_fixnum_rep(int v) { return (v << 2); }


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

x86 assembly (clang, -O2):
<to_fixnum_rep>:
lea    0x0(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @to_fixnum_rep(i32 %0) {
%2 = shl i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void baz() {
  fprintf(stderr, "** Return address successfully overwritten **\n");
  fflush(stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<baz>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"** Return address successfully overwritten **\0A\00"
@stdout = global i32 0
define void @baz() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"** Return address successfully overwritten **\0A\00"
@stdout = global i32 0
define void @baz() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ WriteToLog(char *);
int /*<<< orphan*/ sprintf(char *, char const *, int);
void WriteToLogArgI(const char *msg, int arg) {
  char buf[100];
  sprintf(buf, msg, arg);
  WriteToLog(buf);
}


x86 assembly (clang, -O0):
<WriteToLogArgI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <WriteToLog@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteToLogArgI>:
push   %rbx
sub    $0x70,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <WriteToLog@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @WriteToLogArgI(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @WriteToLog(i8* %10)
ret void
}

LLVM IR (-O2):
define void @WriteToLogArgI(i8* nocapture %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i32 %1)
%6 = call i32 @WriteToLog(i8* %4)
ret void
}
char *index(s, c)
char *s;
int c;
{ return (strchr(s, c)); }


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

x86 assembly (clang, -O2):
<index>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @index(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
scalar_t__ malloc(int);
struct timeval *Selective_InitTime(unsigned int sec, unsigned int usec) {
  struct timeval *t = (struct timeval *)malloc(sizeof(struct timeval));
  t->tv_sec = (long int)sec;
  t->tv_usec = (long int)usec;
  return t;
}


x86 assembly (clang, -O0):
<Selective_InitTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Selective_InitTime>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %ebp,%ecx
mov    %rcx,(%rax)
mov    %ebx,%ecx
mov    %rcx,0x8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define %struct.timeval* @Selective_InitTime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i64 @malloc(i32 16)
%7 = inttoptr i64 %6 to %struct.timeval*
store %struct.timeval* %7, %struct.timeval** %5
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = load %struct.timeval*, %struct.timeval** %5
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
store i64 %9, i64* %11
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = load %struct.timeval*, %struct.timeval** %5
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
store i64 %13, i64* %15
%16 = load %struct.timeval*, %struct.timeval** %5
ret %struct.timeval* %16
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define %struct.timeval* @Selective_InitTime(i32 %0, i32 %1) {
%3 = tail call i64 @malloc(i32 16)
%4 = inttoptr i64 %3 to %struct.timeval*
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
store i64 %5, i64* %6
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
store i64 %7, i64* %8
ret %struct.timeval* %4
}
int ftoi(float f) { return f; }


x86 assembly (clang, -O0):
<ftoi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftoi>:
cvttss2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @ftoi(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __xstat(int, char const *, struct stat *);
int __lxstat(int version, const char *file, struct stat *buf) {
  return __xstat(version, file, buf);
}


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

x86 assembly (clang, -O2):
<__lxstat>:
jmp    1030 <__xstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @__lxstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.stat*, %struct.stat** %6
%10 = call i32 @__xstat(i32 %7, i8* %8, %struct.stat* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__lxstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = tail call i32 @__xstat(i32 %0, i8* %1, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ termios_init(int);
int /*<<< orphan*/ termios_reset();
char getch() {
  char my_char = 0;
  termios_init(true);
  my_char = fgetc(stdin);
  termios_reset();
  return my_char;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <termios_init@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1050 <termios_reset@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rbx
mov    $0x1,%edi
call   1030 <termios_init@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <termios_reset@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define signext i8 @getch() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @termios_init(i32 1)
%3 = load i32, i32* @stdin
%4 = call signext i8 @fgetc(i32 %3)
store i8 %4, i8* %1
%5 = call i32 (...) @termios_reset()
%6 = load i8, i8* %1
ret i8 %6
}

LLVM IR (-O2):
@stdin = global i32 0
define signext i8 @getch() {
%1 = tail call i32 @termios_init(i32 1)
%2 = load i32, i32* @stdin
%3 = tail call signext i8 @fgetc(i32 %2)
%4 = tail call i32 (...) @termios_reset()
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void bf_init(unsigned char *data, int num_bools) {
  int size = ((int)((num_bools) / 8) + ((num_bools) % 8 == 0 ? 0 : 1));
  memset(data, 0, size);
}


x86 assembly (clang, -O0):
<bf_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
mov    %edx,%esi
mov    $0x1,%ecx
xor    %edx,%edx
cmp    $0x0,%esi
cmove  %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_init>:
lea    0x7(%rsi),%edx
test   %esi,%esi
cmovns %esi,%edx
sar    $0x3,%edx
and    $0x7,%esi
cmp    $0x1,%esi
sbb    $0xffffffff,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bf_init(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 i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = load i32, i32* %4
%9 = srem i32 %8, 8
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
%13 = add nsw i32 %7, %12
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = call i32 @memset(i8* %14, i32 0, i32 %15)
ret void
}

LLVM IR (-O2):
define void @bf_init(i8* %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = and i32 %1, 7
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
%8 = tail call i32 @memset(i8* %0, i32 0, i32 %7)
ret void
}
void *hack(const struct dummy *t, const enum dummy_enum *e) {
  return (void *)t;
}


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

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

LLVM IR (-O0):
%struct.dummy = type opaque
define i8* @hack(%struct.dummy* %0, i32* %1) {
%3 = alloca %struct.dummy*
%4 = alloca i32*
store %struct.dummy* %0, %struct.dummy** %3
store i32* %1, i32** %4
%5 = load %struct.dummy*, %struct.dummy** %3
%6 = bitcast %struct.dummy* %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
%struct.dummy = type opaque
define i8* @hack(%struct.dummy* readnone %0, i32* nocapture readnone %1) {
%3 = bitcast %struct.dummy* %0 to i8*
ret i8* %3
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE_DATA;
int /*<<< orphan*/ I2C_SMBUS_WRITE;
int i2c_smbus_access(int, int /*<<< orphan*/, int, int /*<<< orphan*/,
                     union i2c_smbus_data *);
int wiringPiI2CWriteReg8(int fd, int reg, int value) {
  union i2c_smbus_data data;
  data.byte = value;
  return i2c_smbus_access(fd, I2C_SMBUS_WRITE, reg, I2C_SMBUS_BYTE_DATA, &data);
}


x86 assembly (clang, -O0):
<wiringPiI2CWriteReg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2eab(%rip),%rax
mov    (%rax),%ecx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiI2CWriteReg8>:
push   %rax
mov    %esi,%eax
mov    %edx,(%rsp)
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
mov    %rsp,%r8
mov    %eax,%edx
call   1030 <i2c_smbus_access@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE_DATA = global i32 0
define i32 @wiringPiI2CWriteReg8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.i2c_smbus_data
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = bitcast %union.i2c_smbus_data* %7 to i32*
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* @I2C_SMBUS_WRITE
%12 = load i32, i32* %5
%13 = load i32, i32* @I2C_SMBUS_BYTE_DATA
%14 = call i32 @i2c_smbus_access(i32 %10, i32 %11, i32 %12, i32 %13, %union.i2c_smbus_data* %7)
ret i32 %14
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE_DATA = global i32 0
define i32 @wiringPiI2CWriteReg8(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.i2c_smbus_data
%5 = bitcast %union.i2c_smbus_data* %4 to i8*
%6 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = load i32, i32* @I2C_SMBUS_WRITE
%8 = load i32, i32* @I2C_SMBUS_BYTE_DATA
%9 = call i32 @i2c_smbus_access(i32 %0, i32 %7, i32 %1, i32 %8, %union.i2c_smbus_data* %4)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void gwPostRedisplay() { glutPostRedisplay(); }


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

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

LLVM IR (-O0):
define void @gwPostRedisplay() {
%1 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @gwPostRedisplay() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
void resetServerStats(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               114, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<resetServerStats>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x72,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetServerStats>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x72,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.resetServerStats = [17 x i8] c"resetServerStats\00"
define void @resetServerStats() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 114, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.resetServerStats, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.resetServerStats = [17 x i8] c"resetServerStats\00"
define void @resetServerStats() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 114, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.resetServerStats, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bounce_west();
void do_east(void) { bounce_west(); }


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

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

LLVM IR (-O0):
define void @do_east() {
%1 = call i32 (...) @bounce_west()
ret void
}

LLVM IR (-O2):
define void @do_east() {
%1 = tail call i32 (...) @bounce_west()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_branch();
int /*<<< orphan*/ e_bvs();
void e_bvs_branch() {
  e_branch();
  e_bvs();
}


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

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

LLVM IR (-O0):
define void @e_bvs_branch() {
%1 = call i32 (...) @e_branch()
%2 = call i32 (...) @e_bvs()
ret void
}

LLVM IR (-O2):
define void @e_bvs_branch() {
%1 = tail call i32 (...) @e_branch()
%2 = tail call i32 (...) @e_bvs()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void bfr_read(void *dst, char **src, size_t size) {
  memcpy(dst, *src, size);
  *src += size;
}


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

x86 assembly (clang, -O2):
<bfr_read>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    (%rsi),%rsi
call   1030 <memcpy@plt>
add    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @bfr_read(i8* %0, i8** nocapture %1, i64 %2) {
%4 = load i8*, i8** %1
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i64 %2)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 %2
store i8* %7, i8** %1
ret void
}
void gtk_window_set_icon() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_icon() {
ret void
}
unsigned mk_ebmlSizeSize(unsigned s) {
  if (s < 0x7f)
    return 1;
  if (s < 0x3fff)
    return 2;
  if (s < 0x1fffff)
    return 3;
  if (s < 0x0fffffff)
    return 4;
  return 5;
}


x86 assembly (clang, -O0):
<mk_ebmlSizeSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jae    111d <mk_ebmlSizeSize+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    116f <mk_ebmlSizeSize+0x6f>
cmpl   $0x3fff,-0x8(%rbp)
jae    1136 <mk_ebmlSizeSize+0x36>
movl   $0x2,-0x4(%rbp)
jmp    116f <mk_ebmlSizeSize+0x6f>
cmpl   $0x1fffff,-0x8(%rbp)
jae    114f <mk_ebmlSizeSize+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    116f <mk_ebmlSizeSize+0x6f>
cmpl   $0xfffffff,-0x8(%rbp)
jae    1168 <mk_ebmlSizeSize+0x68>
movl   $0x4,-0x4(%rbp)
jmp    116f <mk_ebmlSizeSize+0x6f>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_ebmlSizeSize>:
mov    $0x1,%eax
cmp    $0x7f,%edi
jb     1132 <mk_ebmlSizeSize+0x32>
mov    $0x2,%eax
cmp    $0x3fff,%edi
jb     1132 <mk_ebmlSizeSize+0x32>
mov    $0x3,%eax
cmp    $0x1fffff,%edi
jb     1132 <mk_ebmlSizeSize+0x32>
cmp    $0xfffffff,%edi
mov    $0x5,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @mk_ebmlSizeSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 16383
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 2097151
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp ult i32 %16, 268435455
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 5, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @mk_ebmlSizeSize(i32 %0) {
%2 = icmp ult i32 %0, 127
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 16383
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 2097151
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 268435455
%9 = select i1 %8, i32 4, i32 5
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
int test_imm_BCint64_midword_reg(long long val) {
  return ((val >> 16) & (0xBC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BCint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 188
%6 = icmp ne i64 %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_BCint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12320768
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void nseel_asm_shl(void) {
  __asm__("fistpl (%esi)\n"
          "fistpl 4(%esi)\n"
          "movl (%esi), %ecx\n"
          "movl 4(%esi), %eax\n"
          "shll %cl, %eax\n"
          "movl %eax, (%esi)\n"
          "fildl (%esi)\n");
}


x86 assembly (clang, -O0):
<nseel_asm_shl>:
push   %rbp
mov    %rsp,%rbp
fistpl (%esi)
fistpl 0x4(%esi)
mov    (%esi),%ecx
mov    0x4(%esi),%eax
shl    %cl,%eax
mov    %eax,(%esi)
fildl  (%esi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_shl>:
fistpl (%esi)
fistpl 0x4(%esi)
mov    (%esi),%ecx
mov    0x4(%esi),%eax
shl    %cl,%eax
mov    %eax,(%esi)
fildl  (%esi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_shl() {
tail call void asm sideeffect "fistpl (%esi)\0Afistpl 4(%esi)\0Amovl (%esi), %ecx\0Amovl 4(%esi), %eax\0Ashll %cl, %eax\0Amovl %eax, (%esi)\0Afildl (%esi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int ftpcmd_recv();
int /*<<< orphan*/ ftpcmd_send(char const *, char const *);
int ftpcmd(const char *a, const char *b) {
  ftpcmd_send(a, b);
  return ftpcmd_recv();
}


x86 assembly (clang, -O0):
<ftpcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ftpcmd_send@plt>
mov    $0x0,%al
call   1040 <ftpcmd_recv@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ftpcmd(i8* %0, i8* %1) {
%3 = tail call i32 @ftpcmd_send(i8* %0, i8* %1)
%4 = tail call i32 (...) @ftpcmd_recv()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%i", &a);
  scanf("%i", &b);
  printf("%i\n", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chirp_ticket_isticketfilename(char const *, char const **);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void chirp_ticket_subject(char *ticket_subject, const char *ticket_filename) {
  const char *digest;
  int result = chirp_ticket_isticketfilename(ticket_filename, &digest);
  assert(result);
  sprintf(ticket_subject,
          "ticket:"
          "%32s",
          digest);
}


x86 assembly (clang, -O0):
<chirp_ticket_subject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <chirp_ticket_isticketfilename@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_ticket_subject>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1040 <chirp_ticket_isticketfilename@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    0x8(%rsp),%rdx
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <sprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"ticket:%32s\00"
define void @chirp_ticket_subject(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @chirp_ticket_isticketfilename(i8* %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %3
%12 = load i8*, i8** %5
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"ticket:%32s\00"
define void @chirp_ticket_subject(i8* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @chirp_ticket_isticketfilename(i8* %1, i8** %3)
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}
float fdiv(float a, float b) { return a / b; }


x86 assembly (clang, -O0):
<fdiv>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdiv>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fdiv(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @fdiv(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
int digitstring(s)
char *s;
{
  while (*s >= '0' && *s <= '9')
    s++;
  return ((*s == '\0') ? 1 : 0);
}


x86 assembly (clang, -O0):
<digitstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     112d <digitstring+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <digitstring+0x3d>
jmp    114e <digitstring+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <digitstring+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitstring>:
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%eax
add    $0x1,%rdi
cmp    $0xa,%al
jb     1100 <digitstring>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @digitstring(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = icmp eq i8 %4, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __uint16_t;

/* Variables and functions */
__uint16_t checksum16(char *input) {
  unsigned int sum;
  sum = 0;
  while (*input != '\0') {
    sum += *input;
    sum %= (unsigned int)0xFFFF;
    input++;
  }
  return (__uint16_t)sum;
}


x86 assembly (clang, -O0):
<checksum16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <checksum16+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xffff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <checksum16+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checksum16>:
mov    (%rdi),%dl
test   %dl,%dl
je     1145 <checksum16+0x45>
add    $0x1,%rdi
xor    %eax,%eax
mov    $0x80008001,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %dl,%edx
add    %eax,%edx
mov    %rdx,%rax
imul   %rcx,%rax
shr    $0x2f,%rax
mov    %eax,%esi
shl    $0x10,%esi
sub    %esi,%eax
add    %edx,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1120 <checksum16+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @checksum16(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 %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = add i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = urem i32 %15, 65535
store i32 %16, i32* %3
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @checksum16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %6, %8
%10 = urem i32 %9, 65535
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void pollen_interfaces_Gpio_clear__E() {}


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

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

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

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