xunge/DecIR huggingface dataset:
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/lib/precore_c.h",
                        283));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11b,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11b,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/lib/precore_c.h\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 283)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/lib/precore_c.h\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 283)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
dan(char a) { printf("B: %c\n", a); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"B: %c\0A\00"
define i32 @dan(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret i32 undef
}
int base64_decoded_len(int len) { return ((len + 3) / 4) * 3; }


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

x86 assembly (clang, -O2):
<base64_decoded_len>:
lea    0x3(%rdi),%eax
add    $0x6,%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x2,%edi
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @base64_decoded_len(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = sdiv i32 %2, 4
%4 = mul nsw i32 %3, 3
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
float timeused(const struct timeval ts, const struct timeval te) {
  return (float)(1000000 * (te.tv_sec - ts.tv_sec) + te.tv_usec - ts.tv_usec) /
         1000000.0f;
}


x86 assembly (clang, -O0):
<timeused>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %edx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
cltq
add    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
movss  0xecb(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeused>:
sub    %edi,%edx
imul   $0xf4240,%edx,%eax
cltq
sub    %rsi,%rcx
add    %rax,%rcx
cvtsi2ss %rcx,%xmm0
divss  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define float @timeused(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { i32, i64 }*
%8 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { i32, i64 }*
%11 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 0
store i32 %2, i32* %11
%12 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = mul nsw i32 1000000, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%21 = load i64, i64* %20
%22 = add nsw i64 %19, %21
%23 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%24 = load i64, i64* %23
%25 = sub nsw i64 %22, %24
%26 = sitofp i64 %25 to float
%27 = fdiv float %26, 1.000000e+06
ret float %27
}

LLVM IR (-O2):
define float @timeused(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = sub nsw i32 %2, %0
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = sub i64 %3, %1
%9 = add i64 %8, %7
%10 = sitofp i64 %9 to float
%11 = fdiv float %10, 1.000000e+06
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stderr;
void print_usage(const char *const argv_0) {
  fprintf(
      stderr,
      "usage: %s\n"
      "\t -r Run a sample long-running rotation operation\n"
      "\t    (note: for now the provided -r option tests only performance but "
      "not correctness.)\n"
      "\t -t tests/default\tRun all tests in the testfile tests/default\n"
      "\t -n 1 -t tests/default\tRun test 1 in the testfile tests/default\n",
      argv_0);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [277 x i8] c"usage: %s\0A\09 -r Run a sample long-running rotation operation\0A\09 (note: for now the provided -r option tests only performance but not correctness.)\0A\09 -t tests/default\09Run all tests in the testfile tests/default\0A\09 -n 1 -t tests/default\09Run test 1 in the testfile tests/default\0A\00"
define void @print_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 ([277 x i8], [277 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [277 x i8] c"usage: %s\0A\09 -r Run a sample long-running rotation operation\0A\09 (note: for now the provided -r option tests only performance but not correctness.)\0A\09 -t tests/default\09Run all tests in the testfile tests/default\0A\09 -n 1 -t tests/default\09Run test 1 in the testfile tests/default\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([277 x i8], [277 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sensor_tsc_init();
int /*<<< orphan*/ sensor_vectors_init();
void sensor_init(void) {
  sensor_vectors_init();
  sensor_tsc_init();
}


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

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

LLVM IR (-O0):
define void @sensor_init() {
%1 = call i32 (...) @sensor_vectors_init()
%2 = call i32 (...) @sensor_tsc_init()
ret void
}

LLVM IR (-O2):
define void @sensor_init() {
%1 = tail call i32 (...) @sensor_vectors_init()
%2 = tail call i32 (...) @sensor_tsc_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void url_html(char *g) { printf("<A HREF=\"%s\">%s</A>", g, g); }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"<A HREF=\22%s\22>%s</A>\00"
define void @url_html(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int pow(float, int);
float tres(float AF) { return ((4 * 3.14 * pow(AF, 3)) / 3); }


x86 assembly (clang, -O0):
<tres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tres>:
push   %rax
mov    $0x3,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed6(%rip),%xmm0
divsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tres(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @pow(float %3, i32 3)
%5 = sitofp i32 %4 to double
%6 = fmul double 1.256000e+01, %5
%7 = fdiv double %6, 3.000000e+00
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @tres(float %0) {
%2 = tail call i32 @pow(float %0, i32 3)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 1.256000e+01
%5 = fdiv double %4, 3.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  int b = 3;
  int *p = &b;
  unsigned int a = sizeof(int) * *p;
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
void assert_ptt() {
  *(volatile unsigned long *)((void *)0xfffff400 + 0x34) = (1 << (2));
}


x86 assembly (clang, -O0):
<assert_ptt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff400,%eax
movq   $0x4,0x34(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_ptt>:
mov    $0xfffff434,%eax
movq   $0x4,(%rax)
ret

LLVM IR (-O0):
define void @assert_ptt() {
store volatile i64 4, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 52) to i64*)
ret void
}

LLVM IR (-O2):
define void @assert_ptt() {
store volatile i64 4, i64* inttoptr (i64 4294964276 to i64*)
ret void
}
void SNDDummyDeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @SNDDummyDeInit() {
ret void
}
/* Type definitions */
struct multiple_ir_import_section_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct multiple_ir_import_section_item *);
int multiple_ir_import_section_item_destroy(
    struct multiple_ir_import_section_item *item) {
  free(item);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.multiple_ir_import_section_item = type { i32 }
define i32 @multiple_ir_import_section_item_destroy(%struct.multiple_ir_import_section_item* %0) {
%2 = alloca %struct.multiple_ir_import_section_item*
store %struct.multiple_ir_import_section_item* %0, %struct.multiple_ir_import_section_item** %2
%3 = load %struct.multiple_ir_import_section_item*, %struct.multiple_ir_import_section_item** %2
%4 = call i32 @free(%struct.multiple_ir_import_section_item* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.multiple_ir_import_section_item = type { i32 }
define i32 @multiple_ir_import_section_item_destroy(%struct.multiple_ir_import_section_item* nocapture %0) {
%2 = tail call i32 @free(%struct.multiple_ir_import_section_item* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ page_isolation_init();
int /*<<< orphan*/ page_offline_init();
void ras_page_account_init(void) {
  page_offline_init();
  page_isolation_init();
}


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

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

LLVM IR (-O0):
define void @ras_page_account_init() {
%1 = call i32 (...) @page_offline_init()
%2 = call i32 (...) @page_isolation_init()
ret void
}

LLVM IR (-O2):
define void @ras_page_account_init() {
%1 = tail call i32 (...) @page_offline_init()
%2 = tail call i32 (...) @page_isolation_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ switch_status(int, int);
int main() {
  int router_status = 15;
  int switch_A = 8;
  int switch_B = 4;
  int switch_C = 2;
  int switch_D = 1;
  switch_status(router_status, switch_A);
  switch_status(router_status, switch_B);
  switch_status(router_status, switch_C);
  switch_status(router_status, switch_D);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <switch_status@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <switch_status@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <switch_status@plt>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <switch_status@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
mov    $0x8,%esi
call   1030 <switch_status@plt>
mov    $0xf,%edi
mov    $0x4,%esi
call   1030 <switch_status@plt>
mov    $0xf,%edi
mov    $0x2,%esi
call   1030 <switch_status@plt>
mov    $0xf,%edi
mov    $0x1,%esi
call   1030 <switch_status@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 15, i32* %2
store i32 8, i32* %3
store i32 4, i32* %4
store i32 2, i32* %5
store i32 1, i32* %6
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @switch_status(i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = call i32 @switch_status(i32 %10, i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %5
%15 = call i32 @switch_status(i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %6
%18 = call i32 @switch_status(i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @switch_status(i32 15, i32 8)
%2 = tail call i32 @switch_status(i32 15, i32 4)
%3 = tail call i32 @switch_status(i32 15, i32 2)
%4 = tail call i32 @switch_status(i32 15, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PrintUsage(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ parseArgs(int, char **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ processFile();
int main(int argc, char *argv[]) {
  if (!parseArgs(argc, argv)) {
    PrintUsage(argv[0]);
    exit(0);
  }
  processFile();
  printf("\n\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parseArgs@plt>
cmp    $0x0,%eax
jne    118e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <PrintUsage@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1060 <processFile@plt>
lea    0xe64(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
call   1030 <parseArgs@plt>
test   %eax,%eax
je     1174 <main+0x24>
xor    %eax,%eax
call   1060 <processFile@plt>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    (%rbx),%rdi
call   1050 <PrintUsage@plt>
xor    %edi,%edi
call   1070 <exit@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parseArgs(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @PrintUsage(i8* %6)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = tail call i32 (...) @processFile()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int remove(char *);
int file_delete(char *path) { return remove(path); }


x86 assembly (clang, -O0):
<file_delete>:
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):
<file_delete>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
define i32 @file_delete(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 i32 @file_delete(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
int __ast_cli_register_multiple(struct ast_cli_entry *e, int len) { return 0; }


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

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

LLVM IR (-O0):
%struct.ast_cli_entry = type opaque
define i32 @__ast_cli_register_multiple(%struct.ast_cli_entry* %0, i32 %1) {
%3 = alloca %struct.ast_cli_entry*
%4 = alloca i32
store %struct.ast_cli_entry* %0, %struct.ast_cli_entry** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.ast_cli_entry = type opaque
define i32 @__ast_cli_register_multiple(%struct.ast_cli_entry* nocapture readnone %0, i32 %1) {
ret i32 0
}
int sum(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<sum>:
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):
<sum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @sum(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 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  void weekDisplay(int);
  int day = 0;
  printf("\nPlease enter a number from 1 - 7 for the day you desire -->");
  scanf("%d", &day);
  weekDisplay(day);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <weekDisplay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"\0APlease enter a number from 1 - 7 for the day you desire -->\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"\0APlease enter a number from 1 - 7 for the day you desire -->\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 0
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void *check_alloc(int nbrelt, int sizelt) {
  void *retval;
  if ((retval = calloc(nbrelt, sizelt)) != NULL) {
    return retval;
  }
  printf("Not enough memory\n");
  exit(0);
}


x86 assembly (clang, -O0):
<check_alloc>:
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 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1161 <check_alloc+0x31>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<check_alloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     113d <check_alloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Not enough memory\0A\00"
define i8* @check_alloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %5
ret i8* %11
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"Not enough memory\00"
define noalias i8* @check_alloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i8* %3
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int l;
  for (l = 1; l < 256; l++) {
    printf("%c - %d\n", l, l);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%c - %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int min(int x, int y) {
  int z;
  if (x > y)
    z = y;
  else
    z = x;
  return z;
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int zedgetopt(struct zed *zed, int argc, char *argv[]) {
  int i = 1;
  while (i < argc) {
    i++;
  }
}


x86 assembly (clang, -O0):
<zedgetopt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1130 <zedgetopt+0x30>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <zedgetopt+0x16>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.zed = type opaque
define i32 @zedgetopt(%struct.zed* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.zed*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store %struct.zed* %0, %struct.zed** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 1, i32* %8
br label %9
9: ; preds = %13, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %8
%15 = add nsw i32 %14, 1
store i32 %15, i32* %8
br label %9
16: ; preds = %9
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
%struct.zed = type opaque
define i32 @zedgetopt(%struct.zed* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
ret i32 undef
}
/* Type definitions */
struct _citrus_mapper_area {
  int dummy;
};
struct _citrus_mapper {
  int dummy;
};

/* Variables and functions */
int mapper_open(struct _citrus_mapper_area *, struct _citrus_mapper **,
                char const *, char const *);
int _citrus_mapper_open_direct(
    struct _citrus_mapper_area *__restrict ma,
    struct _citrus_mapper *__restrict *__restrict rcm,
    const char *__restrict module, const char *__restrict variable) {
  return (mapper_open(ma, rcm, module, variable));
}


x86 assembly (clang, -O0):
<_citrus_mapper_open_direct>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <mapper_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_mapper_open_direct>:
jmp    1030 <mapper_open@plt>

LLVM IR (-O0):
%struct._citrus_mapper_area = type { i32 }
%struct._citrus_mapper = type { i32 }
define i32 @_citrus_mapper_open_direct(%struct._citrus_mapper_area* noalias %0, %struct._citrus_mapper** noalias %1, i8* noalias %2, i8* noalias %3) {
%5 = alloca %struct._citrus_mapper_area*
%6 = alloca %struct._citrus_mapper**
%7 = alloca i8*
%8 = alloca i8*
store %struct._citrus_mapper_area* %0, %struct._citrus_mapper_area** %5
store %struct._citrus_mapper** %1, %struct._citrus_mapper*** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct._citrus_mapper_area*, %struct._citrus_mapper_area** %5
%10 = load %struct._citrus_mapper**, %struct._citrus_mapper*** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @mapper_open(%struct._citrus_mapper_area* %9, %struct._citrus_mapper** %10, i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct._citrus_mapper_area = type { i32 }
%struct._citrus_mapper = type { i32 }
define i32 @_citrus_mapper_open_direct(%struct._citrus_mapper_area* noalias %0, %struct._citrus_mapper** noalias %1, i8* noalias %2, i8* noalias %3) {
%5 = tail call i32 @mapper_open(%struct._citrus_mapper_area* %0, %struct._citrus_mapper** %1, i8* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug_backtrace_init();
int /*<<< orphan*/ foo3();
int main(int argc, char **argv) {
  debug_backtrace_init();
  foo3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @debug_backtrace_init()
%4 = tail call i32 (...) @foo3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("No FIPS ECDSA support\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"No FIPS ECDSA support\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"No FIPS ECDSA support\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void unset_dvfm_constraint(void) {}


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

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

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

LLVM IR (-O2):
define void @unset_dvfm_constraint() {
ret void
}
int main(void) {
  int a = 5;
  *(&a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *def_realloc_func(void *opaque, void *address, size_t items, size_t size) {
  (void)opaque, (void)address, (void)items, (void)size;
  return realloc(address, items * size);
}


x86 assembly (clang, -O0):
<def_realloc_func>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1030 <realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @def_realloc_func(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = mul i64 %14, %15
%17 = call i8* @realloc(i8* %13, i64 %16)
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @def_realloc_func(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = mul i64 %3, %2
%6 = tail call i8* @realloc(i8* %1, i64 %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str_a[20];
  strcpy(str_a, "Hello, World!\n");
  printf(str_a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %2)
ret i32 0
}
/* Variables and functions */
int __builtin_nyuzi_read_control_reg(int /*<<< orphan*/);
int getCurrentThreadId() { return __builtin_nyuzi_read_control_reg(0); }


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

x86 assembly (clang, -O2):
<getCurrentThreadId>:
xor    %edi,%edi
jmp    1030 <__builtin_nyuzi_read_control_reg@plt>

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

LLVM IR (-O2):
define i32 @getCurrentThreadId() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void alignedFree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<alignedFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @alignedFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int __v4si;
typedef scalar_t__ __m128d;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_xor_pd(__m128d a, __m128d b) {
  return (__m128d)((__v4si)a ^ (__v4si)b);
}


x86 assembly (clang, -O0):
<_mm_xor_pd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
xor    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_xor_pd>:
xor    %edi,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @_mm_xor_pd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = xor i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @_mm_xor_pd(i64 %0, i64 %1) {
%3 = xor i64 %1, %0
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
ret i64 %5
}
/* Variables and functions */
scalar_t__ bar(int);
void foo(int c, int d) {
  if (bar(c))
    bar(c);
  d = 33;
  while (c == d)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bar@plt>
cmp    $0x0,%rax
je     1138 <foo+0x28>
mov    -0x4(%rbp),%edi
call   1030 <bar@plt>
movl   $0x21,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1150 <foo+0x40>
jmp    113f <foo+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
call   1030 <bar@plt>
test   %rax,%rax
je     1124 <foo+0x14>
mov    %ebx,%edi
call   1030 <bar@plt>
cmp    $0x21,%ebx
jne    1132 <foo+0x22>
nopl   0x0(%rax)
jmp    1130 <foo+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = tail call i64 @bar(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i64 @bar(i32 %0)
br label %7
7: ; preds = %5, %2
%8 = icmp eq i32 %0, 33
br i1 %8, label %9, label %10
9: ; preds = %7, %9
br label %9
10: ; preds = %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void writetofile(int fd) {
  printf("write\n");
  close(fd);
  exit(0);
}


x86 assembly (clang, -O0):
<writetofile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<writetofile>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"write\00"
define void @writetofile(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @close(i32 %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *dlib_fmtstr(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ puts(char *);
int utils(int argc, char **argv) {
  char *foo = dlib_fmtstr("%s hehe", "hello world");
  puts(foo);
  free(foo);
  return 0;
}


x86 assembly (clang, -O0):
<utils>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1050 <dlib_fmtstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1050 <dlib_fmtstr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s hehe\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @utils(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i8* @dlib_fmtstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @puts(i8* %7)
%9 = load i8*, i8** %5
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s hehe\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @utils(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @dlib_fmtstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ __LONG_LONG_PAIR(int /*<<< orphan*/, int /*<<< orphan*/);
size_t __pread(int, void *, size_t, int /*<<< orphan*/, int /*<<< orphan*/);
size_t __libc_pread(int fd, void *buf, size_t count, off_t offset) {
  return __pread(fd, buf, count, 0, __LONG_LONG_PAIR(0, offset));
}


x86 assembly (clang, -O0):
<__libc_pread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%esi
xor    %edi,%edi
call   1030 <__LONG_LONG_PAIR@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%r8d
xor    %ecx,%ecx
call   1040 <__pread@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_pread>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
mov    %ecx,%esi
call   1030 <__LONG_LONG_PAIR@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__pread@plt>

LLVM IR (-O0):
define i64 @__libc_pread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @__LONG_LONG_PAIR(i32 0, i32 %12)
%14 = call i64 @__pread(i32 %9, i8* %10, i64 %11, i32 0, i32 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @__libc_pread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @__LONG_LONG_PAIR(i32 0, i32 %3)
%6 = tail call i64 @__pread(i32 %0, i8* %1, i64 %2, i32 0, i32 %5)
ret i64 %6
}
void f2() {}


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

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

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

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