xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int i = 0;
  fork();
  printf("The value of i is:%d\n", ++i);
  fork();
  printf("The value of j is:%d\n", ++i);
  fork();
  sleep(15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0xf,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"The value of i is:%d\0A\00"
@.str.1 = [22 x i8] c"The value of j is:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @fork()
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @fork()
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @fork()
%12 = call i32 @sleep(i32 15)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"The value of i is:%d\0A\00"
@.str.1 = [22 x i8] c"The value of j is:%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 2)
%5 = tail call i32 (...) @fork()
%6 = tail call i32 @sleep(i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ufree(void *);
void _void_dtr(void *ptr) { ufree(ptr); }


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

x86 assembly (clang, -O2):
<_void_dtr>:
jmp    1030 <ufree@plt>

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

LLVM IR (-O2):
define void @_void_dtr(i8* %0) {
%2 = tail call i32 @ufree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 5, 8);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 8)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 8)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtss_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cvtss_sd(__m128d A, __m128 B) { return _mm_cvtss_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cvtss_sd>:
jmp    1030 <_mm_cvtss_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_cvtss_sd(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 @_mm_cvtss_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cvtss_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cvtss_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
scalar_t__ bb_is_running(int /*<<< orphan*/);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void bb_stop(pid_t proc) {
  if (bb_is_running(proc)) {
    kill(proc, SIGTERM);
  }
}


x86 assembly (clang, -O0):
<bb_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bb_is_running@plt>
cmp    $0x0,%rax
je     114e <bb_stop+0x2e>
mov    -0x4(%rbp),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_stop>:
push   %rbx
mov    %edi,%ebx
call   1030 <bb_is_running@plt>
test   %rax,%rax
je     113e <bb_stop+0x1e>
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <kill@plt>
pop    %rbx
ret

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @bb_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @bb_is_running(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @SIGTERM
%9 = call i32 @kill(i32 %7, i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @bb_stop(i32 %0) {
%2 = tail call i64 @bb_is_running(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @SIGTERM
%6 = tail call i32 @kill(i32 %0, i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
int real_bits(unsigned value) {
  int bits = 0;
  while (value > 0) {
    value >>= 1;
    ++bits;
  }
  return bits;
}


x86 assembly (clang, -O0):
<real_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    112f <real_bits+0x2f>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <real_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_bits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <real_bits+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <real_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @real_bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
float fabs(float);
uint8_t f32_nearly_equal(float a, float b, float margin) {
  return ((fabs((a - b)) < margin));
}


x86 assembly (clang, -O0):
<f32_nearly_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f32_nearly_equal>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @f32_nearly_equal(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 = fsub float %7, %8
%10 = call float @fabs(float %9)
%11 = load float, float* %6
%12 = fcmp olt float %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @f32_nearly_equal(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fcmp olt float %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
float n_clamp(float val, float lower, float upper) {
  if (val < lower)
    return lower;
  else if (val > upper)
    return upper;
  else
    return val;
}


x86 assembly (clang, -O0):
<n_clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <n_clamp+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <n_clamp+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <n_clamp+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <n_clamp+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_clamp>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @n_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @n_clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
void fd_ssd1315_write_image_end(void) {}


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

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

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

LLVM IR (-O2):
define void @fd_ssd1315_write_image_end() {
ret void
}
/* Variables and functions */
unsigned int umask(unsigned int);
unsigned int iposix_umask(unsigned int m) { return umask(m); }


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

x86 assembly (clang, -O2):
<iposix_umask>:
jmp    1030 <umask@plt>

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

LLVM IR (-O2):
define i32 @iposix_umask(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 %2
}
void I444Copy() {}


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

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

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

LLVM IR (-O2):
define void @I444Copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_utf8_filter() {
  printf("NOT IMPLEMENTED:"
         "pa_utf8_filter"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_utf8_filter\0A\00"
define i32 @pa_utf8_filter() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_utf8_filter\00"
define i32 @pa_utf8_filter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  for (;;) {
    write(1, "陈", 3);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xebe(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"\E9\99\88\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %6, %2
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = call i32 @sleep(i32 1)
br label %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"\E9\99\88\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @sleep(i32 1)
br label %3
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int ACCEPT(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
  return sockfd;
}


x86 assembly (clang, -O0):
<ACCEPT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @ACCEPT(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @ACCEPT(i32 returned %0, %struct.sockaddr* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 %0
}
/* Type definitions */
struct sio_stream_conn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sio_stream_close_conn(struct sio_stream_conn *);
void sio_stream_handle_close(struct sio_stream_conn *conn) {
  sio_stream_close_conn(conn);
}


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

x86 assembly (clang, -O2):
<sio_stream_handle_close>:
jmp    1030 <sio_stream_close_conn@plt>

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

LLVM IR (-O2):
%struct.sio_stream_conn = type { i32 }
define void @sio_stream_handle_close(%struct.sio_stream_conn* %0) {
%2 = tail call i32 @sio_stream_close_conn(%struct.sio_stream_conn* %0)
ret void
}
/* Variables and functions */
int mstrindex(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char line[] = "abcdedfabcde";
  char pattern[] = "abc";
  int found;
  found = mstrindex(line, pattern);
  printf("Found the right index: %d\n", found);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x11(%rbp)
lea    -0xd(%rbp),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <mstrindex@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x65646362616664,%rax
mov    %rax,0xd(%rsp)
movabs $0x6166646564636261,%rax
64 66 61
mov    %rax,0x8(%rsp)
movl   $0x636261,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1040 <mstrindex@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.line = [13 x i8] c"abcdedfabcde\00"
@__const.main.pattern = [4 x i8] c"abc\00"
@.str = [27 x i8] c"Found the right index: %d\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca [4 x i8]
%3 = alloca i32
%4 = bitcast [13 x i8]* %1 to i8*
%5 = bitcast [4 x i8]* %2 to i8*
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = call i32 @mstrindex(i8* %6, i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.line = [13 x i8] c"abcdedfabcde\00"
@.str = [27 x i8] c"Found the right index: %d\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 6513249, i32* %2
%5 = call i32 @mstrindex(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printServerFlags() {
  printf("vlmcsd flags:%s\n", ""
                              " NO_LIMIT"
                              " NO_CLIENT_LIST");
}


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

x86 assembly (clang, -O2):
<printServerFlags>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"vlmcsd flags:%s\0A\00"
@.str.1 = [25 x i8] c" NO_LIMIT NO_CLIENT_LIST\00"
define void @printServerFlags() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"vlmcsd flags:%s\0A\00"
@.str.1 = [25 x i8] c" NO_LIMIT NO_CLIENT_LIST\00"
define void @printServerFlags() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ft_toupper(int c) {
  if (c >= 97 && c <= 122)
    return (c - 32);
  else
    return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <ft_toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <ft_toupper+0x29>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x < y) {
    x = x + 1;
    y = z;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <main+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int lastRemaining(int n) {
  return n == 1 ? 1 : 2 * (1 + n / 2 - lastRemaining(n / 2));
}


x86 assembly (clang, -O0):
<lastRemaining>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1132 <lastRemaining+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <lastRemaining+0x52>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <lastRemaining@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastRemaining>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1134 <lastRemaining+0x24>
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
sar    %ebx
mov    %ebx,%edi
call   1030 <lastRemaining@plt>
sub    %eax,%ebx
lea    (%rbx,%rbx,1),%eax
add    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lastRemaining(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 2
%9 = add nsw i32 1, %8
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 2
%12 = call i32 @lastRemaining(i32 %11)
%13 = sub nsw i32 %9, %12
%14 = mul nsw i32 2, %13
br label %15
15: ; preds = %6, %5
%16 = phi i32 [ 1, %5 ], [ %14, %6 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @lastRemaining(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = sdiv i32 %0, 2
%7 = add nsw i32 %6, 1
%8 = tail call i32 @lastRemaining(i32 %6)
%9 = sub i32 %7, %8
%10 = shl nsw i32 %9, 1
br label %3
}
/* Variables and functions */
scalar_t__ rnd();
float bell_rnd(int degree) {
  float sum;
  int i;
  for (i = 0; i < degree; i++) {
    sum += rnd();
  }
  return sum / (float)degree;
}


x86 assembly (clang, -O0):
<bell_rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1152 <bell_rnd+0x42>
mov    $0x0,%al
call   1030 <rnd@plt>
cvtsi2ss %rax,%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <bell_rnd+0x12>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bell_rnd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jle    1146 <bell_rnd+0x36>
mov    %ebx,%ebp
nopl   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rnd@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
add    $0xffffffff,%ebp
jne    1120 <bell_rnd+0x10>
jmp    1146 <bell_rnd+0x36>
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
divss  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @bell_rnd(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = call i64 (...) @rnd()
%11 = sitofp i64 %10 to float
%12 = load float, float* %3
%13 = fadd float %12, %11
store float %13, float* %3
br label %14
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load float, float* %3
%19 = load i32, i32* %2
%20 = sitofp i32 %19 to float
%21 = fdiv float %18, %20
ret float %21
}

LLVM IR (-O2):
define float @bell_rnd(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi float [ %8, %3 ], [ undef, %1 ]
%6 = tail call i64 (...) @rnd()
%7 = sitofp i64 %6 to float
%8 = fadd float %5, %7
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi float [ undef, %1 ], [ %8, %3 ]
%13 = sitofp i32 %0 to float
%14 = fdiv float %12, %13
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int size_double();
int main(void) {
  printf("size = %d\n", size_double());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <size_double@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"size = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @size_double()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int bind(int /*<<< orphan*/, struct sockaddr *, int /*<<< orphan*/);
int bad_bind(void *addr) { return bind(0, (struct sockaddr *)addr, 0); }


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

x86 assembly (clang, -O2):
<bad_bind>:
mov    %rdi,%rsi
xor    %edi,%edi
xor    %edx,%edx
jmp    1030 <bind@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @bad_bind(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.sockaddr*
%5 = call i32 @bind(i32 0, %struct.sockaddr* %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @bad_bind(i8* %0) {
%2 = bitcast i8* %0 to %struct.sockaddr*
%3 = tail call i32 @bind(i32 0, %struct.sockaddr* %2, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t hci_event_synchronous_connection_complete_get_tx_packet_length(
    const uint8_t *event) {
  return little_endian_read_16(event, 16);
}


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

x86 assembly (clang, -O2):
<hci_event_synchronous_connection_complete_get_tx_packet_length>:
mov    $0x10,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_synchronous_connection_complete_get_tx_packet_length(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 16)
ret i32 %2
}
void use(int *ptr, int val) { *ptr = val; }


x86 assembly (clang, -O0):
<use>:
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):
<use>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @use(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
void XSyncValueGreaterOrEqual() {}


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

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

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

LLVM IR (-O2):
define void @XSyncValueGreaterOrEqual() {
ret void
}
/* Type definitions */
struct queuea {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int queuea_iterator(void *context, struct queuea *queuea, void *data) {
  (void)context;
  (void)queuea;
  printf("%s ", (char *)data);
  return 0;
}


x86 assembly (clang, -O0):
<queuea_iterator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.queuea = type { i32 }
@.str = [4 x i8] c"%s \00"
define i32 @queuea_iterator(i8* %0, %struct.queuea* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.queuea*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.queuea* %1, %struct.queuea** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.queuea*, %struct.queuea** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.queuea = type { i32 }
@.str = [4 x i8] c"%s \00"
define i32 @queuea_iterator(i8* nocapture readnone %0, %struct.queuea* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void remove_nodes(void) {
  unlink("/dev/uart0");
  unlink("/dev/uart1");
  unlink("/dev/uart10");
}


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

x86 assembly (clang, -O2):
<remove_nodes>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xee7(%rip),%rdi
call   1030 <unlink@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/uart0\00"
@.str.1 = [11 x i8] c"/dev/uart1\00"
@.str.2 = [12 x i8] c"/dev/uart10\00"
define void @remove_nodes() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/uart0\00"
@.str.1 = [11 x i8] c"/dev/uart1\00"
@.str.2 = [12 x i8] c"/dev/uart10\00"
define void @remove_nodes() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int compare(float a, float b) {
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    112d <compare+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compare+0x4f>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1148 <compare+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(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 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load float, float* %4
%12 = load float, float* %5
%13 = fcmp ogt float %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = fcmp ogt float %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
char *l_getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *buf;
  buf = l_getenv("HOME");
  printf("env is %s\n", buf == NULL ? "null" : buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <l_getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <main+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1169 <main+0x49>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <l_getenv@plt>
test   %rax,%rax
lea    0xed9(%rip),%rsi
cmovne %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [11 x i8] c"env is %s\0A\00"
@.str.2 = [5 x i8] c"null\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @l_getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
br label %13
11: ; preds = %2
%12 = load i8*, i8** %6
br label %13
13: ; preds = %11, %10
%14 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %10 ], [ %12, %11 ]
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [11 x i8] c"env is %s\0A\00"
@.str.2 = [5 x i8] c"null\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @l_getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
int absolute(int value) {
  if (value < 0) {
    return value * (-1);
  }
  return value;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @lightc() {
ret void
}
unsigned bit_div7(unsigned num) {
  unsigned x, y;
  x = (num >> 1) + (num >> 4);
  x += x >> 6;
  x += (x >> 12) + (x >> 24);
  x >>= 2;
  y = num - ((x << 3) - x);
  return x + ((y + 1) >> 3);
}


x86 assembly (clang, -O0):
<bit_div7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
mov    -0x8(%rbp),%ecx
shr    $0x18,%ecx
add    %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
sub    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shr    $0x3,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_div7>:
mov    %edi,%eax
shr    %eax
mov    %edi,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x6,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x18,%ecx
add    %eax,%ecx
shr    $0xc,%eax
add    %eax,%ecx
shr    $0x2,%ecx
lea    0x0(,%rcx,8),%eax
mov    %ecx,%edx
sub    %eax,%edx
lea    (%rdi,%rdx,1),%eax
add    $0x1,%eax
shr    $0x3,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bit_div7(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = lshr i32 %7, 4
%9 = add i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 6
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 12
%16 = load i32, i32* %3
%17 = lshr i32 %16, 24
%18 = add i32 %15, %17
%19 = load i32, i32* %3
%20 = add i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = lshr i32 %21, 2
store i32 %22, i32* %3
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = shl i32 %24, 3
%26 = load i32, i32* %3
%27 = sub i32 %25, %26
%28 = sub i32 %23, %27
store i32 %28, i32* %4
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = add i32 %30, 1
%32 = lshr i32 %31, 3
%33 = add i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @bit_div7(i32 %0) {
%2 = lshr i32 %0, 1
%3 = lshr i32 %0, 4
%4 = add nuw i32 %2, %3
%5 = lshr i32 %4, 6
%6 = add nuw i32 %5, %4
%7 = lshr i32 %6, 12
%8 = lshr i32 %6, 24
%9 = add nuw i32 %8, %6
%10 = add nuw i32 %9, %7
%11 = lshr i32 %10, 2
%12 = mul i32 %11, -7
%13 = add i32 %0, 1
%14 = add i32 %13, %12
%15 = lshr i32 %14, 3
%16 = add nuw nsw i32 %15, %11
ret i32 %16
}
void irq_undefined(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<irq_undefined>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <irq_undefined+0x9>
jmp    1109 <irq_undefined+0x9>

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

LLVM IR (-O0):
define void @irq_undefined() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @irq_undefined() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ LCD_SET_A0();
int /*<<< orphan*/ Send1(int /*<<< orphan*/);
void LCD_X_WriteM01(char *pData, int NumBytes) {
  ;
  LCD_SET_A0();
  for (; NumBytes; NumBytes--) {
    Send1(*pData++);
  };
}


x86 assembly (clang, -O0):
<LCD_X_WriteM01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <LCD_SET_A0@plt>
cmpl   $0x0,-0xc(%rbp)
je     1165 <LCD_X_WriteM01+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <Send1@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <LCD_X_WriteM01+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_WriteM01>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <LCD_SET_A0@plt>
test   %ebp,%ebp
je     1152 <LCD_X_WriteM01+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <Send1@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1140 <LCD_X_WriteM01+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @LCD_X_WriteM01(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (...) @LCD_SET_A0()
%4 = icmp eq i32 %1, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ %1, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @Send1(i32 %10)
%12 = add nsw i32 %6, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ saftyexit(int /*<<< orphan*/);
void interuppthandler(int signal) {
  (void)signal;
  saftyexit(EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<interuppthandler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <saftyexit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @interuppthandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @saftyexit(i32 %4)
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @interuppthandler(i32 %0) {
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @saftyexit(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void fix_sft_invalid_error(const char *file, int line) {
  printf("Format mismatch in fix_sft() at %s:%d\n", file, line);
}


x86 assembly (clang, -O0):
<fix_sft_invalid_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_sft_invalid_error>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Format mismatch in fix_sft() at %s:%d\0A\00"
define void @fix_sft_invalid_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Format mismatch in fix_sft() at %s:%d\0A\00"
define void @fix_sft_invalid_error(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}