xunge/DecIR huggingface dataset:
unsigned f1(x) { return ((unsigned)(x != 0) - 3) / 2; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
sub    $0x3,%eax
shr    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cmp    $0x1,%edi
mov    $0x7fffffff,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = sub i32 %5, 3
%7 = udiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 2147483646, i32 2147483647
ret i32 %3
}
extern void writeb(unsigned short b, unsigned long addr) {
  *(volatile unsigned int *)((addr << 5) +
                             ((0xfffffc0000000000UL) + 0x200000000UL) + 0x00) =
      b * 0x01010101;
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
imul   $0x1010101,%eax,%ecx
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
movabs $0xfffffc0200000000,%rdx
fc ff ff
add    %rdx,%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
imul   $0x1010101,%edi,%eax
shl    $0x5,%rsi
movabs $0xfffffc0200000000,%rcx
fc ff ff
mov    %eax,(%rsi,%rcx,1)
ret

LLVM IR (-O0):
define void @writeb(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = mul nsw i32 %6, 16843009
%8 = load i64, i64* %4
%9 = shl i64 %8, 5
%10 = add i64 %9, -4389456576512
%11 = add i64 %10, 0
%12 = inttoptr i64 %11 to i32*
store volatile i32 %7, i32* %12
ret void
}

LLVM IR (-O2):
define void @writeb(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = mul nsw i32 %3, 16843009
%5 = shl i64 %1, 5
%6 = add i64 %5, -4389456576512
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
ret void
}
int do_261() { return 261; }


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

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

LLVM IR (-O0):
define i32 @do_261() {
ret i32 261
}

LLVM IR (-O2):
define i32 @do_261() {
ret i32 261
}
void X509_NAME_print_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_print_ex() {
ret void
}
int Reals_Expo(float x) {
  int _o_result;
  _o_result = (int)((((long long)((long long)(((int)(x)))) >> (23))) & ~(-256));
  return _o_result;
}


x86 assembly (clang, -O0):
<Reals_Expo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
cltq
sar    $0x17,%rax
and    $0xff,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reals_Expo>:
cvttss2si %xmm0,%eax
shr    $0x17,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @Reals_Expo(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
%6 = sext i32 %5 to i64
%7 = ashr i64 %6, 23
%8 = and i64 %7, 255
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @Reals_Expo(float %0) {
%2 = fptosi float %0 to i32
%3 = lshr i32 %2, 23
%4 = and i32 %3, 255
ret i32 %4
}
int g_DUMMY_scrollbar_get_maxworld(int win_id, int vp_id, float *wx1,
                                   float *wy1, float *wx2, float *wy2) {
  win_id = win_id;
  vp_id = vp_id;
  wx1 = wx1;
  wy1 = wy1;
  wx2 = wx2;
  wy2 = wy2;
  return 0;
}


x86 assembly (clang, -O0):
<g_DUMMY_scrollbar_get_maxworld>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g_DUMMY_scrollbar_get_maxworld(i32 %0, i32 %1, float* %2, float* %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
store i32 %0, i32* %7
store i32 %1, i32* %8
store float* %2, float** %9
store float* %3, float** %10
store float* %4, float** %11
store float* %5, float** %12
%13 = load i32, i32* %7
store i32 %13, i32* %7
%14 = load i32, i32* %8
store i32 %14, i32* %8
%15 = load float*, float** %9
store float* %15, float** %9
%16 = load float*, float** %10
store float* %16, float** %10
%17 = load float*, float** %11
store float* %17, float** %11
%18 = load float*, float** %12
store float* %18, float** %12
ret i32 0
}

LLVM IR (-O2):
define i32 @g_DUMMY_scrollbar_get_maxworld(i32 %0, i32 %1, float* nocapture readnone %2, float* nocapture readnone %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 0
}
int __ftrace_enabled_save(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ftrace_enabled_save() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cross3_c(float *, float *, float *);
void cross3_neon(float v0[3], float v1[3], float d[3]) { cross3_c(v0, v1, d); }


x86 assembly (clang, -O0):
<cross3_neon>:
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),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <cross3_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cross3_neon>:
jmp    1030 <cross3_c@plt>

LLVM IR (-O0):
define void @cross3_neon(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load float*, float** %6
%10 = call i32 @cross3_c(float* %7, float* %8, float* %9)
ret void
}

LLVM IR (-O2):
define void @cross3_neon(float* %0, float* %1, float* %2) {
%4 = tail call i32 @cross3_c(float* %0, float* %1, float* %2)
ret void
}
/* Variables and functions */
float fsqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vec3Dot(float const *, float const *);
float vec3Length(const float *_a) { return fsqrt(vec3Dot(_a, _a)); }


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

x86 assembly (clang, -O2):
<vec3Length>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec3Dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fsqrt@plt>

LLVM IR (-O0):
define float @vec3Length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @vec3Dot(float* %3, float* %4)
%6 = call float @fsqrt(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @vec3Length(float* %0) {
%2 = tail call i32 @vec3Dot(float* %0, float* %0)
%3 = tail call float @fsqrt(i32 %2)
ret float %3
}
int fltGq(const void *f1, const void *f2) {
  return (*((float *)f1) >= *((float *)f2));
  ;
}


x86 assembly (clang, -O0):
<fltGq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fltGq>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @fltGq(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 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp oge float %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @fltGq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp oge float %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
bool nrf52_errata_71(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_71() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ st7036_lcd_buffer(char *);
void lcd_text(char *s) { st7036_lcd_buffer(s); }


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

x86 assembly (clang, -O2):
<lcd_text>:
jmp    1030 <st7036_lcd_buffer@plt>

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

LLVM IR (-O2):
define void @lcd_text(i8* %0) {
%2 = tail call i32 @st7036_lcd_buffer(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ is_transmit_empty();
int /*<<< orphan*/ outb(int, char);
void write_serial(char a) {
  while (is_transmit_empty() == 0)
    ;
  outb(0x3f8, a);
}


x86 assembly (clang, -O0):
<write_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <is_transmit_empty@plt>
cmp    $0x0,%rax
jne    1144 <write_serial+0x24>
jmp    112e <write_serial+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <is_transmit_empty@plt>
test   %rax,%rax
je     1130 <write_serial+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @write_serial(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 (...) @is_transmit_empty()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outb(i32 1016, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @write_serial(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @is_transmit_empty()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outb(i32 1016, i8 signext %0)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double gettimeofday_sec() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + (double)tv.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<gettimeofday_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday_sec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @gettimeofday_sec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @gettimeofday_sec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
int prime(int n) {
  int i;
  if (n < 2)
    return 0;
  for (i = 2; i < n; i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1166 <prime+0x66>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <prime+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <prime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <prime+0x66>
jmp    1151 <prime+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <prime+0xa>
mov    %ecx,%eax
ret
jne    1112 <prime+0x12>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <prime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %12, label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int unlink(const char *pathname __attribute__((unused))) {
  printf("unlink\n");
  errno = ENOENT;
  return (-1);
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    0x2eb3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
@str = [7 x i8] c"unlink\00"
define i32 @unlink(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
unsigned int le16get(void *p, uint16_t *v) {
  uint8_t *a;
  a = p;
  *v = a[0];
  *v |= a[1] << 8;
  return 2;
}


x86 assembly (clang, -O0):
<le16get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x8,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16get>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    0x4(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,(%rsi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @le16get(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = or i32 %17, %15
store i32 %18, i32* %16
ret i32 2
}

LLVM IR (-O2):
define i32 @le16get(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
store i32 %4, i32* %1
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
store i32 %9, i32* %1
ret i32 2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x_root;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_x_root(void *_p, int _v) {
  ((XButtonPressedEvent *)_p)->x_root = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonPressedEvent_x_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_x_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonPressedEvent_x_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonPressedEvent_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ok(int, char *);
int /*<<< orphan*/ printf(char *, int, int);
void is(int actual, int expected, char *message) {
  int passed;
  passed = (actual == expected);
  ok(passed, message);
  if (!passed) {
    printf("# Got %d\n# Expected %d\n", actual, expected);
  }
}


x86 assembly (clang, -O0):
<is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ok@plt>
cmpl   $0x0,-0x14(%rbp)
jne    116b <is+0x4b>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    %esi,%ebp
sete   %dil
mov    %rdx,%rsi
call   1030 <ok@plt>
cmp    %ebx,%ebp
jne    1142 <is+0x22>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb7(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"# Got %d\0A# Expected %d\0A\00"
define void @is(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8*, i8** %6
%14 = call i32 @ok(i32 %12, i8* %13)
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %3
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %17, %3
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"# Got %d\0A# Expected %d\0A\00"
define void @is(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @ok(i32 %5, i8* %2)
br i1 %4, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ am2315_read_data(void *, float *, float *);
float am2315_temperature(void *_am) {
  float temperature, humidity;
  am2315_read_data(_am, &temperature, &humidity);
  return temperature;
}


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

x86 assembly (clang, -O2):
<am2315_temperature>:
push   %rax
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1030 <am2315_read_data@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @am2315_temperature(i8* %0) {
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @am2315_read_data(i8* %0, float* %2, float* %3)
%7 = load float, float* %2
ret float %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ nrf_802154_rssi_sample_temp_corr_value_get();
uint8_t nrf_802154_rssi_lqi_corrected_get(uint8_t lqi) {
  return lqi - nrf_802154_rssi_sample_temp_corr_value_get();
}


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

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

LLVM IR (-O0):
define i64 @nrf_802154_rssi_lqi_corrected_get(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @nrf_802154_rssi_sample_temp_corr_value_get()
%5 = sub nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @nrf_802154_rssi_lqi_corrected_get(i64 %0) {
%2 = tail call i64 (...) @nrf_802154_rssi_sample_temp_corr_value_get()
%3 = sub nsw i64 %0, %2
ret i64 %3
}
/* Variables and functions */
int ENOSYS;
int sysfs_modify_policy_min(unsigned int cpu, unsigned long min_freq) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<sysfs_modify_policy_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ed4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_modify_policy_min>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sysfs_modify_policy_min(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sysfs_modify_policy_min(i32 %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
void unsigned_prune_ge3_Good(unsigned int x, unsigned int y) {
  if (y > 0) {
    if (x >= y + 1) {
      unsigned int z = x - 1;
    }
  }
}


x86 assembly (clang, -O0):
<unsigned_prune_ge3_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1133 <unsigned_prune_ge3_Good+0x33>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jb     112e <unsigned_prune_ge3_Good+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <unsigned_prune_ge3_Good+0x33>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @unsigned_prune_ge3_Good(i32 %0, i32 %1) {
ret void
}
int ls_costN_nm10_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_costN_nm10_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_costN_nm10_n_out() {
ret i32 2
}
void gtk_scrolled_window_add_with_viewport() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
void write_to_parent(int fd, const void *buf, size_t count) {
  ssize_t written;
  written = write(fd, buf, count);
}


x86 assembly (clang, -O0):
<write_to_parent>:
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 <write@plt>
mov    %eax,-0x1c(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_parent>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_to_parent(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret void
}
void foo693() {}


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

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

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

LLVM IR (-O2):
define void @foo693() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int getticks() {
  static struct timeval ticks = {0};
  static unsigned int val = 0;
  gettimeofday(&ticks, NULL);
  val = ticks.tv_sec * 1000;
  val += ticks.tv_usec / 1000;
  return val;
}


x86 assembly (clang, -O0):
<getticks>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f11(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x2efe(%rip),%eax
mov    %eax,0x2f04(%rip)
mov    0x2ef6(%rip),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    0x2ef0(%rip),%eax
mov    %eax,0x2eea(%rip)
mov    0x2ee4(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getticks>:
push   %rax
lea    0x2f14(%rip),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x2f03(%rip),%ecx
movslq 0x2f00(%rip),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32, i32 }
@getticks.ticks = internal global %struct.timeval zeroinitializer
@getticks.val = internal global i32 0
define i32 @getticks() {
%1 = call i32 @gettimeofday(%struct.timeval* @getticks.ticks, i32* null)
%2 = load i32, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @getticks.ticks, i32 0, i32 0)
%3 = mul nsw i32 %2, 1000
store i32 %3, i32* @getticks.val
%4 = load i32, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @getticks.ticks, i32 0, i32 1)
%5 = sdiv i32 %4, 1000
%6 = load i32, i32* @getticks.val
%7 = add i32 %6, %5
store i32 %7, i32* @getticks.val
%8 = load i32, i32* @getticks.val
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32, i32 }
@getticks.ticks = internal global %struct.timeval zeroinitializer
define i32 @getticks() {
%1 = tail call i32 @gettimeofday(%struct.timeval* @getticks.ticks, i32* null)
%2 = load i32, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @getticks.ticks, i64 0, i32 0)
%3 = mul nsw i32 %2, 1000
%4 = load i32, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @getticks.ticks, i64 0, i32 1)
%5 = sdiv i32 %4, 1000
%6 = add i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ adrfindtmp(int /*<<< orphan*/);
void adr() { adrfindtmp(0); }


x86 assembly (clang, -O0):
<adr>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <adrfindtmp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr>:
xor    %edi,%edi
jmp    1030 <adrfindtmp@plt>

LLVM IR (-O0):
define void @adr() {
%1 = call i32 @adrfindtmp(i32 0)
ret void
}

LLVM IR (-O2):
define void @adr() {
%1 = tail call i32 @adrfindtmp(i32 0)
ret void
}
/* Variables and functions */
double sqrt(double);
double lmd_p(double h) { return sqrt(h * h + 1.) - h; }


x86 assembly (clang, -O0):
<lmd_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
subsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmd_p>:
push   %rax
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm0
addsd  0xedf(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1131 <lmd_p+0x21>
sqrtsd %xmm0,%xmm0
jmp    1140 <lmd_p+0x30>
movsd  %xmm2,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm2
subsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @lmd_p(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = call double @sqrt(double %5)
%7 = load double, double* %2
%8 = fsub double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @lmd_p(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = tail call double @sqrt(double %2)
%4 = fsub double %3, %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ addToDate(int /*<<< orphan*/, char, int);
time_t addToDateD(time_t ts) { return addToDate(ts, 'd', 1); }


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

x86 assembly (clang, -O2):
<addToDateD>:
mov    $0x64,%esi
mov    $0x1,%edx
jmp    1030 <addToDate@plt>

LLVM IR (-O0):
define i32 @addToDateD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @addToDate(i32 %3, i8 signext 100, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @addToDateD(i32 %0) {
%2 = tail call i32 @addToDate(i32 %0, i8 signext 100, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void load_mod1() { printf("load mod1\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"load mod1\0A\00"
define void @load_mod1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"load mod1\00"
define void @load_mod1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroyMMBitmapBuffer(char *bitmapBuffer, void *hint) {
  if (bitmapBuffer != NULL) {
    free(bitmapBuffer);
  }
}


x86 assembly (clang, -O0):
<destroyMMBitmapBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <destroyMMBitmapBuffer+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyMMBitmapBuffer>:
test   %rdi,%rdi
je     111a <destroyMMBitmapBuffer+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @destroyMMBitmapBuffer(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @destroyMMBitmapBuffer(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int my_strlen(char *str) {
  if (str == NULL) {
    return -1;
  }
  int counter = 0;
  while (str[counter] != '\0') {
    counter++;
  }
  return counter;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <my_strlen+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <my_strlen+0x4f>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <my_strlen+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <my_strlen+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111c <my_strlen+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ shmdt(void const *);
int Shmdt(const void *shmaddr) {
  if (0 > shmdt(shmaddr)) {
    return (-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<Shmdt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <shmdt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    113f <Shmdt+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <Shmdt+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shmdt>:
push   %rax
call   1030 <shmdt@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Shmdt(i8* %0) {
%2 = tail call i64 @shmdt(i8* %0)
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *mempcpy(void *dest, const void *src, size_t n) {
  void *tmp = memcpy((void *)dest, (const void *)src, (size_t)n);
  return tmp + n;
}


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

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

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

LLVM IR (-O2):
define i8* @mempcpy(i8* writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
%4 = getelementptr i8, i8* %0, i64 %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
void ft_putstr_fd(char const *s, int fd) {
  if (s)
    while (*s)
      write(fd, s++, 1);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <ft_putstr_fd+0x54>
jmp    112f <ft_putstr_fd+0x1f>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <ft_putstr_fd+0x4f>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    112f <ft_putstr_fd+0x1f>
jmp    1164 <ft_putstr_fd+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     114c <ft_putstr_fd+0x3c>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     114c <ft_putstr_fd+0x3c>
mov    %esi,%r14d
lea    0x1(%rbx),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x1,%ebx
cmpb   $0x0,0x0(%rbp)
lea    0x1(%rbp),%rbp
jne    1130 <ft_putstr_fd+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_putstr_fd(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %19
7: ; preds = %2
br label %8
8: ; preds = %12, %7
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = ptrtoint i8* %14 to i32
%17 = call i32 @write(i32 %13, i32 %16, i32 1)
br label %8
18: ; preds = %8
br label %19
19: ; preds = %18, %2
ret void
}

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %9, %7 ], [ %0, %4 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = ptrtoint i8* %8 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @write(i32 %1, i32 %11, i32 1)
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c(unsigned int);
int /*<<< orphan*/ proc1();
void b(unsigned int param1) {
  proc1();
  c(param1 - 1);
  return;
}


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

x86 assembly (clang, -O2):
<b>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <proc1@plt>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <c@plt>

LLVM IR (-O0):
define void @b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @proc1()
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = call i32 @c(i32 %5)
ret void
}

LLVM IR (-O2):
define void @b(i32 %0) {
%2 = tail call i32 (...) @proc1()
%3 = add i32 %0, -1
%4 = tail call i32 @c(i32 %3)
ret void
}
/* Variables and functions */
double exp(double);
double log(double);
double getPercDecayConst_spl(double ig, double tg, double spls) {
  return exp(log(tg / ig) / spls);
}


x86 assembly (clang, -O0):
<getPercDecayConst_spl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
divsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPercDecayConst_spl>:
push   %rax
movsd  %xmm2,(%rsp)
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <log@plt>
divsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @getPercDecayConst_spl(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @log(double %9)
%11 = load double, double* %6
%12 = fdiv double %10, %11
%13 = call double @exp(double %12)
ret double %13
}

LLVM IR (-O2):
define double @getPercDecayConst_spl(double %0, double %1, double %2) {
%4 = fdiv double %1, %0
%5 = tail call double @log(double %4)
%6 = fdiv double %5, %2
%7 = tail call double @exp(double %6)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ decode_u16le(int /*<<< orphan*/ **);
int16_t decode_s16le(uint8_t **cursor) { return (int16_t)decode_u16le(cursor); }


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

x86 assembly (clang, -O2):
<decode_s16le>:
jmp    1030 <decode_u16le@plt>

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

LLVM IR (-O2):
define i32 @decode_s16le(i32** %0) {
%2 = tail call i32 @decode_u16le(i32** %0)
ret i32 %2
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t __be_u32(void *p) {
  const unsigned char *c = (const unsigned char *)p;
  return (((uint32_t)c[0]) << 24U) | (((uint32_t)c[1]) << 16U) |
         (((uint32_t)c[2]) << 8U) | (((uint32_t)c[3]) << 0U);
}


x86 assembly (clang, -O0):
<__be_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__be_u32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @__be_u32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 24
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 0
%27 = or i32 %21, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @__be_u32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}