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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_log(FILE *fd) { fclose(fd); }


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

x86 assembly (clang, -O2):
<close_log>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @close_log(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
double math_acosh(int);
double math_asech(double x) { return math_acosh(1 / x); }


x86 assembly (clang, -O0):
<math_asech>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <math_acosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_asech>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <math_acosh@plt>

LLVM IR (-O0):
define double @math_asech(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @math_acosh(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @math_asech(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @math_acosh(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ _assert_true(unsigned long long, char *, char *, int);
int /*<<< orphan*/ free(void *);
void free_value(const void *value, void *cleanup_value_data) {
  _assert_true(((unsigned long long)((value))), "value",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/0x0FFF/gpdb/refs/heads/"
               "master/src/test/unit/cmockery/cmockery.c",
               499);
  free((void *)value);
}


x86 assembly (clang, -O0):
<free_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x1f3,%ecx
call   1040 <_assert_true@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_value>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0x1f3,%ecx
call   1040 <_assert_true@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"value\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0x0FFF/gpdb/refs/heads/master/src/test/unit/cmockery/cmockery.c\00"
define void @free_value(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 = ptrtoint i8* %5 to i64
%7 = call i32 @_assert_true(i64 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 499)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"value\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0x0FFF/gpdb/refs/heads/master/src/test/unit/cmockery/cmockery.c\00"
define void @free_value(i8* %0, i8* nocapture readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @_assert_true(i64 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 499)
%5 = tail call i32 @free(i8* %0)
ret void
}
int vifm_system(char command[]) {
  {
    log_prefix("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/jubalh/vifm/refs/heads/"
               "master/src/utils/utils.c",
               __FUNCTION__, 66);
    log_vifm_state();
    log_msg(("Shell command: %s"), command);
  };
  return run_in_shell_no_cls(command);
}


x86 assembly (clang, -O0):
<vifm_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
lea    0xf30(%rip),%rsi
mov    $0x42,%edx
mov    $0x0,%al
call   1030 <log_prefix@plt>
mov    $0x0,%al
call   1050 <log_vifm_state@plt>
mov    -0x8(%rbp),%rsi
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1060 <log_msg@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <run_in_shell_no_cls@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vifm_system>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
lea    0xf38(%rip),%rsi
mov    $0x42,%edx
xor    %eax,%eax
call   1030 <log_prefix@plt>
xor    %eax,%eax
call   1050 <log_vifm_state@plt>
lea    0xf2a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <log_msg@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <run_in_shell_no_cls@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jubalh/vifm/refs/heads/master/src/utils/utils.c\00"
@__FUNCTION__.vifm_system = [12 x i8] c"vifm_system\00"
@.str.1 = [18 x i8] c"Shell command: %s\00"
define i32 @vifm_system(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.vifm_system, i64 0, i64 0), i32 66)
%4 = call i32 (...) @log_vifm_state()
%5 = load i8*, i8** %2
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @run_in_shell_no_cls to i32 (i8*, ...)*)(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jubalh/vifm/refs/heads/master/src/utils/utils.c\00"
@__FUNCTION__.vifm_system = [12 x i8] c"vifm_system\00"
@.str.1 = [18 x i8] c"Shell command: %s\00"
define i32 @vifm_system(i8* %0) {
%2 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.vifm_system, i64 0, i64 0), i32 66)
%3 = tail call i32 (...) @log_vifm_state()
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @run_in_shell_no_cls to i32 (i8*, ...)*)(i8* %0)
ret i32 %5
}
unsigned int lo_dword(unsigned long long Q) { return (unsigned int)Q; }


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

x86 assembly (clang, -O2):
<lo_dword>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @lo_dword(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int core5_swap(char *, int);
int U_EMRBEGINPATH_swap(char *record, int torev) {
  return (core5_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRBEGINPATH_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRBEGINPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int remove(char const *);
__attribute__((__weak__, __always___)) int
softboundmpx_remove(const char *pathname) {
  return remove(pathname);
}


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

x86 assembly (clang, -O2):
<softboundmpx_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_remove(i8* %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int conn_write(int /*<<< orphan*/ *, char const *, int);
int strlen(char const *);
int conn_puts(BIO *bp, const char *str) {
  int n, ret;
  n = strlen(str);
  ret = conn_write(bp, str, n);
  return (ret);
}


x86 assembly (clang, -O0):
<conn_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <conn_write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @conn_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @conn_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int menu_exists(char *path) {
  struct stat buffer;
  return (stat(path, &buffer) == 0);
}


x86 assembly (clang, -O0):
<menu_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @menu_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @menu_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
double ftent(double x, double r) {
  return ((x <= 0.5) ? 2.0 * r * x : 2 * r * (1.0 - x));
}


x86 assembly (clang, -O0):
<ftent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     113d <ftent+0x3d>
movsd  0xee7(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1160 <ftent+0x60>
movsd  0xecb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftent>:
addsd  %xmm1,%xmm1
movsd  0xef4(%rip),%xmm3
subsd  %xmm0,%xmm3
movapd %xmm0,%xmm2
cmpnlesd 0xeeb(%rip),%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ftent(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp ole double %5, 5.000000e-01
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load double, double* %4
%9 = fmul double 2.000000e+00, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
br label %18
12: ; preds = %2
%13 = load double, double* %4
%14 = fmul double 2.000000e+00, %13
%15 = load double, double* %3
%16 = fsub double 1.000000e+00, %15
%17 = fmul double %14, %16
br label %18
18: ; preds = %12, %7
%19 = phi double [ %11, %7 ], [ %17, %12 ]
ret double %19
}

LLVM IR (-O2):
define double @ftent(double %0, double %1) {
%3 = fcmp ugt double %0, 5.000000e-01
%4 = fmul double %1, 2.000000e+00
%5 = fsub double 1.000000e+00, %0
%6 = select i1 %3, double %5, double %0
%7 = fmul double %4, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ print_message();
int main(void) {
  print_message();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_message()
ret i32 0
}
int link_free(struct STU *head) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.STU = type opaque
define i32 @link_free(%struct.STU* nocapture readnone %0) {
ret i32 0
}
void convertNumber(unsigned char *p, unsigned long val) {
  *(p + 0) = val >> 24;
  *(p + 1) = val >> 16;
  *(p + 2) = val >> 8;
  *(p + 3) = val >> 0;
}


x86 assembly (clang, -O0):
<convertNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x0,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertNumber>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @convertNumber(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = lshr i64 %5, 24
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 16
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i64, i64* %4
%16 = lshr i64 %15, 8
%17 = trunc i64 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i64, i64* %4
%21 = lshr i64 %20, 0
%22 = trunc i64 %21 to i8
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 3
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @convertNumber(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = lshr i64 %1, 16
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %1, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i64 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
__attribute__((no)) int level3(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<level3>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @level3(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
float get_percentagei(int start, int end, int mid) {
  return (float)(mid - start) / (float)(end - start);
}


x86 assembly (clang, -O0):
<get_percentagei>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_percentagei>:
sub    %edi,%edx
cvtsi2ss %edx,%xmm0
sub    %edi,%esi
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @get_percentagei(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
%14 = sitofp i32 %13 to float
%15 = fdiv float %10, %14
ret float %15
}

LLVM IR (-O2):
define float @get_percentagei(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %0
%5 = sitofp i32 %4 to float
%6 = sub nsw i32 %1, %0
%7 = sitofp i32 %6 to float
%8 = fdiv float %5, %7
ret float %8
}
/* Variables and functions */
int ordinary_hello();
int withdep_hello(void) { return ordinary_hello() + 1; }


x86 assembly (clang, -O0):
<withdep_hello>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ordinary_hello@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<withdep_hello>:
push   %rax
xor    %eax,%eax
call   1030 <ordinary_hello@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @withdep_hello() {
%1 = call i32 (...) @ordinary_hello()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @withdep_hello() {
%1 = tail call i32 (...) @ordinary_hello()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ TCODE_LOCK_BOUNDED_ADD;
int /*<<< orphan*/ do_lock_request(int /*<<< orphan*/);
void do_bounded_add(void) { do_lock_request(TCODE_LOCK_BOUNDED_ADD); }


x86 assembly (clang, -O0):
<do_bounded_add>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <do_lock_request@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_bounded_add>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <do_lock_request@plt>

LLVM IR (-O0):
@TCODE_LOCK_BOUNDED_ADD = global i32 0
define void @do_bounded_add() {
%1 = load i32, i32* @TCODE_LOCK_BOUNDED_ADD
%2 = call i32 @do_lock_request(i32 %1)
ret void
}

LLVM IR (-O2):
@TCODE_LOCK_BOUNDED_ADD = global i32 0
define void @do_bounded_add() {
%1 = load i32, i32* @TCODE_LOCK_BOUNDED_ADD
%2 = tail call i32 @do_lock_request(i32 %1)
ret void
}
int test_imm_F0uint8_reg(unsigned char val) {
  return ((val) & (0xF0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F0uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xf0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F0uint8_reg>:
cmp    $0x10,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F0uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 240
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F0uint8_reg(i8 zeroext %0) {
%2 = icmp ult i8 %0, 16
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  int /*<<< orphan*/ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void test_sleep(unsigned int sec) {
  struct timespec ts = {.tv_sec = sec, .tv_nsec = 0};
  assert(nanosleep(&ts, NULL) == 0);
}


x86 assembly (clang, -O0):
<test_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sleep>:
push   %rax
mov    %edi,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @test_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 0, i32* %6
%7 = call i64 @nanosleep(%struct.timespec* %3, i32* null)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @test_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 0, i32* %5
%6 = call i64 @nanosleep(%struct.timespec* %2, i32* null)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main() {
  char first_name[20];
  char last_name[20];
  printf("Enter first and last name: ");
  scanf("%19s %19s", first_name, last_name);
  printf("First: %s Last: %s\n", first_name, last_name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    0xed0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter first and last name: \00"
@.str.1 = [10 x i8] c"%19s %19s\00"
@.str.2 = [20 x i8] c"First: %s Last: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter first and last name: \00"
@.str.1 = [10 x i8] c"%19s %19s\00"
@.str.2 = [20 x i8] c"First: %s Last: %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}
void missing() {}


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

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

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

LLVM IR (-O2):
define void @missing() {
ret void
}
double f4_get_double() {
  double r = 66.0;
  return r;
}


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

x86 assembly (clang, -O2):
<f4_get_double>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f4_get_double() {
%1 = alloca double
store double 6.600000e+01, double* %1
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @f4_get_double() {
ret double 6.600000e+01
}
int dev_to_node(struct device *dev) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dev_to_node(%struct.device* nocapture readnone %0) {
ret i32 -1
}
char const *get_string(int stringNum) {
  if (stringNum == 1) {
    return "Bitz";
  } else {
    return "Nothing";
  }
}


x86 assembly (clang, -O0):
<get_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1121 <get_string+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <get_string+0x2c>
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string>:
cmp    $0x1,%edi
lea    0xef6(%rip),%rcx
lea    0xef4(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Bitz\00"
@.str.1 = [8 x i8] c"Nothing\00"
define i8* @get_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"Bitz\00"
@.str.1 = [8 x i8] c"Nothing\00"
define i8* @get_string(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct sched_param {
  int sched_priority;
};
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int /*<<< orphan*/ SCHED_FIFO;
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int sched_setscheduler(long, int /*<<< orphan*/, struct sched_param *);
long syscall(int /*<<< orphan*/);
int set_realtime_priority(int level) {
  long tid = syscall(SYS_gettid);
  struct sched_param sa;
  memset(&sa, 0, sizeof(sa));
  sa.sched_priority = level;
  return sched_setscheduler(tid, SCHED_FIFO, &sa);
}


x86 assembly (clang, -O0):
<set_realtime_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1050 <syscall@plt>
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_realtime_priority>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1050 <syscall@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebp,0x8(%rsp)
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SYS_gettid = global i32 0
@SCHED_FIFO = global i32 0
define i32 @set_realtime_priority(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca %struct.sched_param
store i32 %0, i32* %2
%5 = load i32, i32* @SYS_gettid
%6 = call i64 @syscall(i32 %5)
store i64 %6, i64* %3
%7 = call i32 @memset(%struct.sched_param* %4, i32 0, i32 4)
%8 = load i32, i32* %2
%9 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %4, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i64, i64* %3
%11 = load i32, i32* @SCHED_FIFO
%12 = call i32 @sched_setscheduler(i64 %10, i32 %11, %struct.sched_param* %4)
ret i32 %12
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SYS_gettid = global i32 0
@SCHED_FIFO = global i32 0
define i32 @set_realtime_priority(i32 %0) {
%2 = alloca %struct.sched_param
%3 = load i32, i32* @SYS_gettid
%4 = tail call i64 @syscall(i32 %3)
%5 = bitcast %struct.sched_param* %2 to i8*
%6 = call i32 @memset(%struct.sched_param* %2, i32 0, i32 4)
%7 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %2, i64 0, i32 0
store i32 %0, i32* %7
%8 = load i32, i32* @SCHED_FIFO
%9 = call i32 @sched_setscheduler(i64 %4, i32 %8, %struct.sched_param* %2)
ret i32 %9
}
/* Variables and functions */
int regmatchInsensitive(char *, char *);
int iswaittime(char *string) {
  return regmatchInsensitive(string, "^waittime=");
}


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

x86 assembly (clang, -O2):
<iswaittime>:
lea    0xee9(%rip),%rsi
jmp    1030 <regmatchInsensitive@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"^waittime=\00"
define i32 @iswaittime(i8* %0) {
%2 = tail call i32 @regmatchInsensitive(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ kputch(int /*<<< orphan*/);
void kputs(char *s) {
  while (*s) {
    kputch(*s++);
  }
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <kputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <kputch@plt>
jmp    111c <kputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <kputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <kputch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <kputs+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @kputs(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 %13
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 = call i32 @kputch(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @kputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @kputch(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 10, y = 10;
  if (y > x)
    printf("y: %d is greater than x: %d", y, x);
  else if (y >= x)
    printf("y: %d is equal x: %d", y, x);
  else
    printf("comparison is false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1152 <main+0x42>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x7a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1177 <main+0x67>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1185 <main+0x75>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x7a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"y: %d is greater than x: %d\00"
@.str.1 = [21 x i8] c"y: %d is equal x: %d\00"
@.str.2 = [20 x i8] c"comparison is false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %22
11: ; preds = %0
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17)
br label %21
19: ; preds = %11
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
br label %22
22: ; preds = %21, %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"y: %d is equal x: %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 10)
ret i32 0
}
int mul(int x, int y) { return (x * y); }


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

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

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

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
void *realloc(void *, size_t);
void *kp_reallocv(void *block, size_t osize, size_t nsize) {
  return realloc(block, nsize);
}


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

x86 assembly (clang, -O2):
<kp_reallocv>:
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @kp_reallocv(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @kp_reallocv(i8* nocapture %0, i64 %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32r2(uint32_t x) { return (x >> 2) | (x << 30); }


x86 assembly (clang, -O0):
<rot32r2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1e,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32r2>:
mov    %edi,%eax
sar    $0x2,%eax
shl    $0x1e,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32r2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 2
%5 = load i32, i32* %2
%6 = shl i32 %5, 30
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32r2(i32 %0) {
%2 = ashr i32 %0, 2
%3 = shl i32 %0, 30
%4 = or i32 %2, %3
ret i32 %4
}
XConfigureWindow() {}


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

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

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

LLVM IR (-O2):
define i32 @XConfigureWindow() {
ret i32 undef
}
int int_equal(const void *v1, const void *v2) {
  return *(const unsigned *)v1 == *(const unsigned *)v2;
}


x86 assembly (clang, -O0):
<int_equal>:
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):
<int_equal>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @int_equal(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 @int_equal(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
}
int add_one(int i) { return ++i; }


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

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

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

LLVM IR (-O2):
define i32 @add_one(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
char *addColor(char *, char *);
char *bgMagenta(char *str) { return addColor("45", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"45\00"
define i8* @bgMagenta(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
int sfe_ipv6_create_rule(struct sfe_connection_create *sic) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.sfe_connection_create = type opaque
define i32 @sfe_ipv6_create_rule(%struct.sfe_connection_create* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned ZBUFFv04_isError(size_t errorCode) { return ERR_isError(errorCode); }


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

x86 assembly (clang, -O2):
<ZBUFFv04_isError>:
jmp    1030 <ERR_isError@plt>

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

LLVM IR (-O2):
define i32 @ZBUFFv04_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
void hdl(int sig, siginfo_t *siginfo, void *context) {}


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

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

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

LLVM IR (-O2):
define void @hdl(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cgiMakeFileEntry(char *name) {
  printf("<INPUT TYPE=FILE NAME=\"%s\">", name);
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"<INPUT TYPE=FILE NAME=\22%s\22>\00"
define void @cgiMakeFileEntry(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m34setParams7FFF(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m34setRAM(int /*<<< orphan*/, int /*<<< orphan*/);
void m34setParams7FFF_RAM(uint16_t addr, uint8_t val) {
  m34setRAM(addr, val);
  m34setParams7FFF(addr, val);
}


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

x86 assembly (clang, -O2):
<m34setParams7FFF_RAM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <m34setRAM@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <m34setParams7FFF@plt>

LLVM IR (-O0):
define void @m34setParams7FFF_RAM(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 @m34setRAM(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @m34setParams7FFF(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @m34setParams7FFF_RAM(i32 %0, i32 %1) {
%3 = tail call i32 @m34setRAM(i32 %0, i32 %1)
%4 = tail call i32 @m34setParams7FFF(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void end(void) { printf("Koncim!\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Koncim!\00"
define void @end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}