xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int dictIntHashFunction(unsigned int key) {
  key += ~(key << 15);
  key ^= (key >> 10);
  key += (key << 3);
  key ^= (key >> 6);
  key += ~(key << 11);
  key ^= (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<dictIntHashFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xa,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x6,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictIntHashFunction>:
mov    %edi,%eax
shl    $0xf,%eax
not    %eax
add    %edi,%eax
mov    %eax,%ecx
shr    $0xa,%ecx
xor    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
mov    %eax,%ecx
shr    $0x6,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0xb,%edx
not    %edx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
xor    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @dictIntHashFunction(i32 %0) {
%2 = shl i32 %0, 15
%3 = xor i32 %2, -1
%4 = add i32 %3, %0
%5 = lshr i32 %4, 10
%6 = xor i32 %5, %4
%7 = mul i32 %6, 9
%8 = lshr i32 %7, 6
%9 = xor i32 %8, %7
%10 = shl i32 %9, 11
%11 = xor i32 %10, -1
%12 = add i32 %9, %11
%13 = lshr i32 %12, 16
%14 = xor i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *child(void *dummy) {
  while (1) {
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111c <child+0xc>

x86 assembly (clang, -O2):
<child>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <child+0x10>

LLVM IR (-O0):
define i8* @child(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @child(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int MAXPATHLEN;
int path_is_valid(char *);
int /*<<< orphan*/ wcstombs(char *, int /*<<< orphan*/ *, int);
int wc_path_is_valid(wchar_t *wpath) {
  char path[MAXPATHLEN];
  wcstombs(path, wpath, MAXPATHLEN);
  return (path_is_valid(path));
}


x86 assembly (clang, -O0):
<wc_path_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
call   1030 <wcstombs@plt>
mov    -0x20(%rbp),%rdi
call   1040 <path_is_valid@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wc_path_is_valid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rsi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rdx,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <wcstombs@plt>
mov    %rbx,%rdi
call   1040 <path_is_valid@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@MAXPATHLEN = global i32 0
define i32 @wc_path_is_valid(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32, i32* @MAXPATHLEN
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i32*, i32** %2
%10 = load i32, i32* @MAXPATHLEN
%11 = call i32 @wcstombs(i8* %8, i32* %9, i32 %10)
%12 = call i32 @path_is_valid(i8* %8)
%13 = load i8*, i8** %3
ret i32 %12
}

LLVM IR (-O2):
@MAXPATHLEN = global i32 0
define i32 @wc_path_is_valid(i32* %0) {
%2 = load i32, i32* @MAXPATHLEN
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @wcstombs(i8* %4, i32* %0, i32 %2)
%6 = call i32 @path_is_valid(i8* %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ warn_obj_line_v(char const *, int, char const *,
                                   int /*<<< orphan*/);
void warn_obj_v(const char *obj, const char *p, va_list args) {
  warn_obj_line_v(obj, -1, p, args);
}


x86 assembly (clang, -O0):
<warn_obj_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xffffffff,%esi
call   1030 <warn_obj_line_v@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_obj_v>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xffffffff,%esi
jmp    1030 <warn_obj_line_v@plt>

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

LLVM IR (-O2):
define void @warn_obj_v(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @warn_obj_line_v(i8* %0, i32 -1, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
float expf(float);
float libm_expf(float x) { return expf(x); }


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

x86 assembly (clang, -O2):
<libm_expf>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @libm_expf(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Type definitions */
struct linit_fjob_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ llib_mem_free(struct linit_fjob_t *);
void linit_fjob_free(void *p) {
  struct linit_fjob_t *fj = p;
  if (fj)
    llib_mem_free(fj);
}


x86 assembly (clang, -O0):
<linit_fjob_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <linit_fjob_free+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <llib_mem_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.linit_fjob_t = type { i32 }
define void @linit_fjob_free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.linit_fjob_t*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.linit_fjob_t*
store %struct.linit_fjob_t* %5, %struct.linit_fjob_t** %3
%6 = load %struct.linit_fjob_t*, %struct.linit_fjob_t** %3
%7 = icmp ne %struct.linit_fjob_t* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.linit_fjob_t*, %struct.linit_fjob_t** %3
%10 = call i32 @llib_mem_free(%struct.linit_fjob_t* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.linit_fjob_t = type { i32 }
define void @linit_fjob_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to %struct.linit_fjob_t*
%5 = tail call i32 @llib_mem_free(%struct.linit_fjob_t* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, int, short);
int fun_stub_base_9_stub(short a, int b, short c) {
  printf("fun_stub_base_9_stub:a = %d, b = %d, c = %d\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<fun_stub_base_9_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
movswl %ax,%esi
movswl -0xa(%rbp),%ecx
call   1030 <printf@plt>
movswl -0x2(%rbp),%eax
add    -0x8(%rbp),%eax
movswl -0xa(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_9_stub>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
add    %ebp,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"fun_stub_base_9_stub:a = %d, b = %d, c = %d\0A\00"
define i32 @fun_stub_base_9_stub(i16 signext %0, i32 %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i32
%6 = alloca i16
store i16 %0, i16* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i32, i32* %5
%9 = load i16, i16* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i16 signext %7, i32 %8, i16 signext %9)
%11 = load i16, i16* %4
%12 = sext i16 %11 to i32
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = load i16, i16* %6
%16 = sext i16 %15 to i32
%17 = add nsw i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
@.str = [45 x i8] c"fun_stub_base_9_stub:a = %d, b = %d, c = %d\0A\00"
define i32 @fun_stub_base_9_stub(i16 signext %0, i32 %1, i16 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i16 signext %0, i32 %1, i16 signext %2)
%5 = sext i16 %0 to i32
%6 = add nsw i32 %5, %1
%7 = sext i16 %2 to i32
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ tekwm();
int main() {
  if (tekwm())
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <tekwm@plt>
cmp    $0x0,%rax
je     113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <main+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @tekwm()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @tekwm()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int rand();
int dice() { return (rand() % 6 + 1); }


x86 assembly (clang, -O0):
<dice>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dice>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dice() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @dice() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *string1, const char *string2) {
  static char *next_token = NULL;
  return strtok_r(string1, string2, &next_token);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.next_token = internal global i8* null
define i8* @strtok(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 i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.next_token)
ret i8* %7
}

LLVM IR (-O2):
@strtok.next_token = internal global i8* null
define i8* @strtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.next_token)
ret i8* %3
}
int subs(int a, int b) { return a - b; }


x86 assembly (clang, -O0):
<subs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @subs(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subs(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ q_sort(int *, int /*<<< orphan*/, int);
void quickSort(int numbers[], int array_size) {
  q_sort(numbers, 0, array_size - 1);
}


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

x86 assembly (clang, -O2):
<quickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <q_sort@plt>

LLVM IR (-O0):
define void @quickSort(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 = sub nsw i32 %6, 1
%8 = call i32 @q_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @q_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct tm *localtime(scalar_t__ *);
int /*<<< orphan*/ time(scalar_t__ *);
struct tm ltime(void) {
  time_t t;
  time(&t);
  assert(t != ((time_t)-1));
  return *localtime(&t);
}


x86 assembly (clang, -O0):
<ltime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1050 <time@plt>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltime>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
xor    %edi,%edi
cmpq   $0xffffffffffffffff,0x8(%rsp)
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @ltime() {
%1 = alloca %struct.tm
%2 = alloca i64
%3 = call i32 @time(i64* %2)
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call %struct.tm* @localtime(i64* %2)
%9 = bitcast %struct.tm* %1 to i8*
%10 = bitcast %struct.tm* %8 to i8*
%11 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @ltime() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @time(i64* %1)
%4 = load i64, i64* %1
%5 = icmp ne i64 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call %struct.tm* @localtime(i64* %1)
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *);
void print_x(int y, int x) {
  mvprintw(y, x, "\\/");
  mvprintw(y + 1, x, "/\\");
}


x86 assembly (clang, -O0):
<print_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdx
call   1030 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_x>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdx
call   1030 <mvprintw@plt>
add    $0x1,%ebp
lea    0xed6(%rip),%rdx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mvprintw@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\\/\00"
@.str.1 = [3 x i8] c"/\\\00"
define void @print_x(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 @mvprintw(i32 %5, i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = call i32 @mvprintw(i32 %9, i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\/\00"
@.str.1 = [3 x i8] c"/\\\00"
define void @print_x(i32 %0, i32 %1) {
%3 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %0, 1
%5 = tail call i32 @mvprintw(i32 %4, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
void STEST1903(char *s) {
  fprintf(stdout, "sub  (test15l) C1903: ( input):          s=%s\n", s);
  strcpy(s, "WS-PARM-3S     WS-PARM-2S     WS-PARM-1S     ");
  fprintf(stdout, "sub  (test15l) C1903: (output):          s=%s\n", s);
}


x86 assembly (clang, -O0):
<STEST1903>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xedf(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xef4(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEST1903>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
lea    0xee8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    (%r14),%edi
lea    0xf04(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [47 x i8] c"sub (test15l) C1903: ( input): s=%s\0A\00"
@.str.1 = [46 x i8] c"WS-PARM-3S WS-PARM-2S WS-PARM-1S \00"
@.str.2 = [47 x i8] c"sub (test15l) C1903: (output): s=%s\0A\00"
define void @STEST1903(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [47 x i8] c"sub (test15l) C1903: ( input): s=%s\0A\00"
@.str.1 = [46 x i8] c"WS-PARM-3S WS-PARM-2S WS-PARM-1S \00"
@.str.2 = [47 x i8] c"sub (test15l) C1903: (output): s=%s\0A\00"
define void @STEST1903(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
void gdk_window_lookup_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_lookup_for_display() {
ret void
}
/* Variables and functions */
int fibo(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int fib = fibo(n);
  printf("%d\n", fib);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <fibo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fibo@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fibo(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void prnSym(long c) { printf("%ld", c); }


x86 assembly (clang, -O0):
<prnSym>:
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):
<prnSym>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @prnSym(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
long long int ld2sll(long double d) { return (long long int)d; }


x86 assembly (clang, -O0):
<ld2sll>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x1c(%rbp)
fldcw  -0x1c(%rbp)
fistpll -0x18(%rbp)
fldcw  -0x1a(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld2sll>:
fldt   0x8(%rsp)
fnstcw -0xc(%rsp)
movzwl -0xc(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistpll -0x8(%rsp)
fldcw  -0xc(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @ld2sll(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i64
ret i64 %2
}
int file_secon(char *item) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @file_secon(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ sombin(int, int);
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  sombin(m, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sombin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <sombin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @sombin(i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @sombin(i32 %6, i32 %7)
ret i32 0
}
void CRYPTO_get_mem_functions(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_get_mem_functions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void ___usage(char *parameter) {
  printf("do not run this command by hand\n");
  exit(1);
}


x86 assembly (clang, -O0):
<___usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [33 x i8] c"do not run this command by hand\0A\00"
define void @___usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [32 x i8] c"do not run this command by hand\00"
define void @___usage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ const __m128i;

/* Variables and functions */
__m128i _mm_load_si128(__m128i const *a) { return *a; }


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

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

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

LLVM IR (-O2):
define i32 @_mm_load_si128(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello world (oops).\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello world (oops).\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("First unmatched string\n");
  printf("Second unmatched string!!!\n");
  printf("\tLet's end well\n");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"First unmatched string\0A\00"
@.str.1 = [28 x i8] c"Second unmatched string!!!\0A\00"
@.str.2 = [17 x i8] c"\09Let's end well\0A\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
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"First unmatched string\00"
@str.3 = [27 x i8] c"Second unmatched string!!!\00"
@str.4 = [16 x i8] c"\09Let's end well\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
void increment_pointer(int *buf, int *end) {
  while (buf != end)
    *buf++ = 0;
}


x86 assembly (clang, -O0):
<increment_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1134 <increment_pointer+0x34>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x0,(%rax)
jmp    110c <increment_pointer+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_pointer>:
cmp    %rsi,%rdi
je     112b <increment_pointer+0x1b>
push   %rax
mov    %rsi,%rdx
sub    %rdi,%rdx
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @increment_pointer(i32* writeonly %0, i32* readnone %1) {
%3 = icmp eq i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = ptrtoint i32* %1 to i64
%6 = bitcast i32* %0 to i8*
%7 = ptrtoint i32* %0 to i64
%8 = add i64 %5, -4
%9 = sub i64 %8, %7
%10 = add i64 %9, 4
%11 = and i64 %10, -4
br label %12
12: ; preds = %4, %2
ret void
}
void add2(int x, int *y, int *z) { *z = x + *y; }


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

x86 assembly (clang, -O2):
<add2>:
add    (%rsi),%edi
mov    %edi,(%rdx)
ret

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

LLVM IR (-O2):
define void @add2(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %0
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_yield();
void yield(void) { pthread_yield(); }


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

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

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

LLVM IR (-O2):
define void @yield() {
%1 = tail call i32 (...) @pthread_yield()
ret void
}
long int factorial(int x) {
  long int resultado = x;
  if (x < 2)
    resultado = 1;
  else
    resultado = x * factorial(x - 1);
  return resultado;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    113a <factorial+0x2a>
movq   $0x1,-0x10(%rbp)
jmp    115c <factorial+0x4c>
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <factorial+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <factorial+0x20>
ret

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

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %8, %5 ]
%7 = phi i64 [ 1, %3 ], [ %9, %5 ]
%8 = add nsw i64 %6, -1
%9 = mul nsw i64 %7, %6
%10 = icmp ult i64 %6, 3
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %9, %5 ]
ret i64 %12
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *somePath(struct sqlConnection *, int, char *);
char *bioImageThumbSizePath(struct sqlConnection *conn, int id) {
  return somePath(conn, id, "thumbLocation");
}


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

x86 assembly (clang, -O2):
<bioImageThumbSizePath>:
lea    0xee9(%rip),%rdx
jmp    1030 <somePath@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [14 x i8] c"thumbLocation\00"
define i8* @bioImageThumbSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @somePath(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [14 x i8] c"thumbLocation\00"
define i8* @bioImageThumbSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @somePath(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int writen(int, char *, int /*<<< orphan*/);
int net_print(int sock, char *msg) { return writen(sock, msg, strlen(msg)); }


x86 assembly (clang, -O0):
<net_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <writen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_print>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writen@plt>

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

LLVM IR (-O2):
define i32 @net_print(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @writen(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
int S_Search(int *arr, int key) {
  int i = 0;
  while (arr[i] != key && i < 128)
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<S_Search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
je     1138 <S_Search+0x38>
cmpl   $0x80,-0x10(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <S_Search+0x48>
jmp    1156 <S_Search+0x56>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <S_Search+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_Search>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmp    %esi,(%rdi,%rcx,4)
je     1125 <S_Search+0x25>
cmp    $0x80,%rcx
mov    %rax,%rcx
jb     1110 <S_Search+0x10>
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @S_Search(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, %1
%8 = icmp ult i64 %4, 128
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw nsw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fread(unsigned short *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned char,
                         int /*<<< orphan*/);
unsigned short htobe16(unsigned short);
unsigned short read16(FILE *f, unsigned char offset) {
  fseek(f, offset, SEEK_SET);
  unsigned short s = 0;
  fread(&s, sizeof(unsigned short), 1, f);
  return htobe16(s);
}


x86 assembly (clang, -O0):
<read16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    0x2e90(%rip),%rcx
mov    (%rcx),%edx
movzbl %al,%esi
call   1040 <fseek@plt>
movw   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzwl -0xc(%rbp),%edi
call   1050 <htobe16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
movw   $0x0,0xe(%rsp)
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movzwl 0xe(%rsp),%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <htobe16@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define zeroext i16 @read16(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i16
store i32* %0, i32** %3
store i8 %1, i8* %4
%6 = load i32*, i32** %3
%7 = load i8, i8* %4
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @fseek(i32* %6, i8 zeroext %7, i32 %8)
store i16 0, i16* %5
%10 = load i32*, i32** %3
%11 = call i32 @fread(i16* %5, i32 2, i32 1, i32* %10)
%12 = load i16, i16* %5
%13 = call zeroext i16 @htobe16(i16 zeroext %12)
ret i16 %13
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define zeroext i16 @read16(i32* nocapture %0, i8 zeroext %1) {
%3 = alloca i16
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i8 zeroext %1, i32 %4)
%6 = bitcast i16* %3 to i8*
store i16 0, i16* %3
%7 = call i32 @fread(i16* %3, i32 2, i32 1, i32* %0)
%8 = load i16, i16* %3
%9 = tail call zeroext i16 @htobe16(i16 zeroext %8)
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_UNLCK;
int fd_get_lock(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fd_release_lock(int fd) { return (fd_get_lock(fd, F_SETLK, F_UNLCK)); }


x86 assembly (clang, -O0):
<fd_release_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
call   1030 <fd_get_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_release_lock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fd_get_lock@plt>

LLVM IR (-O0):
@F_SETLK = global i32 0
@F_UNLCK = global i32 0
define i32 @fd_release_lock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETLK
%5 = load i32, i32* @F_UNLCK
%6 = call i32 @fd_get_lock(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@F_SETLK = global i32 0
@F_UNLCK = global i32 0
define i32 @fd_release_lock(i32 %0) {
%2 = load i32, i32* @F_SETLK
%3 = load i32, i32* @F_UNLCK
%4 = tail call i32 @fd_get_lock(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ memcpy(long long *, double *, int);
long long fb_CVLONGINTFROMD(double d) {
  do {
    if ((8) == sizeof(d) && (8) == sizeof(long long)) {
      long long to;
      memcpy(&to, &d, 8);
      return to;
    } else {
      return (long long)0;
    }
  } while (0);
}


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

x86 assembly (clang, -O2):
<fb_CVLONGINTFROMD>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @fb_CVLONGINTFROMD(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
br label %4
4: ; preds = %1
%5 = call i32 @memcpy(i64* %3, double* %2, i32 8)
%6 = load i64, i64* %3
br label %7
7: ; preds = %4
ret i64 %6
}

LLVM IR (-O2):
define i64 @fb_CVLONGINTFROMD(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = bitcast i64* %3 to i8*
%5 = call i32 @memcpy(i64* %3, double* %2, i32 8)
%6 = load i64, i64* %3
ret i64 %6
}
int compare_double(const void *a, const void *b) {
  return ((*(double *)a > *(double *)b) - (*(double *)a < *(double *)b));
}


x86 assembly (clang, -O0):
<compare_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
movsd  (%rcx),%xmm1
mov    -0x10(%rbp),%rcx
movsd  (%rcx),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_double(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to double*
%18 = load double, double* %17
%19 = fcmp olt double %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @compare_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}