xunge/DecIR huggingface dataset:
int lib_mod_set_param(struct mod *mod, char *name, char *value) { return 0; }


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

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

LLVM IR (-O0):
%struct.mod = type opaque
define i32 @lib_mod_set_param(%struct.mod* %0, i8* %1, i8* %2) {
%4 = alloca %struct.mod*
%5 = alloca i8*
%6 = alloca i8*
store %struct.mod* %0, %struct.mod** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.mod = type opaque
define i32 @lib_mod_set_param(%struct.mod* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
double pass_double(double arg) { return arg; }


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

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

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

LLVM IR (-O2):
define double @pass_double(double returned %0) {
ret double %0
}
void distanceVector(double *BA, double *A, double *B) {
  BA[0] = B[0] - A[0];
  BA[1] = B[1] - A[1];
  BA[2] = B[2] - A[2];
}


x86 assembly (clang, -O0):
<distanceVector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<distanceVector>:
movsd  (%rdx),%xmm0
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rdx),%xmm0
subsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rdx),%xmm0
subsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @distanceVector(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @distanceVector(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = load double, double* %1
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %2, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %2, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
struct Cyc_List_List *Cyc_Lower_lower(struct Cyc_List_List *);
struct Cyc_List_List *Cyc_do_lower(int ignore, struct Cyc_List_List *tds) {
  struct Cyc_List_List *_T0;
  _T0 = Cyc_Lower_lower(tds);
  return _T0;
}


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

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

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_lower(i32 %0, %struct.Cyc_List_List* %1) {
%3 = alloca i32
%4 = alloca %struct.Cyc_List_List*
%5 = alloca %struct.Cyc_List_List*
store i32 %0, i32* %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%7 = call %struct.Cyc_List_List* @Cyc_Lower_lower(%struct.Cyc_List_List* %6)
store %struct.Cyc_List_List* %7, %struct.Cyc_List_List** %5
%8 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
ret %struct.Cyc_List_List* %8
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_lower(i32 %0, %struct.Cyc_List_List* %1) {
%3 = tail call %struct.Cyc_List_List* @Cyc_Lower_lower(%struct.Cyc_List_List* %1)
ret %struct.Cyc_List_List* %3
}
/* Variables and functions */
int /*<<< orphan*/ syntax_error(char const *);
void syntax_check(int r, const char *reason) {
  if (!r) {
    syntax_error(reason);
  }
}


x86 assembly (clang, -O0):
<syntax_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <syntax_check+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <syntax_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syntax_check>:
test   %edi,%edi
je     1115 <syntax_check+0x5>
ret
mov    %rsi,%rdi
jmp    1030 <syntax_error@plt>

LLVM IR (-O0):
define void @syntax_check(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @syntax_error(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @syntax_check(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @syntax_error(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
void __l2_flush_invalidate_region(void *start, int size) {}


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

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

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

LLVM IR (-O2):
define void @__l2_flush_invalidate_region(i8* nocapture %0, i32 %1) {
ret void
}
int fun147() { return 147; }


x86 assembly (clang, -O0):
<fun147>:
push   %rbp
mov    %rsp,%rbp
mov    $0x93,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun147() {
ret i32 147
}

LLVM IR (-O2):
define i32 @fun147() {
ret i32 147
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long foo(long a, long b, long c) {
  if (a != 12 || b != 1 || c != 11)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0xc,-0x8(%rbp)
jne    1145 <foo+0x35>
cmpq   $0x1,-0x10(%rbp)
jne    1145 <foo+0x35>
cmpq   $0xb,-0x18(%rbp)
je     114c <foo+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0xc,%rdi
jne    1125 <foo+0x15>
cmp    $0x1,%rsi
jne    1125 <foo+0x15>
cmp    $0xb,%rdx
jne    1125 <foo+0x15>
xor    %eax,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1, i64 %2) {
%4 = icmp ne i64 %0, 12
%5 = icmp ne i64 %1, 1
%6 = or i1 %4, %5
%7 = icmp ne i64 %2, 11
%8 = or i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %3
ret i64 0
}
void impl_call_fin(int nargs) { (void)nargs; }


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

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

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

LLVM IR (-O2):
define void @impl_call_fin(i32 %0) {
ret void
}
/* Type definitions */
struct pt_encoder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pt_encoder *);
int /*<<< orphan*/ pt_encoder_fini(struct pt_encoder *);
void pt_free_encoder(struct pt_encoder *encoder) {
  pt_encoder_fini(encoder);
  free(encoder);
}


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

x86 assembly (clang, -O2):
<pt_free_encoder>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pt_encoder_fini@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.pt_encoder = type { i32 }
define void @pt_free_encoder(%struct.pt_encoder* %0) {
%2 = alloca %struct.pt_encoder*
store %struct.pt_encoder* %0, %struct.pt_encoder** %2
%3 = load %struct.pt_encoder*, %struct.pt_encoder** %2
%4 = call i32 @pt_encoder_fini(%struct.pt_encoder* %3)
%5 = load %struct.pt_encoder*, %struct.pt_encoder** %2
%6 = call i32 @free(%struct.pt_encoder* %5)
ret void
}

LLVM IR (-O2):
%struct.pt_encoder = type { i32 }
define void @pt_free_encoder(%struct.pt_encoder* %0) {
%2 = tail call i32 @pt_encoder_fini(%struct.pt_encoder* %0)
%3 = tail call i32 @free(%struct.pt_encoder* %0)
ret void
}
/* Variables and functions */
int randomInteger(int, int);
int rollDie(void) { return (randomInteger(1, 6)); }


x86 assembly (clang, -O0):
<rollDie>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <randomInteger@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rollDie>:
mov    $0x1,%edi
mov    $0x6,%esi
jmp    1030 <randomInteger@plt>

LLVM IR (-O0):
define i32 @rollDie() {
%1 = call i32 @randomInteger(i32 1, i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @rollDie() {
%1 = tail call i32 @randomInteger(i32 1, i32 6)
ret i32 %1
}
void dbgls_output(int output_type, void *param) {
  (void)output_type;
  (void)param;
}


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

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

LLVM IR (-O0):
define void @dbgls_output(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
ret void
}

LLVM IR (-O2):
define void @dbgls_output(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *timlib_ora_date_to_yyyy_mm_dd(char *);
char *timlib_oracle_date2mysql_date_string(char *s) {
  return timlib_ora_date_to_yyyy_mm_dd(s);
}


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

x86 assembly (clang, -O2):
<timlib_oracle_date2mysql_date_string>:
jmp    1030 <timlib_ora_date_to_yyyy_mm_dd@plt>

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

LLVM IR (-O2):
define i8* @timlib_oracle_date2mysql_date_string(i8* %0) {
%2 = tail call i8* @timlib_ora_date_to_yyyy_mm_dd(i8* %0)
ret i8* %2
}
int cpufreq_table_thermal_update(int freq, int vdd_arm) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpufreq_table_thermal_update(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr,
          "Usage: %s [-num | -n num] [-f file] "
          "[-t YYYYMMDDHHMMSS] "
          "[-R] [-adioxFw] [username..] [tty..]\n",
          s);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [94 x i8] c"Usage: %s [-num | -n num] [-f file] [-t YYYYMMDDHHMMSS] [-R] [-adioxFw] [username..] [tty..]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"Usage: %s [-num | -n num] [-f file] [-t YYYYMMDDHHMMSS] [-R] [-adioxFw] [username..] [tty..]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ A_NORMAL;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *, char *);
int /*<<< orphan*/ refresh();
void io_print(int x, int y, char *s, int color) {
  attron(COLOR_PAIR(color));
  mvprintw(y, x, "%s", s);
  refresh();
  attrset(A_NORMAL);
}


x86 assembly (clang, -O0):
<io_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attron@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xe7b(%rip),%rdx
call   1070 <mvprintw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <attrset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_print>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    %ecx,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attron@plt>
lea    0xe90(%rip),%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rcx
call   1070 <mvprintw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <attrset@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@A_NORMAL = global i32 0
define void @io_print(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = call i32 @COLOR_PAIR(i32 %9)
%11 = call i32 @attron(i32 %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = load i8*, i8** %7
%15 = call i32 @mvprintw(i32 %12, i32 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i32 (...) @refresh()
%17 = load i32, i32* @A_NORMAL
%18 = call i32 @attrset(i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@A_NORMAL = global i32 0
define void @io_print(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @COLOR_PAIR(i32 %3)
%6 = tail call i32 @attron(i32 %5)
%7 = tail call i32 @mvprintw(i32 %1, i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = tail call i32 (...) @refresh()
%9 = load i32, i32* @A_NORMAL
%10 = tail call i32 @attrset(i32 %9)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ scanf(char *, int *, int *, int *, int *);
void Input(int *btnMode, int *btnNext, int *btnRotate, int *pulse100ms) {
  if (scanf("%d %d %d %d", btnMode, btnNext, btnRotate, pulse100ms) == EOF) {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<Input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xeb1(%rip),%rdi
call   1030 <scanf@plt>
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
jne    116b <Input+0x4b>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Input>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xecc(%rip),%rdi
call   1030 <scanf@plt>
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%rax
je     1147 <Input+0x27>
pop    %rax
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %d\00"
@EOF = global i64 0
define void @Input(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@EOF = global i64 0
define void @Input(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1, i32* %2, i32* %3)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %4
ret void
}
const char *mg_version(void) { return ("2.9"); }


x86 assembly (clang, -O0):
<mg_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"2.9\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"2.9\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
unsigned long _hash_value(const char *key, unsigned long bucket_size) {
  unsigned long sum = 0;
  for (int i = 0; key[i] != 0; ++i)
    sum += key[i];
  return sum % bucket_size;
}


x86 assembly (clang, -O0):
<_hash_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <_hash_value+0x53>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <_hash_value+0x1b>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_value>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <_hash_value+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_hash_value+0x10>
jmp    1126 <_hash_value+0x26>
xor    %eax,%eax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     113b <_hash_value+0x3b>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @_hash_value(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %8, %2
%6 = phi i64 [ 0, %2 ], [ %13, %8 ]
%7 = urem i64 %6, %1
ret i64 %7
8: ; preds = %2, %8
%9 = phi i64 [ %14, %8 ], [ 0, %2 ]
%10 = phi i8 [ %16, %8 ], [ %3, %2 ]
%11 = phi i64 [ %13, %8 ], [ 0, %2 ]
%12 = sext i8 %10 to i64
%13 = add i64 %11, %12
%14 = add nuw nsw i64 %9, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %5, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i = 0;
  while (i < 10000000) {
    printf("hello\n");
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    114d <main+0x3d>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x989680,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 10000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int smtp_sendDataRequest(int socket) { write(socket, "DATA\r\n", 6); }


x86 assembly (clang, -O0):
<smtp_sendDataRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_sendDataRequest>:
lea    0xee9(%rip),%rsi
mov    $0x6,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"DATA\0D\0A\00"
define i32 @smtp_sendDataRequest(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 undef
}
int transformY(int x, int y, int transformationNo) {
  if (transformationNo == 1) {
    return y;
  } else if (transformationNo == 2) {
    return -y;
  } else if (transformationNo == 3) {
    return x;
  }
}


x86 assembly (clang, -O0):
<transformY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1122 <transformY+0x22>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <transformY+0x58>
cmpl   $0x2,-0x10(%rbp)
jne    1139 <transformY+0x39>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <transformY+0x58>
cmpl   $0x3,-0x10(%rbp)
jne    114e <transformY+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <transformY+0x58>
jmp    1153 <transformY+0x53>
jmp    1158 <transformY+0x58>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transformY>:
cmp    $0x3,%edx
je     110f <transformY+0xf>
cmp    $0x2,%edx
jne    1112 <transformY+0x12>
neg    %esi
mov    %esi,%eax
ret
mov    %edi,%eax
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @transformY(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %7 [
i32 3, label %6
i32 2, label %4
]
4: ; preds = %3
%5 = sub nsw i32 0, %1
br label %7
6: ; preds = %3
br label %7
7: ; preds = %3, %4, %6
%8 = phi i32 [ %5, %4 ], [ %0, %6 ], [ %1, %3 ]
ret i32 %8
}
int tick_resume_broadcast_oneshot(struct clock_event_device *bc) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.clock_event_device = type opaque
define i32 @tick_resume_broadcast_oneshot(%struct.clock_event_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int _roll(int);
int dicebag_roll(int sides) {
  int value = 0;
  if (sides > 0)
    value = _roll(sides) + 1;
  return value;
}


x86 assembly (clang, -O0):
<dicebag_roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113a <dicebag_roll+0x2a>
mov    -0x4(%rbp),%edi
call   1030 <_roll@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dicebag_roll>:
test   %edi,%edi
jle    1122 <dicebag_roll+0x12>
push   %rax
call   1030 <_roll@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dicebag_roll(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @_roll(i32 %0)
%5 = add nsw i32 %4, 1
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ gpt_main(int, char **);
int main(int argc, char *argv[]) {
  if (!gpt_main(argc, argv)) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gpt_main@plt>
cmp    $0x0,%eax
jne    114c <main+0x3c>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <main+0x48>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gpt_main@plt>
test   %eax,%eax
jne    1123 <main+0x13>
mov    0x2ebf(%rip),%rax
jmp    112a <main+0x1a>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gpt_main(i32 %6, i8** %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* @EXIT_SUCCESS
store i32 %13, i32* %3
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gpt_main(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *s) {
  int i;
  if (s == NULL)
    return;
  i = -1;
  while (s[++i] != '\0')
    ft_putchar(s[i]);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_putstr+0x1c>
jmp    1166 <ft_putstr+0x56>
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1166 <ft_putstr+0x56>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1133 <ft_putstr+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putstr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putstr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8 [ %12, %6 ], [ %4, %3 ]
%9 = tail call i32 @ft_putchar(i8 signext %8)
%10 = add nuw i64 %7, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void msFree(void *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<msFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <msFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @msFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @msFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
fatal(str) char *str;
{ printf("\nFatal: %s\n", str); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0AFatal: %s\0A\00"
define i32 @fatal(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void openShop(void) {
  void getInformation(void);
  puts("So let's open a shop to sale sword");
  puts("Please enter a some information\n");
  getInformation();
  puts("\nSo open shop success\nbut my memory is not good\n");
}


x86 assembly (clang, -O0):
<openShop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
call   1040 <getInformation@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<openShop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
call   1040 <getInformation@plt>
lea    0xeff(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"So let's open a shop to sale sword\00"
@.str.1 = [33 x i8] c"Please enter a some information\0A\00"
@.str.2 = [49 x i8] c"\0ASo open shop success\0Abut my memory is not good\0A\00"
define void @openShop() {
%1 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"So let's open a shop to sale sword\00"
@.str.1 = [33 x i8] c"Please enter a some information\0A\00"
@.str.2 = [49 x i8] c"\0ASo open shop success\0Abut my memory is not good\0A\00"
define void @openShop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
tail call void @getInformation()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void request_keypress(void) {
  printf("\nFeel free to report bug or just say thx: niklmate@fit.cvut.cz\n");
  printf("timetable_creator  Copyright (C) 2013  Matěj Nikl\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"\0AFeel free to report bug or just say thx: niklmate@fit.cvut.cz\0A\00"
@.str.1 = [52 x i8] c"timetable_creator Copyright (C) 2013 Mat\C4\9Bj Nikl\0A\00"
define void @request_keypress() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"\0AFeel free to report bug or just say thx: niklmate@fit.cvut.cz\00"
@str.2 = [51 x i8] c"timetable_creator Copyright (C) 2013 Mat\C4\9Bj Nikl\00"
define void @request_keypress() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void halt(char *s) {
  printf("Execution halted: %s\n", s);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"Execution halted: %s\0A\00"
define void @halt(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int cmpInt(void *P1, void *P2) { return *(int *)P1 == *(int *)P2; }


x86 assembly (clang, -O0):
<cmpInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpInt>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @cmpInt(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmpInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void test1() {
  (void)(0 && "foo");
  ;
  (void)("foo" && 0);
  ;
  (void)(0 || "foo");
  ;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    $0x1,%cl
test   $0x1,%cl
mov    %al,-0x1(%rbp)
jne    1119 <test1+0x19>
jmp    1123 <test1+0x23>
xor    %eax,%eax
mov    %al,-0x1(%rbp)
jmp    1123 <test1+0x23>
mov    -0x1(%rbp),%al
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define void @test1() {
br i1 true, label %1, label %2
1: ; preds = %0
br label %2
2: ; preds = %1, %0
%3 = phi i1 [ false, %0 ], [ false, %1 ]
%4 = zext i1 %3 to i32
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
char *sbrk(i) { return ((char *)0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @sbrk(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void snail_cnt_reset(void) {
  mbus_remote_register_write(0x3, 0x01, ((0 << 5) | (0 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<snail_cnt_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x9,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snail_cnt_reset>:
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x9,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @snail_cnt_reset() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
define void @snail_cnt_reset() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 1, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char *);
int /*<<< orphan*/ strcmp(char const *, char *);
int is_help_option(const char *arg) {
  return !strcmp(arg, "-?") || !strcasecmp(arg, "--help");
}


x86 assembly (clang, -O0):
<is_help_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1167 <is_help_option+0x47>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_help_option>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     114e <is_help_option+0x2e>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-?\00"
@.str.1 = [7 x i8] c"--help\00"
define i32 @is_help_option(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strcasecmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"-?\00"
@.str.1 = [7 x i8] c"--help\00"
define i32 @is_help_option(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int isinf(double);
int my_isinf(double x) { return isinf(x); }


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

x86 assembly (clang, -O2):
<my_isinf>:
jmp    1030 <isinf@plt>

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

LLVM IR (-O2):
define i32 @my_isinf(double %0) {
%2 = tail call i32 @isinf(double %0)
ret i32 %2
}
int _ipa_read_gen_reg_v2_0(char *buff, int max_len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_ipa_read_gen_reg_v2_0(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}