xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ libhaiku_perror2(char const *, int /*<<< orphan*/);
void libhaiku_perror(const char *_libhaiku_prefix) {
  libhaiku_perror2(_libhaiku_prefix, errno);
}


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

x86 assembly (clang, -O2):
<libhaiku_perror>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <libhaiku_perror2@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define void @libhaiku_perror(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @libhaiku_perror2(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_w32(int);
void emit_fcmpd(int x, int y) {
  assem_debug("fcmpd d6, d7\n");
  output_w32(0xeeb46b47);
}


x86 assembly (clang, -O0):
<emit_fcmpd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeeb46b47,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fcmpd>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeeb46b47,%edi
pop    %rax
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fcmpd d6, d7\0A\00"
define void @emit_fcmpd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @output_w32(i32 -290165945)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fcmpd d6, d7\0A\00"
define void @emit_fcmpd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @output_w32(i32 -290165945)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ld_a_hld();
void opcode_3a() { ld_a_hld(); }


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

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

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

LLVM IR (-O2):
define void @opcode_3a() {
%1 = tail call i32 (...) @ld_a_hld()
ret void
}
void g_slist_find_custom() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_find_custom() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main() {
  char *a = malloc(6 * sizeof(char));
  printf("%p\n", a);
  strncpy(a, "hello", 5);
  printf("%p\n", a);
  a[5] = '\0';
  puts(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0x5(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x6,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xea8(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,0x5(%rbx)
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 6)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @strncpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 5
store i8 0, i8* %11
%12 = load i8*, i8** %2
%13 = call i32 @puts(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(6) i8* @malloc(i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = getelementptr inbounds i8, i8* %1, i64 5
store i8 0, i8* %5
%6 = tail call i32 @puts(i8* dereferenceable(1) %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) { nrerror("usage: findpath.c  [-m depth] [-d[0|1|2]] [-v]"); }


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"usage: findpath.c [-m depth] [-d[0|1|2]] [-v]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"usage: findpath.c [-m depth] [-d[0|1|2]] [-v]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR6B_set(void) { return U_WMRCORENONE_set("U_WMR6B"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR6B\00"
define i8* @U_WMR6B_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR6B\00"
define i8* @U_WMR6B_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  abort();
  abort();
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ absolutex();
int /*<<< orphan*/ writemem65816(int /*<<< orphan*/, int /*<<< orphan*/);
void stzAbsx8(void) { writemem65816(absolutex(), 0); }


x86 assembly (clang, -O0):
<stzAbsx8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <absolutex@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <writemem65816@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stzAbsx8>:
push   %rax
xor    %eax,%eax
call   1030 <absolutex@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <writemem65816@plt>

LLVM IR (-O0):
define void @stzAbsx8() {
%1 = call i32 (...) @absolutex()
%2 = call i32 @writemem65816(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @stzAbsx8() {
%1 = tail call i32 (...) @absolutex()
%2 = tail call i32 @writemem65816(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double display_intermediate_coaches_results(double coaches_poll) {
  coaches_poll = coaches_poll / 1475;
  printf("Intermediate Results - Coaches Poll = %lf\n", coaches_poll);
  return 0;
}


x86 assembly (clang, -O0):
<display_intermediate_coaches_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_intermediate_coaches_results>:
push   %rax
divsd  0xee7(%rip),%xmm0
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Intermediate Results - Coaches Poll = %lf\0A\00"
define double @display_intermediate_coaches_results(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.475000e+03
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %5)
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [43 x i8] c"Intermediate Results - Coaches Poll = %lf\0A\00"
define double @display_intermediate_coaches_results(double %0) {
%2 = fdiv double %0, 1.475000e+03
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %2)
ret double 0.000000e+00
}
char *timlib_pad_spaces_to_justify_left(char *d, char *s, int size) {
  sprintf(d, "%-*s", size, s);
  return d;
}


x86 assembly (clang, -O0):
<timlib_pad_spaces_to_justify_left>:
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    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_pad_spaces_to_justify_left>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%-*s\00"
define i8* @timlib_pad_spaces_to_justify_left(i8* returned writeonly %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
ret i8* %0
}
/* Variables and functions */
void *solv_malloc(size_t);
int /*<<< orphan*/ solv_oom(size_t, size_t);
void *solv_malloc2(size_t num, size_t len) {
  if (len && (num * len) / len != num)
    solv_oom(num, len);
  return solv_malloc(num * len);
}


x86 assembly (clang, -O0):
<solv_malloc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <solv_malloc2+0x43>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    -0x8(%rbp),%rax
je     1163 <solv_malloc2+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <solv_oom@plt>
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <solv_malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solv_malloc2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1142 <solv_malloc2+0x22>
mov    %rbx,%rax
mul    %r14
jno    1142 <solv_malloc2+0x22>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <solv_oom@plt>
imul   %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <solv_malloc@plt>

LLVM IR (-O0):
define i8* @solv_malloc2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = mul i64 %8, %9
%11 = load i64, i64* %4
%12 = udiv i64 %10, %11
%13 = load i64, i64* %3
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %7
%16 = load i64, i64* %3
%17 = load i64, i64* %4
%18 = call i32 @solv_oom(i64 %16, i64 %17)
br label %19
19: ; preds = %15, %7, %2
%20 = load i64, i64* %3
%21 = load i64, i64* %4
%22 = mul i64 %20, %21
%23 = call i8* @solv_malloc(i64 %22)
ret i8* %23
}

LLVM IR (-O2):
define i8* @solv_malloc2(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%6 = extractvalue { i64, i1 } %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @solv_oom(i64 %0, i64 %1)
br label %9
9: ; preds = %7, %4, %2
%10 = mul i64 %1, %0
%11 = tail call i8* @solv_malloc(i64 %10)
ret i8* %11
}
void free_list(char **list) {
  int i;
  if (!list)
    return;
  for (i = 0; list[i]; i++)
    free(list[i]);
  free(list);
}


x86 assembly (clang, -O0):
<free_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_list+0x1c>
jmp    116e <free_list+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <free_list+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <free_list+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_list>:
test   %rdi,%rdi
je     1150 <free_list+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_list+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_list+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_list(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, int);
int string_eq(char *s1, char *s2, int k) { return memcmp(s1, s2, k) == 0; }


x86 assembly (clang, -O0):
<string_eq>:
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),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @string_eq(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 i64 @memcmp(i8* %7, i8* %8, i32 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @string_eq(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int exynos4_pmu_cp_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @exynos4_pmu_cp_init() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int SSL_write(int /*<<< orphan*/ *, char *, size_t);
int send(int, char *, size_t, int /*<<< orphan*/);
__attribute__((always_)) int tmail_sock_send(void *fd, char *bf, size_t sz,
                                             bool protected
                                             __attribute__((__unused__))) {
  if (protected)
    return SSL_write((SSL *)fd, bf, sz);
  return send(*(int *)fd, bf, sz, 0);
}


x86 assembly (clang, -O0):
<tmail_sock_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115a <tmail_sock_send+0x3a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <SSL_write@plt>
mov    %eax,-0x4(%rbp)
jmp    1172 <tmail_sock_send+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmail_sock_send>:
test   %ecx,%ecx
je     1129 <tmail_sock_send+0x9>
jmp    1030 <SSL_write@plt>
mov    (%rdi),%edi
xor    %ecx,%ecx
jmp    1040 <send@plt>

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

LLVM IR (-O2):
define i32 @tmail_sock_send(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = bitcast i8* %0 to i32*
br i1 %5, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @SSL_write(i32* %6, i8* %1, i64 %2)
br label %12
9: ; preds = %4
%10 = load i32, i32* %6
%11 = tail call i32 @send(i32 %10, i8* %1, i64 %2, i32 0)
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %8, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main() { f(0x00); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
ret i32 0
}
unsigned int countDigits(int num) {
  int digits = 1;
  if (num < 0)
    num *= -1;
  while ((num /= 10) > 0)
    digits++;
  return digits;
}


x86 assembly (clang, -O0):
<countDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <countDigits+0x1f>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <countDigits+0x24>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1149 <countDigits+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <countDigits+0x24>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0x1,%eax
cmp    $0xa,%ecx
jb     1134 <countDigits+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%edx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <countDigits+0x20>
ret

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

LLVM IR (-O2):
define i32 @countDigits(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = icmp ugt i32 %2, 9
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = udiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = icmp ugt i32 %6, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %11
}
int test2(int b) { return (b & 1) | 1; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test2(i32 %0) {
ret i32 1
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, int);
int shim_membarrier(int cmd, int flags) { return shim_enosys(0, cmd, flags); }


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

x86 assembly (clang, -O2):
<shim_membarrier>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_membarrier(i32 %0, i32 %1) {
%3 = tail call i32 @shim_enosys(i32 0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
scalar_t__ isblank(char);
int get_val(char *buf) {
  while (isblank(*buf)) {
    ++buf;
  }
  if (!*buf) {
    return -1;
  }
  return atoi(buf);
}


x86 assembly (clang, -O0):
<get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
je     1153 <get_val+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <get_val+0xc>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    116c <get_val+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <get_val+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_val>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isblank@plt>
test   %rax,%rax
jne    1130 <get_val+0x10>
cmpb   $0x0,(%rbx)
je     1150 <get_val+0x30>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_val(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isblank(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @atoi(i8* %3)
br label %13
13: ; preds = %8, %11
%14 = phi i32 [ %12, %11 ], [ -1, %8 ]
ret i32 %14
}
const char *hello(void) {}


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

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

LLVM IR (-O0):
define i8* @hello() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @hello() {
ret i8* undef
}
void uninit_iomem() {}


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

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

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

LLVM IR (-O2):
define void @uninit_iomem() {
ret void
}
void display_init(void) {}


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

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

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

LLVM IR (-O2):
define void @display_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_os() { printf("UNKNOWN \n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"UNKNOWN \00"
define void @print_os() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ post(char);
int /*<<< orphan*/ puts(char *);
void live(void) {
  puts("\nYou win!");
  post('!');
  exit(0);
}


x86 assembly (clang, -O0):
<live>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x21,%edi
call   1040 <post@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<live>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x21,%edi
call   1040 <post@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0AYou win!\00"
define void @live() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @post(i8 signext 33)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0AYou win!\00"
define void @live() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @post(i8 signext 33)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int frame_1();
int recursive(int /*<<< orphan*/);
int main(void) {
  int i, j;
  i = frame_1();
  j = recursive(0);
  return i + j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <frame_1@plt>
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1040 <recursive@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <frame_1@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <recursive@plt>
add    %ebx,%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 (...) @frame_1()
store i32 %4, i32* %2
%5 = call i32 @recursive(i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @frame_1()
%2 = tail call i32 @recursive(i32 0)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, unsigned short);
int /*<<< orphan*/ try_outb(unsigned short);
void expect_ok(unsigned short port) {
  if (!try_outb(port)) {
    printf("[FAIL]\toutb to 0x%02hx failed\n", port);
    exit(1);
  }
  printf("[OK]\toutb to 0x%02hx worked\n", port);
}


x86 assembly (clang, -O0):
<expect_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <try_outb@plt>
cmp    $0x0,%eax
jne    116b <expect_ok+0x3b>
lea    0xea8(%rip),%rdi
movzwl -0x2(%rbp),%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xead(%rip),%rdi
movzwl -0x2(%rbp),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_ok>:
push   %rbx
mov    %edi,%ebx
call   1030 <try_outb@plt>
movzwl %bx,%esi
test   %eax,%eax
je     114c <expect_ok+0x1c>
lea    0xed9(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"[FAIL]\09outb to 0x%02hx failed\0A\00"
@.str.1 = [29 x i8] c"[OK]\09outb to 0x%02hx worked\0A\00"
define void @expect_ok(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @try_outb(i16 zeroext %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i16, i16* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i16 zeroext %7)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i16, i16* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %11)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"[FAIL]\09outb to 0x%02hx failed\0A\00"
@.str.1 = [29 x i8] c"[OK]\09outb to 0x%02hx worked\0A\00"
define void @expect_ok(i16 zeroext %0) {
%2 = tail call i32 @try_outb(i16 zeroext %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i16 zeroext %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %0)
ret void
}
int minimum(int a, int b) {
  if (a > b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <minimum+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <minimum+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @minimum(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getafield(int, int);
int inlist(int /*<<< orphan*/, int);
int haspreposition(int act, int preposition) {
  return (inlist(getafield(act, ((int)2)), preposition));
}


x86 assembly (clang, -O0):
<haspreposition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1040 <getafield@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1030 <inlist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<haspreposition>:
push   %rbx
mov    %esi,%ebx
mov    $0x2,%esi
call   1040 <getafield@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <inlist@plt>

LLVM IR (-O0):
define i32 @haspreposition(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 = call i32 @getafield(i32 %5, i32 2)
%7 = load i32, i32* %4
%8 = call i32 @inlist(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @haspreposition(i32 %0, i32 %1) {
%3 = tail call i32 @getafield(i32 %0, i32 2)
%4 = tail call i32 @inlist(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__42__IO__makeInput();
void Msp430Adc12ImplP__Port62__makeInput(void) {
  HplMsp430GeneralIOP__42__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port62__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__42__IO__makeInput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setState(int);
int /*<<< orphan*/ waitForState(int);
void __attribute__((constructor)) myInit() {
  setState(1);
  waitForState(2);
}


x86 assembly (clang, -O0):
<myInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <setState@plt>
mov    $0x2,%edi
call   1040 <waitForState@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myInit>:
push   %rax
mov    $0x1,%edi
call   1030 <setState@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <waitForState@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = call i32 @setState(i32 1)
%2 = call i32 @waitForState(i32 2)
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = tail call i32 @setState(i32 1)
%2 = tail call i32 @waitForState(i32 2)
ret void
}
void strim(char *c) {
  while (*c)
    *c++ &= 0x7F;
}


x86 assembly (clang, -O0):
<strim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1131 <strim+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
and    $0x7f,%ecx
mov    %cl,(%rax)
jmp    1108 <strim+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strim>:
mov    (%rdi),%al
test   %al,%al
je     1120 <strim+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
and    $0x7f,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strim+0x10>
ret

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

LLVM IR (-O2):
define void @strim(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = and i8 %5, 127
store i8 %8, i8* %6
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Init();
int /*<<< orphan*/ LCD_WriteString(char *);
int main() {
  LCD_Init();
  LCD_WriteString("HH:MM:SS");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"HH:MM:SS\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @LCD_Init()
%3 = call i32 @LCD_WriteString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"HH:MM:SS\00"
define i32 @main() {
%1 = tail call i32 (...) @LCD_Init()
%2 = tail call i32 @LCD_WriteString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
void pushStack(char *stack, char c) {
  stack[strlen(stack) + 1] = '\0';
  stack[strlen(stack)] = c;
}


x86 assembly (clang, -O0):
<pushStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
movb   $0x0,0x1(%rax,%rcx,1)
mov    -0x9(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x19(%rbp),%dl
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushStack>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movb   $0x0,0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %bpl,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @pushStack(i8* %0, i8 signext %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** %3
%7 = call i64 @strlen(i8* %6)
%8 = add i64 %7, 1
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
%10 = load i8, i8* %4
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 %10, i8* %14
ret void
}

LLVM IR (-O2):
define void @pushStack(i8* nocapture %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %1, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("Usage  : >samtrial <from # trials> <to # trials> <rng> {<seed>}");
  puts("Example: >samtrial 24 34 4 \"my seed\"");
  puts("(perform 11 trials from 2**24 to 2**34 using MOTE64 on seed \"my "
       "seed\")");
  puts("To change the function (MOD,SAM,LIM) uncomment its #define and "
       "re-compile.");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6d(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf35(%rip),%rdi
call   1030 <puts@plt>
lea    0xf70(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Usage : >samtrial <from # trials> <to # trials> <rng> {<seed>}\00"
@.str.1 = [37 x i8] c"Example: >samtrial 24 34 4 \22my seed\22\00"
@.str.2 = [71 x i8] c"(perform 11 trials from 2**24 to 2**34 using MOTE64 on seed \22my seed\22)\00"
@.str.3 = [75 x i8] c"To change the function (MOD,SAM,LIM) uncomment its #define and re-compile.\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"Usage : >samtrial <from # trials> <to # trials> <rng> {<seed>}\00"
@.str.1 = [37 x i8] c"Example: >samtrial 24 34 4 \22my seed\22\00"
@.str.2 = [71 x i8] c"(perform 11 trials from 2**24 to 2**34 using MOTE64 on seed \22my seed\22)\00"
@.str.3 = [75 x i8] c"To change the function (MOD,SAM,LIM) uncomment its #define and re-compile.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct remove_cmdline_parser_params {
  int dummy;
};
struct remove_args_info {
  int dummy;
};

/* Variables and functions */
int remove_cmdline_parser_internal(int, char **, struct remove_args_info *,
                                   struct remove_cmdline_parser_params *,
                                   int /*<<< orphan*/);
int remove_cmdline_parser_ext(int argc, char **argv,
                              struct remove_args_info *args_info,
                              struct remove_cmdline_parser_params *params) {
  int result;
  result = remove_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<remove_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <remove_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <remove_cmdline_parser_internal@plt>

LLVM IR (-O0):
%struct.remove_args_info = type { i32 }
%struct.remove_cmdline_parser_params = type { i32 }
define i32 @remove_cmdline_parser_ext(i32 %0, i8** %1, %struct.remove_args_info* %2, %struct.remove_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.remove_args_info*
%8 = alloca %struct.remove_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.remove_args_info* %2, %struct.remove_args_info** %7
store %struct.remove_cmdline_parser_params* %3, %struct.remove_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.remove_args_info*, %struct.remove_args_info** %7
%13 = load %struct.remove_cmdline_parser_params*, %struct.remove_cmdline_parser_params** %8
%14 = call i32 @remove_cmdline_parser_internal(i32 %10, i8** %11, %struct.remove_args_info* %12, %struct.remove_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.remove_args_info = type { i32 }
%struct.remove_cmdline_parser_params = type { i32 }
define i32 @remove_cmdline_parser_ext(i32 %0, i8** %1, %struct.remove_args_info* %2, %struct.remove_cmdline_parser_params* %3) {
%5 = tail call i32 @remove_cmdline_parser_internal(i32 %0, i8** %1, %struct.remove_args_info* %2, %struct.remove_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int);
int main() {
  int a = 1, b = 5;
  printf("a++=%d,++b=%d", a++, ++b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
lea    0xeb8(%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
mov    $0x1,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"a++=%d,++b=%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 6)
ret i32 0
}