xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int /*<<< orphan*/ *meta_get(char const *);
int sqlite3_column_int(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int db_meta_get_int(const char *key) {
  int result;
  sqlite3_stmt *stmt = meta_get(key);
  if (!stmt) {
    return 0;
  }
  result = sqlite3_column_int(stmt, 0);
  sqlite3_finalize(stmt);
  return result;
}


x86 assembly (clang, -O0):
<db_meta_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <meta_get@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1160 <db_meta_get_int+0x30>
movl   $0x0,-0x4(%rbp)
jmp    117d <db_meta_get_int+0x4d>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1040 <sqlite3_column_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <sqlite3_finalize@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_meta_get_int>:
push   %rbp
push   %rbx
push   %rax
call   1030 <meta_get@plt>
test   %rax,%rax
je     1158 <db_meta_get_int+0x28>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <sqlite3_column_int@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <sqlite3_finalize@plt>
mov    %ebp,%eax
jmp    115a <db_meta_get_int+0x2a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @db_meta_get_int(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @meta_get(i8* %6)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 0, i32* %2
br label %17
11: ; preds = %1
%12 = load i32*, i32** %5
%13 = call i32 @sqlite3_column_int(i32* %12, i32 0)
store i32 %13, i32* %4
%14 = load i32*, i32** %5
%15 = call i32 @sqlite3_finalize(i32* %14)
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @db_meta_get_int(i8* %0) {
%2 = tail call i32* @meta_get(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @sqlite3_column_int(i32* %2, i32 0)
%6 = tail call i32 @sqlite3_finalize(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_quaddobl_pole_step(double *step) {
  int fail;
  int precision = 2;
  int *b;
  fail = _ada_use_c2phc4c(886, &precision, b, step, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @padcon_get_quaddobl_pole_step(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 886, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ blink_blue(int);
int /*<<< orphan*/ blink_orange(int);
void blink() {
  blink_blue(1000000);
  blink_orange(1000000);
  blink_blue(1000000);
}


x86 assembly (clang, -O0):
<blink>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf4240,%edi
call   1030 <blink_blue@plt>
mov    $0xf4240,%edi
call   1040 <blink_orange@plt>
mov    $0xf4240,%edi
call   1030 <blink_blue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink>:
push   %rax
mov    $0xf4240,%edi
call   1030 <blink_blue@plt>
mov    $0xf4240,%edi
call   1040 <blink_orange@plt>
mov    $0xf4240,%edi
pop    %rax
jmp    1030 <blink_blue@plt>

LLVM IR (-O0):
define void @blink() {
%1 = call i32 @blink_blue(i32 1000000)
%2 = call i32 @blink_orange(i32 1000000)
%3 = call i32 @blink_blue(i32 1000000)
ret void
}

LLVM IR (-O2):
define void @blink() {
%1 = tail call i32 @blink_blue(i32 1000000)
%2 = tail call i32 @blink_orange(i32 1000000)
%3 = tail call i32 @blink_blue(i32 1000000)
ret void
}
/* Variables and functions */
scalar_t__ atexit(void (*)());
int /*<<< orphan*/ die(char *);
void sAtexit(void (*function)(void)) {
  if (atexit(function) != 0) {
    die("failed to register function with atexit");
  }
}


x86 assembly (clang, -O0):
<sAtexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1160 <atexit>
cmp    $0x0,%rax
je     114b <sAtexit+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<sAtexit>:
push   %rax
call   1140 <atexit>
test   %rax,%rax
je     1138 <sAtexit+0x18>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <die@plt>
pop    %rax
ret
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
@.str = [40 x i8] c"failed to register function with atexit\00"
define void @sAtexit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i64 @atexit(void (...)* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"failed to register function with atexit\00"
define void @sAtexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i64 @atexit(void (...)* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct rtbst_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void **rtbst_probe(struct rtbst_table *, void *);
void(rtbst_assert_insert)(struct rtbst_table *table, void *item) {
  void **p = rtbst_probe(table, item);
  assert(p != NULL && *p == item);
}


x86 assembly (clang, -O0):
<rtbst_assert_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rtbst_probe@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1162 <rtbst_assert_insert+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtbst_assert_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <rtbst_probe@plt>
xor    %edi,%edi
test   %rax,%rax
je     1137 <rtbst_assert_insert+0x17>
cmp    %rbx,(%rax)
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.rtbst_table = type { i32 }
define void @rtbst_assert_insert(%struct.rtbst_table* %0, i8* %1) {
%3 = alloca %struct.rtbst_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.rtbst_table* %0, %struct.rtbst_table** %3
store i8* %1, i8** %4
%6 = load %struct.rtbst_table*, %struct.rtbst_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @rtbst_probe(%struct.rtbst_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br label %16
16: ; preds = %11, %2
%17 = phi i1 [ false, %2 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
%struct.rtbst_table = type { i32 }
define void @rtbst_assert_insert(%struct.rtbst_table* %0, i8* %1) {
%3 = tail call i8** @rtbst_probe(%struct.rtbst_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
%11 = tail call i32 @assert(i32 %10)
ret void
}
/* Type definitions */
struct ip {
  int /*<<< orphan*/ ip_id;
};

/* Variables and functions */
int ntohs(int /*<<< orphan*/);
int get_ip_id(struct ip *self) { return ntohs(self->ip_id); }


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

x86 assembly (clang, -O2):
<get_ip_id>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.ip = type { i32 }
define i32 @get_ip_id(%struct.ip* %0) {
%2 = alloca %struct.ip*
store %struct.ip* %0, %struct.ip** %2
%3 = load %struct.ip*, %struct.ip** %2
%4 = getelementptr inbounds %struct.ip, %struct.ip* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i32 @get_ip_id(%struct.ip* nocapture %0) {
%2 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void smarttempcmd(const char *path, char *cmd) {
  sprintf(cmd,
          "disktool -A %s | grep 'Current Drive Temperature' | cut -f 2 -d "
          "':'| cut -f 1 -d 'C' 2>/dev/null",
          path);
  return;
}


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

x86 assembly (clang, -O2):
<smarttempcmd>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [97 x i8] c"disktool -A %s | grep 'Current Drive Temperature' | cut -f 2 -d ':'| cut -f 1 -d 'C' 2>/dev/null\00"
define void @smarttempcmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [97 x i8] c"disktool -A %s | grep 'Current Drive Temperature' | cut -f 2 -d ':'| cut -f 1 -d 'C' 2>/dev/null\00"
define void @smarttempcmd(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float float_lerp(float from, float to, float t) {
  return from + t * (to - from);
}


x86 assembly (clang, -O0):
<float_lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @float_lerp(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* %6
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @float_lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void exceed(int d) {
  printf("  ERR: the files differ in at least %d lines\n", d);
}


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

x86 assembly (clang, -O2):
<exceed>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c" ERR: the files differ in at least %d lines\0A\00"
define void @exceed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c" ERR: the files differ in at least %d lines\0A\00"
define void @exceed(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int __svgalib_rendition_inseq(int index) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__svgalib_rendition_inseq(i32 %0) {
ret i32 0
}
void CRYPTO_lock(int mode, int type, const char *file, int line) {
  CRYPTO_lock(mode, type, file, line);
}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_lock(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
br label %5
5: ; preds = %5, %4
br label %5
}
int f(int a) { return a * (a + 1); }


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

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
ret i32 %3
}
int isascii7bit(int c) { return (c >= 0) && (c <= 0x7f); }


x86 assembly (clang, -O0):
<isascii7bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isascii7bit+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii7bit>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii7bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isascii7bit(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
int main(int argc, char const *argv[]) {
  int i;
  int a[1024];
  int sum = 0;
#pragma omp parallel for reduction(+ : sum)
  for (i = 0; i < 1024; i++) {
    sum += a[i];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1024(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    115c <main+0x5c>
movslq -0x14(%rbp),%rax
mov    -0x1020(%rbp,%rax,4),%eax
add    -0x1024(%rbp),%eax
mov    %eax,-0x1024(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <main+0x2a>
xor    %eax,%eax
add    $0xfb0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nerror(char *);
long *lvector(long nl, long nh) {
  long *v;
  v = (long *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(long)));
  if (!v)
    nerror("allocation failure in lvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <lvector+0x44>
lea    0xea1(%rip),%rdi
call   1040 <nerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <nerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i64*
store i64* %13, i64** %5
%14 = load i64*, i64** %5
%15 = icmp ne i64* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i64*, i64** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = getelementptr inbounds i64, i64* %22, i64 1
ret i64* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = getelementptr inbounds i64, i64* %13, i64 1
ret i64* %14
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void handler(int sig) {
  printf("\x1b[0m"
         "\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[0m\0A\00"
@EXIT_SUCCESS = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [5 x i8] c"\1B[0m\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f27(long j) {
  if ((j & ((1UL << (27)) - 1)) >= ((1UL << ((27) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f27>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7ffffff,%rax
cmp    $0x4000002,%rax
jb     1139 <f27+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f27>:
and    $0x7fffffe,%edi
cmp    $0x4000002,%edi
jae    111f <f27+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f27(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 134217727
%5 = icmp uge i64 %4, 67108866
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f27(i64 %0) {
%2 = and i64 %0, 134217726
%3 = icmp ugt i64 %2, 67108865
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ local_address;

/* Variables and functions */
scalar_t__ getpeername(int, struct sockaddr *, unsigned int *);
char *inet_ntoa(int /*<<< orphan*/);
char *getHostBySock(int sock) {
  struct sockaddr_in local_address;
  int addr_size = sizeof(local_address);
  if (getpeername(sock, (struct sockaddr *)&local_address,
                  (unsigned int *)&addr_size) < 0) {
    return inet_ntoa(local_address.sin_addr);
  } else {
    return inet_ntoa(local_address.sin_addr);
  }
}


x86 assembly (clang, -O0):
<getHostBySock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <getpeername@plt>
cmp    $0x0,%rax
jge    115d <getHostBySock+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
jmp    1169 <getHostBySock+0x49>
mov    -0x10(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHostBySock>:
push   %rax
movl   $0x4,0x4(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <getpeername@plt>
mov    (%rsp),%edi
call   1030 <inet_ntoa@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i8* @getHostBySock(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%8 = call i64 @getpeername(i32 %6, %struct.sockaddr* %7, i32* %5)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i8* @inet_ntoa(i32 %12)
store i8* %13, i8** %2
br label %18
14: ; preds = %1
%15 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i8* @inet_ntoa(i32 %16)
store i8* %17, i8** %2
br label %18
18: ; preds = %14, %10
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i8* @getHostBySock(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i64 @getpeername(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i8* @inet_ntoa(i32 %9)
ret i8* %10
}
int assign() {
  int *a;
  struct {
    int *x;
  } b;
  a = b.x;
}


x86 assembly (clang, -O0):
<assign>:
push   %rbp
mov    %rsp,%rbp
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32* }
define i32 @assign() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca %struct.anon
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
%5 = load i32*, i32** %4
store i32* %5, i32** %2
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @assign() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_message_to_stdout(const char *message) {
  (void)printf("<<<MSG>>> %s", message);
}


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

x86 assembly (clang, -O2):
<print_message_to_stdout>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"<<<MSG>>> %s\00"
define void @print_message_to_stdout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"<<<MSG>>> %s\00"
define void @print_message_to_stdout(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void gtk_clipboard_clear() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_clear() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xselection_send_event(void *_p) {
  return (int)((XEvent *)_p)->xselection.send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xselection_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xselection_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pal_pe_clean_up();
int /*<<< orphan*/ pal_pe_free_shared_mem();
void val_shared_mem_free() {
  pal_pe_free_shared_mem();
  pal_pe_clean_up();
}


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

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

LLVM IR (-O0):
define void @val_shared_mem_free() {
%1 = call i32 (...) @pal_pe_free_shared_mem()
%2 = call i32 (...) @pal_pe_clean_up()
ret void
}

LLVM IR (-O2):
define void @val_shared_mem_free() {
%1 = tail call i32 (...) @pal_pe_free_shared_mem()
%2 = tail call i32 (...) @pal_pe_clean_up()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int O_CLOEXEC;
int O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int);
int /*<<< orphan*/ read(int, int /*<<< orphan*/ *, int);
uint64_t randu64() {
  uint64_t result;
  int fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
  ssize_t readsize = read(fd, &result, sizeof(result));
  (void)readsize;
  close(fd);
  return result;
}


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

x86 assembly (clang, -O2):
<randu64>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    0x2e8d(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xc(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
@O_CLOEXEC = global i32 0
define i32 @randu64() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @O_RDONLY
%4 = load i32, i32* @O_CLOEXEC
%5 = or i32 %4, %3
%6 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @read(i32 %6, i32* %1, i32 4)
%8 = tail call i32 @close(i32 %6)
%9 = load i32, i32* %1
ret i32 %9
}
float __attribute((unit("a")))
implicit_cast_repr_2(int __attribute((unit("a"))) a) {
  return a;
}


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

x86 assembly (clang, -O2):
<implicit_cast_repr_2>:
cvtsi2ss %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @implicit_cast_repr_2(i32 %0) {
%2 = sitofp i32 %0 to float
ret float %2
}
/* Variables and functions */
char toupper(char);
char *strupper(char *str) {
  char *s;
  if (str == NULL)
    return NULL;
  s = str;
  while (*s) {
    *s = toupper(*s);
    s++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strupper+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1176 <strupper+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <strupper+0x5e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113c <strupper+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <strupper+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <strupper+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupper(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @toupper(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int cmpfn(const void *a, const void *b) {
  const char *const *as = a, *const *bs = b;
  return strcmp(*as, *bs);
}


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

x86 assembly (clang, -O2):
<cmpfn>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmpfn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpfn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
long int ar_member_date_1(desc, name, hdrpos, datapos, size, date, uid, gid,
                          mode, mem)
int desc;
char *name;
long int hdrpos, datapos, size, date;
int uid, gid, mode;
char *mem;
{ return ar_name_equal(name, mem) ? date : 0; }


x86 assembly (clang, -O0):
<ar_member_date_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x28(%rbp),%rsi
mov    $0x0,%al
call   1030 <ar_name_equal@plt>
cmp    $0x0,%eax
je     1161 <ar_member_date_1+0x51>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    116c <ar_member_date_1+0x5c>
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
jmp    116c <ar_member_date_1+0x5c>
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ar_member_date_1>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %rsi,%rdi
mov    0x38(%rsp),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <ar_name_equal@plt>
test   %eax,%eax
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @ar_member_date_1(i32 %0, i8* %1, i64 %2, i64 %3, i64 %4, i64 %5, i32 %6, i32 %7, i32 %8, i8* %9) {
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8*
store i32 %0, i32* %11
store i8* %1, i8** %12
store i64 %2, i64* %13
store i64 %3, i64* %14
store i64 %4, i64* %15
store i64 %5, i64* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i8* %9, i8** %20
%21 = load i8*, i8** %12
%22 = load i8*, i8** %20
%23 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ar_name_equal to i32 (i8*, i8*, ...)*)(i8* %21, i8* %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %10
%26 = load i64, i64* %16
br label %28
27: ; preds = %10
br label %28
28: ; preds = %27, %25
%29 = phi i64 [ %26, %25 ], [ 0, %27 ]
ret i64 %29
}

LLVM IR (-O2):
define i64 @ar_member_date_1(i32 %0, i8* %1, i64 %2, i64 %3, i64 %4, i64 %5, i32 %6, i32 %7, i32 %8, i8* %9) {
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ar_name_equal to i32 (i8*, i8*, ...)*)(i8* %1, i8* %9)
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i64 0, i64 %5
ret i64 %13
}
double f(double x, double y) { return 0.0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @f(double %0, double %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int b = __VERIFIER_nondet_int();
  while (1) {
    if (!b) {
      break;
    }
    b = __VERIFIER_nondet_int();
    x = x - 1;
    b = (x >= 0);
  }
  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)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <main+0x32>
jmp    1169 <main+0x59>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     113e <main+0x2e>
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
add    $0xffffffff,%ebx
test   %ebx,%ebx
jg     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = add nsw i32 %5, -1
%8 = icmp slt i32 %5, 1
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int dblist_cmp(void *data1, void *data2) {
  return (strcmp((char *)data1, (char *)data2) == 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dblist_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblist_cmp>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dblist_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @dblist_cmp(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void SSMR3HandleGetStatus(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleGetStatus() {
ret void
}
float *test_func_01(float *p, float *x) {
  float r = 0;
  r += *p++;
  r += *p++;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
<test_func_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  (%rax),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  (%rax),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  (%rax),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_01>:
xorps  %xmm0,%xmm0
addss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
addss  0x8(%rdi),%xmm0
lea    0xc(%rdi),%rax
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define float* @test_func_01(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
store float 0.000000e+00, float* %5
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i32 1
store float* %7, float** %3
%8 = load float, float* %6
%9 = load float, float* %5
%10 = fadd float %9, %8
store float %10, float* %5
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i32 1
store float* %12, float** %3
%13 = load float, float* %11
%14 = load float, float* %5
%15 = fadd float %14, %13
store float %15, float* %5
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i32 1
store float* %17, float** %3
%18 = load float, float* %16
%19 = load float, float* %5
%20 = fadd float %19, %18
store float %20, float* %5
%21 = load float, float* %5
%22 = load float*, float** %4
store float %21, float* %22
%23 = load float*, float** %3
ret float* %23
}

LLVM IR (-O2):
define float* @test_func_01(float* %0, float* nocapture writeonly %1) {
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %0
%5 = fadd float %4, 0.000000e+00
%6 = getelementptr inbounds float, float* %0, i64 2
%7 = load float, float* %3
%8 = fadd float %5, %7
%9 = getelementptr inbounds float, float* %0, i64 3
%10 = load float, float* %6
%11 = fadd float %8, %10
store float %11, float* %1
ret float* %9
}
/* Variables and functions */
int mystrstr(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int position = mystrstr("lllllll", "lll");
  printf("The position of needle in the haystack = %d\n", position);
  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
lea    0xec0(%rip),%rsi
call   1030 <mystrstr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"lllllll\00"
@.str.1 = [4 x i8] c"lll\00"
@.str.2 = [45 x i8] c"The position of needle in the haystack = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @mystrstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"lllllll\00"
@.str.1 = [4 x i8] c"lll\00"
@.str.2 = [45 x i8] c"The position of needle in the haystack = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mystrstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}