xunge/DecIR huggingface dataset:
void ssp_dump_task(struct work_struct *work) {
  pr_err("[SSP]: %s done\n", __func__);
}


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

x86 assembly (clang, -O2):
<ssp_dump_task>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
jmp    1030 <pr_err@plt>

LLVM IR (-O0):
%struct.work_struct = type opaque
@.str = [16 x i8] c"[SSP]: %s done\0A\00"
@__func__.ssp_dump_task = [14 x i8] c"ssp_dump_task\00"
define void @ssp_dump_task(%struct.work_struct* %0) {
%2 = alloca %struct.work_struct*
store %struct.work_struct* %0, %struct.work_struct** %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.ssp_dump_task, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.work_struct = type opaque
@.str = [16 x i8] c"[SSP]: %s done\0A\00"
@__func__.ssp_dump_task = [14 x i8] c"ssp_dump_task\00"
define void @ssp_dump_task(%struct.work_struct* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.ssp_dump_task, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_linux_file_name(char *);
int /*<<< orphan*/ tcp_westwood_register();
void module_register(void) {
  tcp_westwood_register();
  set_linux_file_name("tcp_westwood.c");
}


x86 assembly (clang, -O0):
<module_register>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <tcp_westwood_register@plt>
lea    0xece(%rip),%rdi
call   1030 <set_linux_file_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_register>:
push   %rax
xor    %eax,%eax
call   1040 <tcp_westwood_register@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <set_linux_file_name@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"tcp_westwood.c\00"
define void @module_register() {
%1 = call i32 (...) @tcp_westwood_register()
%2 = call i32 @set_linux_file_name(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"tcp_westwood.c\00"
define void @module_register() {
%1 = tail call i32 (...) @tcp_westwood_register()
%2 = tail call i32 @set_linux_file_name(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void tv8532_setquality(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @tv8532_setquality(%struct.usb_spca50x* nocapture %0) {
ret void
}
unsigned char rotateR_fun_uchar(unsigned char x, int i) {
  if ((i %= 8) == 0)
    return x;
  return (x << (8 - i)) | (x >> i);
}


x86 assembly (clang, -O0):
<rotateR_fun_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmp    $0x0,%edx
jne    112f <rotateR_fun_uchar+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    114d <rotateR_fun_uchar+0x4d>
movzbl -0x2(%rbp),%eax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_uchar>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xfffffff8,%eax
sub    %eax,%ecx
mov    %edi,%eax
ror    %cl,%al
test   %ecx,%ecx
movzbl %al,%eax
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @rotateR_fun_uchar(i8 zeroext %0, i32 %1) {
%3 = srem i32 %1, 8
%4 = icmp eq i32 %3, 0
%5 = trunc i32 %3 to i8
%6 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %5)
%7 = select i1 %4, i8 %0, i8 %6
ret i8 %7
}
/* Variables and functions */
char *alloca(int);
int /*<<< orphan*/ memset(char *, char, int);
size_t strlen(char *);
int test15(void) {
  char *p = alloca(100 - 1);
  size_t ret;
  memset(p, 'a', 100);
  p[100 - 1] = 0;
  ret = strlen(p);
  ;
  return ret;
}


x86 assembly (clang, -O0):
<test15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x63,%edi
call   1050 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x61,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,0x63(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test15>:
push   %rbx
mov    $0x63,%edi
call   1050 <alloca@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x61,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x0,0x63(%rbx)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @test15() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i8* @alloca(i32 99)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @memset(i8* %4, i8 signext 97, i32 100)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 99
store i8 0, i8* %7
%8 = load i8*, i8** %1
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test15() {
%1 = tail call i8* @alloca(i32 99)
%2 = tail call i32 @memset(i8* %1, i8 signext 97, i32 100)
%3 = getelementptr inbounds i8, i8* %1, i64 99
store i8 0, i8* %3
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
void *mf__mem_end(void *);
void *mem_end(void *ptr) {
  void *r_ptr = NULL;
  ;
  r_ptr = mf__mem_end(ptr);
  ;
  return (r_ptr);
}


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

x86 assembly (clang, -O2):
<mem_end>:
jmp    1030 <mf__mem_end@plt>

LLVM IR (-O0):
define i8* @mem_end(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = call i8* @mf__mem_end(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @mem_end(i8* %0) {
%2 = tail call i8* @mf__mem_end(i8* %0)
ret i8* %2
}
int dd_eq(const double *a, const double *b) {
  return ((a[0] == b[0]) && (a[1] == b[1])) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
jne    114a <dd_eq+0x4a>
jp     114a <dd_eq+0x4a>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd 0x8(%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_eq>:
movsd  (%rdi),%xmm0
ucomisd (%rsi),%xmm0
jne    1120 <dd_eq+0x20>
jp     1120 <dd_eq+0x20>
movsd  0x8(%rsi),%xmm0
cmpeqsd 0x8(%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dd_eq(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oeq double %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fcmp oeq double %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
__attribute__((weak)) void _exit(int rc) {
  rc = rc;
  while (1) {
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110d <_exit+0xd>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define weak void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
define weak void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
float fast_powf(float a, float b) {
  union {
    float d;
    int x;
  } u = {a};
  u.x = (int)((b * (u.x - 1064866805)) + 1064866805);
  return u.d;
}


x86 assembly (clang, -O0):
<fast_powf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%eax
sub    $0x3f7893f5,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  0xecb(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_powf>:
movd   %xmm0,%eax
add    $0xc0876c0b,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  %xmm1,%xmm0
addss  0xee4(%rip),%xmm0
cvttss2si %xmm0,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @fast_powf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca %union.anon
store float %0, float* %3
store float %1, float* %4
%6 = bitcast %union.anon* %5 to float*
%7 = load float, float* %3
store float %7, float* %6
%8 = load float, float* %4
%9 = bitcast %union.anon* %5 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1064866805
%12 = sitofp i32 %11 to float
%13 = call float @llvm.fmuladd.f32(float %8, float %12, float 0x41CFBC4A00000000)
%14 = fptosi float %13 to i32
%15 = bitcast %union.anon* %5 to i32*
store i32 %14, i32* %15
%16 = bitcast %union.anon* %5 to float*
%17 = load float, float* %16
ret float %17
}

LLVM IR (-O2):
define float @fast_powf(float %0, float %1) {
%3 = bitcast float %0 to i32
%4 = add nsw i32 %3, -1064866805
%5 = sitofp i32 %4 to float
%6 = tail call float @llvm.fmuladd.f32(float %1, float %5, float 0x41CFBC4A00000000)
%7 = fptosi float %6 to i32
%8 = bitcast i32 %7 to float
ret float %8
}
double mod2pi(double f) {
  while (f < 0.) {
    f += 2. * 3.14159265358979323846;
  }
  while (f > 2. * 3.14159265358979323846) {
    f -= 2. * 3.14159265358979323846;
  }
  return f;
}


x86 assembly (clang, -O0):
<mod2pi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112e <mod2pi+0x2e>
movsd  0xee1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1109 <mod2pi+0x9>
jmp    1133 <mod2pi+0x33>
movsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <mod2pi+0x65>
movsd  -0x8(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1133 <mod2pi+0x33>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2pi>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    112a <mod2pi+0x2a>
movsd  0xeee(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1120 <mod2pi+0x20>
ucomisd 0xece(%rip),%xmm0
jbe    115a <mod2pi+0x5a>
movsd  0xecc(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
ja     1150 <mod2pi+0x50>
ret

LLVM IR (-O0):
define double @mod2pi(double %0) {
%2 = alloca double
store double %0, double* %2
br label %3
3: ; preds = %6, %1
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* %2
%8 = fadd double %7, 0x401921FB54442D18
store double %8, double* %2
br label %3
9: ; preds = %3
br label %10
10: ; preds = %13, %9
%11 = load double, double* %2
%12 = fcmp ogt double %11, 0x401921FB54442D18
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %2
%15 = fsub double %14, 0x401921FB54442D18
store double %15, double* %2
br label %10
16: ; preds = %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @mod2pi(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi double [ %0, %1 ], [ %8, %6 ]
%5 = fcmp ogt double %4, 0x401921FB54442D18
br i1 %5, label %10, label %14
6: ; preds = %1, %6
%7 = phi double [ %8, %6 ], [ %0, %1 ]
%8 = fadd double %7, 0x401921FB54442D18
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %6, label %3
10: ; preds = %3, %10
%11 = phi double [ %12, %10 ], [ %4, %3 ]
%12 = fadd double %11, 0xC01921FB54442D18
%13 = fcmp ogt double %12, 0x401921FB54442D18
br i1 %13, label %10, label %14
14: ; preds = %10, %3
%15 = phi double [ %4, %3 ], [ %12, %10 ]
ret double %15
}
void GPMCECCEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x1F4)))) |= ((0x00000001u));
}


x86 assembly (clang, -O0):
<GPMCECCEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCECCEnable>:
add    $0x1f4,%edi
orl    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCECCEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 500
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @GPMCECCEnable(i32 %0) {
%2 = add i32 %0, 500
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
ret void
}
int highestfd(fd)
int fd;
{
  register int newfd, higherfd;
  newfd = dup(fd);
  if (newfd < 0) {
    return fd;
  }
  if (newfd > 99) {
    close(newfd);
    return fd;
  }
  higherfd = highestfd(newfd);
  close(fd);
  return higherfd;
}


x86 assembly (clang, -O0):
<highestfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <dup@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115d <highestfd+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1197 <highestfd+0x67>
cmpl   $0x63,-0xc(%rbp)
jle    117c <highestfd+0x4c>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <close@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1197 <highestfd+0x67>
mov    -0xc(%rbp),%edi
call   1030 <highestfd@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <close@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<highestfd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <dup@plt>
test   %eax,%eax
js     1159 <highestfd+0x29>
cmp    $0x64,%eax
jae    1150 <highestfd+0x20>
mov    %eax,%edi
call   1030 <highestfd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
mov    %ecx,%ebx
mov    %eax,%edi
xor    %eax,%eax
call   1050 <close@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @highestfd(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @dup to i32 (i32, ...)*)(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = icmp ugt i32 %2, 99
br i1 %5, label %6, label %12
6: ; preds = %4, %12
%7 = phi i32 [ %0, %12 ], [ %2, %4 ]
%8 = phi i32 [ %13, %12 ], [ %0, %4 ]
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %7)
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ %0, %1 ], [ %8, %6 ]
ret i32 %11
12: ; preds = %4
%13 = tail call i32 @highestfd(i32 %2)
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ z;

/* Variables and functions */
int /*<<< orphan*/ memset(long double *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printfp(char *, long double *);
int main(void) {
  long double x = 3.141592653589793238462643383279502884L;
  long double y = 2.718281828459045235360287471352662498L;
  long double z;
  memset(&z, 0, sizeof(z));
  z = x + y;
  printfp("result", &z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
fldt   0xecb(%rip)
fstpt  -0x20(%rbp)
fldt   0xed2(%rip)
fstpt  -0x30(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <printfp@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
fldt   0xec3(%rip)
fstpt  (%rsp)
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printfp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"result\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store i32 0, i32* %1
store x86_fp80 0xK4000C90FDAA22168C235, x86_fp80* %2
store x86_fp80 0xK4000ADF85458A2BB4A9B, x86_fp80* %3
%5 = call i32 @memset(x86_fp80* %4, i32 0, i32 16)
%6 = load x86_fp80, x86_fp80* %2
%7 = load x86_fp80, x86_fp80* %3
%8 = fadd x86_fp80 %6, %7
store x86_fp80 %8, x86_fp80* %4
%9 = call i32 @printfp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), x86_fp80* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"result\00"
define i32 @main() {
%1 = alloca x86_fp80
%2 = bitcast x86_fp80* %1 to i8*
%3 = call i32 @memset(x86_fp80* %1, i32 0, i32 16)
store x86_fp80 0xK4001BB84177D62120668, x86_fp80* %1
%4 = call i32 @printfp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), x86_fp80* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluOrtho2D(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void reshape(int width, int height) {
  glViewport(0, 0, width, height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0, width, 0, height);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
mov    %edx,%edi
call   1050 <gluOrtho2D@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
xor    %edi,%edi
mov    %ebp,%esi
xor    %edx,%edx
mov    %ebx,%ecx
call   1050 <gluOrtho2D@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(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 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @gluOrtho2D(i32 0, i32 %11, i32 0, i32 %12)
%14 = load i32, i32* @GL_MODELVIEW
%15 = call i32 @glMatrixMode(i32 %14)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @gluOrtho2D(i32 0, i32 %0, i32 0, i32 %1)
%8 = load i32, i32* @GL_MODELVIEW
%9 = tail call i32 @glMatrixMode(i32 %8)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("%d\n", getpid());
  sleep(3);
  return 44;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    $0x2c,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    $0x2c,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sleep(i32 3)
ret i32 44
}
/* Variables and functions */
int fcntl(int, int, int);
int my_fcntl(int fd, int cmd, int value) { return fcntl(fd, cmd, value); }


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

x86 assembly (clang, -O2):
<my_fcntl>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @my_fcntl(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int is_strike_char(char c) { return (c == '-'); }


x86 assembly (clang, -O0):
<is_strike_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_strike_char>:
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_strike_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 45
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_strike_char(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = zext i1 %2 to i32
ret i32 %3
}
void isr_bus_fault(void) {
  puts("##### BUS FAULT #####");
  while (1) {
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<isr_bus_fault>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
nop
jmp    1122 <isr_bus_fault+0x12>

x86 assembly (clang, -O2):
<isr_bus_fault>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
nop
nop
jmp    1120 <isr_bus_fault+0x10>

LLVM IR (-O0):
@.str = [22 x i8] c"##### BUS FAULT #####\00"
define void @isr_bus_fault() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [22 x i8] c"##### BUS FAULT #####\00"
define void @isr_bus_fault() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ sla_galeq_(double *, double *, double *, double *);
void slaGaleq(double dl, double db, double *dr, double *dd) {
  double DL;
  double DB;
  double DR;
  double DD;
  DL = dl;
  DB = db;
  sla_galeq_(&DL, &DB, &DR, &DD);
  *dr = DR;
  *dd = DD;
}


x86 assembly (clang, -O0):
<slaGaleq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1030 <sla_galeq_@plt>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaGaleq>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <sla_galeq_@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @slaGaleq(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%13 = load double, double* %5
store double %13, double* %9
%14 = load double, double* %6
store double %14, double* %10
%15 = call i32 @sla_galeq_(double* %9, double* %10, double* %11, double* %12)
%16 = load double, double* %11
%17 = load double*, double** %7
store double %16, double* %17
%18 = load double, double* %12
%19 = load double*, double** %8
store double %18, double* %19
ret void
}

LLVM IR (-O2):
define void @slaGaleq(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
store double %0, double* %5
store double %1, double* %6
%13 = call i32 @sla_galeq_(double* %5, double* %6, double* %7, double* %8)
%14 = load double, double* %7
store double %14, double* %2
%15 = load double, double* %8
store double %15, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comportement_philosophe(int /*<<< orphan*/);
int /*<<< orphan*/ fin_tache();
void tache_philosophe0(void) {
  comportement_philosophe(0);
  fin_tache();
}


x86 assembly (clang, -O0):
<tache_philosophe0>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <comportement_philosophe@plt>
mov    $0x0,%al
call   1030 <fin_tache@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tache_philosophe0>:
push   %rax
xor    %edi,%edi
call   1040 <comportement_philosophe@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fin_tache@plt>

LLVM IR (-O0):
define void @tache_philosophe0() {
%1 = call i32 @comportement_philosophe(i32 0)
%2 = call i32 (...) @fin_tache()
ret void
}

LLVM IR (-O2):
define void @tache_philosophe0() {
%1 = tail call i32 @comportement_philosophe(i32 0)
%2 = tail call i32 (...) @fin_tache()
ret void
}
/* Type definitions */
typedef int u_int64_t;
typedef int u_int32_t;

/* Variables and functions */
int htonl(int);
u_int64_t htonll_(u_int64_t val) {
  if (htonl(1) == 1) {
    return val;
  }
  u_int32_t a = *((u_int32_t *)&val);
  u_int32_t b = *(((u_int32_t *)&val) + 1);
  val = htonl(a);
  val = val << 32 | htonl(b);
  return val;
}


x86 assembly (clang, -O0):
<htonll_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <htonl@plt>
cmp    $0x1,%eax
jne    1139 <htonll_+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <htonll_+0x65>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll_>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <htonl@plt>
cmp    $0x1,%eax
je     112e <htonll_+0x1e>
mov    %ebx,%edi
call   1030 <htonl@plt>
call   1030 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @htonll_(i32 returned %0) {
%2 = tail call i32 @htonl(i32 1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @htonl(i32 %0)
%6 = tail call i32 @htonl(i32 poison)
br label %7
7: ; preds = %1, %4
ret i32 %0
}
/* Variables and functions */
int strlen(char *);
int do_test(void) {
  {
    if (strlen("hello") != 5)
      return 1;
  };
  {
    if (strlen("") != 0)
      return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
je     1139 <do_test+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1161 <do_test+0x51>
lea    0xec5(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
je     115a <do_test+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <do_test+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x5,%ecx
jne    113e <do_test+0x2e>
lea    0xed5(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @do_test() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
int check_data(void *vdata, void *vref) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_data(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void default_fst_error_callback(const char *desc) {
  fprintf(stderr, "%s\n", desc);
}


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

x86 assembly (clang, -O2):
<default_fst_error_callback>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @default_fst_error_callback(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void f(int *var, int cnst) {
  int i = 0;
  double x = 1;
  for (i = 0; i < 10000; ++i) {
    x = x * 2.0;
  }
  assert(*var == cnst);
  (*var) = (*var) + 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2710,-0x10(%rbp)
jge    1167 <f+0x57>
movsd  0xeb9(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <f+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    %esi,(%rbx)
sete   %dil
call   1030 <assert@plt>
addl   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @f(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store double 1.000000e+00, double* %6
store i32 0, i32* %5
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 10000
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load double, double* %6
%12 = fmul double %11, 2.000000e+00
store double %12, double* %6
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %7
16: ; preds = %7
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i32*, i32** %3
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
%26 = load i32*, i32** %3
store i32 %25, i32* %26
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* %0
%8 = add nsw i32 %7, 1
store i32 %8, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int radius = 5000;
  int diameter = 2 * radius;
  srand(time(NULL));
  int i = rand();
  printf("%d\n", i % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1388,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rsi
imul   $0x51eb851f,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5000, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 2, %5
store i32 %6, i32* %3
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
%9 = call i32 (...) @rand()
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = srem i32 %10, 100
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 100
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
f1(float x, float y) {
  if (x != 0 || y != 0)
    abort();
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1155 <f1+0x45>
jp     1155 <f1+0x45>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1155 <f1+0x45>
jp     1155 <f1+0x45>
jmp    115c <f1+0x4c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    1122 <f1+0x12>
jp     1122 <f1+0x12>
ucomiss %xmm2,%xmm1
jne    1122 <f1+0x12>
jp     1122 <f1+0x12>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @f1(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp une float %6, 0.000000e+00
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load float, float* %5
%10 = fcmp une float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @f1(float %0, float %1) {
%3 = fcmp une float %0, 0.000000e+00
%4 = fcmp une float %1, 0.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int eat(int ID) {
  printf("Philosoper [%d] is eating... \n", ID);
  return 0;
}


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

x86 assembly (clang, -O2):
<eat>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Philosoper [%d] is eating... \0A\00"
define i32 @eat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Philosoper [%d] is eating... \0A\00"
define i32 @eat(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
int vfree(void *ptr) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @vfree(i8* nocapture readnone %0) {
ret i32 -1
}
int gensdf_dfcn2(int x0, int y0, int x1, int y1) {
  int dy, dx, dx1, dy1, d0, d1, d;
  dx = x1 - x0;
  dy = y1 - y0;
  dx1 = dx >> 2;
  d0 = dx * dx + dy * dy;
  d1 = dx1 * dx1 + dy * dy;
  d = 2 * d0 - d1;
  return (d);
}


x86 assembly (clang, -O0):
<gensdf_dfcn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
sub    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gensdf_dfcn2>:
sub    %edi,%edx
sub    %esi,%ecx
mov    %edx,%esi
sar    $0x2,%esi
imul   %edx,%edx
imul   %ecx,%ecx
lea    (%rdx,%rcx,1),%eax
imul   %esi,%esi
add    %eax,%eax
add    %ecx,%esi
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gensdf_dfcn2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %10
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %9
%22 = load i32, i32* %10
%23 = ashr i32 %22, 2
store i32 %23, i32* %11
%24 = load i32, i32* %10
%25 = load i32, i32* %10
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %9
%28 = load i32, i32* %9
%29 = mul nsw i32 %27, %28
%30 = add nsw i32 %26, %29
store i32 %30, i32* %13
%31 = load i32, i32* %11
%32 = load i32, i32* %11
%33 = mul nsw i32 %31, %32
%34 = load i32, i32* %9
%35 = load i32, i32* %9
%36 = mul nsw i32 %34, %35
%37 = add nsw i32 %33, %36
store i32 %37, i32* %14
%38 = load i32, i32* %13
%39 = mul nsw i32 2, %38
%40 = load i32, i32* %14
%41 = sub nsw i32 %39, %40
store i32 %41, i32* %15
%42 = load i32, i32* %15
ret i32 %42
}

LLVM IR (-O2):
define i32 @gensdf_dfcn2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %0
%6 = sub nsw i32 %3, %1
%7 = ashr i32 %5, 2
%8 = mul nsw i32 %5, %5
%9 = mul nsw i32 %6, %6
%10 = add nuw nsw i32 %9, %8
%11 = mul nsw i32 %7, %7
%12 = shl nuw nsw i32 %10, 1
%13 = add nuw i32 %11, %9
%14 = sub i32 %12, %13
ret i32 %14
}
__attribute((always_)) _Bool f(float f) { return f; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm1,%xmm1
cmpneqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define zeroext i1 @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp une float %3, 0.000000e+00
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @f(float %0) {
%2 = fcmp une float %0, 0.000000e+00
ret i1 %2
}
/* Variables and functions */
scalar_t__ get_current_paper_index();
int /*<<< orphan*/ set_current_paper_index(scalar_t__);
void update_current_paper_index(void) {
  set_current_paper_index(get_current_paper_index() + 1);
}


x86 assembly (clang, -O0):
<update_current_paper_index>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_current_paper_index@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <set_current_paper_index@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_current_paper_index>:
push   %rax
xor    %eax,%eax
call   1040 <get_current_paper_index@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1030 <set_current_paper_index@plt>

LLVM IR (-O0):
define void @update_current_paper_index() {
%1 = call i64 (...) @get_current_paper_index()
%2 = add nsw i64 %1, 1
%3 = call i32 @set_current_paper_index(i64 %2)
ret void
}

LLVM IR (-O2):
define void @update_current_paper_index() {
%1 = tail call i64 (...) @get_current_paper_index()
%2 = add nsw i64 %1, 1
%3 = tail call i32 @set_current_paper_index(i64 %2)
ret void
}