xunge/DecIR huggingface dataset:
double uniform(double lo, double hi) {
  double x, width;
  width = hi - lo;
  if (width < 0)
    return uniform(hi, lo);
  x = (drand2()) * width;
  return x + lo;
}


x86 assembly (clang, -O0):
<uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1168 <uniform+0x48>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <uniform@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    118c <uniform+0x6c>
mov    $0x0,%al
call   1040 <drand2@plt>
cvtsi2sd %eax,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform>:
xorpd  %xmm3,%xmm3
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm1,%xmm2
movapd %xmm0,%xmm1
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm3
ja     1120 <uniform+0x10>
sub    $0x18,%rsp
xor    %eax,%eax
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1030 <drand2@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @uniform(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fsub double %8, %9
store double %10, double* %7
%11 = load double, double* %7
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load double, double* %5
%15 = load double, double* %4
%16 = call double @uniform(double %14, double %15)
store double %16, double* %3
br label %25
17: ; preds = %2
%18 = call i32 (...) @drand2()
%19 = sitofp i32 %18 to double
%20 = load double, double* %7
%21 = fmul double %19, %20
store double %21, double* %6
%22 = load double, double* %6
%23 = load double, double* %4
%24 = fadd double %22, %23
store double %24, double* %3
br label %25
25: ; preds = %17, %13
%26 = load double, double* %3
ret double %26
}

LLVM IR (-O2):
define double @uniform(double %0, double %1) {
br label %3
3: ; preds = %3, %2
%4 = phi double [ %0, %2 ], [ %5, %3 ]
%5 = phi double [ %1, %2 ], [ %4, %3 ]
%6 = fsub double %5, %4
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = tail call i32 (...) @drand2()
%10 = sitofp i32 %9 to double
%11 = fmul double %6, %10
%12 = fadd double %4, %11
ret double %12
}
double test_trunc(double x) { return __builtin_trunc(x); }


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

x86 assembly (clang, -O2):
<test_trunc>:
jmp    1030 <trunc@plt>

LLVM IR (-O0):
define double @test_trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.trunc.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test_trunc(double %0) {
%2 = tail call double @llvm.trunc.f64(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t memChrGet8None(uint16_t addr) {
  (void)addr;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @memChrGet8None(i32 %0) {
ret i32 0
}
void segement_not_present_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @segement_not_present_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int execute_mq_getsetattr() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mq_getsetattr() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long int answer = 42;
  printf("Answer to the Ultimate Question of Life, The Universe, and "
         "Everything is %u\n",
         answer);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [77 x i8] c"Answer to the Ultimate Question of Life, The Universe, and Everything is %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 42, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [77 x i8] c"Answer to the Ultimate Question of Life, The Universe, and Everything is %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i64 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setutent();
void setutxent(void) { setutent(); }


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

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

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

LLVM IR (-O2):
define void @setutxent() {
%1 = tail call i32 (...) @setutent()
ret void
}
const char *File_Description(void) {
  return "The `File` type is a wrapper of the native C `FILE` type "
         "representing a "
         "file in the operating system.";
}


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

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

LLVM IR (-O0):
@.str = [102 x i8] c"The `File` type is a wrapper of the native C `FILE` type representing a file in the operating system.\00"
define i8* @File_Description() {
ret i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [102 x i8] c"The `File` type is a wrapper of the native C `FILE` type representing a file in the operating system.\00"
define i8* @File_Description() {
ret i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int);
void CX4_op74(void) { CX4_immediate_reg(33); }


x86 assembly (clang, -O0):
<CX4_op74>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
call   1030 <CX4_immediate_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CX4_op74>:
mov    $0x21,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op74() {
%1 = call i32 @CX4_immediate_reg(i32 33)
ret void
}

LLVM IR (-O2):
define void @CX4_op74() {
%1 = tail call i32 @CX4_immediate_reg(i32 33)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aws_free(void *data) { free(data); }


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

LLVM IR (-O0):
define void @aws_free(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 @aws_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 7, j = i - i;
  while (i) {
    i /= 2;
    j++;
  }
  printf("%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1155 <main+0x45>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <main+0x1f>
mov    -0xc(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
void HardFault_Handler() {
  while (true)
    ;
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HardFault_Handler+0x9>
jmp    1109 <HardFault_Handler+0x9>

x86 assembly (clang, -O2):
<HardFault_Handler>:
jmp    1100 <HardFault_Handler>

LLVM IR (-O0):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void foo785(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo785(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_22(void *dest, void *src) {
  memcpy(dest, src, 22);
}


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

x86 assembly (clang, -O2):
<memcpy_22>:
mov    $0x16,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_22(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 22)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint32_t numberSmallestProduct;
  numberSmallestProduct = 20 * 18 * 14 * 11 * 13 * 19 * 17;
  printf("The smallest number: %i\n", numberSmallestProduct);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"The smallest number: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 232792560, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The smallest number: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 232792560)
ret i32 0
}
void av_gettime_relative() {}


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

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

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

LLVM IR (-O2):
define void @av_gettime_relative() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
void print_if_usage() {
  fail("Usage: if CONDITION then { CONSEQUENT } else { ALTERNATIVE }\n");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"Usage: if CONDITION then { CONSEQUENT } else { ALTERNATIVE }\0A\00"
define void @print_if_usage() {
%1 = call i32 @fail(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"Usage: if CONDITION then { CONSEQUENT } else { ALTERNATIVE }\0A\00"
define void @print_if_usage() {
%1 = tail call i32 @fail(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int _lseek(int32_t file, int32_t ptr, int32_t dir) { return 0; }


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

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

LLVM IR (-O0):
define i32 @_lseek(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
ret i32 0
}

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("dlep_router - A logging DLEP router\n"
         "  Version 0.1.2\n"
         "  Copyright (c) 2017 Airbus DS Limited\n\n"
         "Usage: dlep_router [options] [modem IP address [port]]\n"
         "Options:\n"
         "  -6 or --ipv6          Use IPv6 (default is IPv4)\n"
         "  -I or --interface <I> Bind the discovery to interface I, requires "
         "root\n"
         "  -H or --heartbeat <N> Use Heartbeat Interval N (default is 0)\n"
         "  -h or --help          Show this text\n");
}


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

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

LLVM IR (-O0):
@.str = [384 x i8] c"dlep_router - A logging DLEP router\0A Version 0.1.2\0A Copyright (c) 2017 Airbus DS Limited\0A\0AUsage: dlep_router [options] [modem IP address [port]]\0AOptions:\0A -6 or --ipv6 Use IPv6 (default is IPv4)\0A -I or --interface <I> Bind the discovery to interface I, requires root\0A -H or --heartbeat <N> Use Heartbeat Interval N (default is 0)\0A -h or --help Show this text\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([384 x i8], [384 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [383 x i8] c"dlep_router - A logging DLEP router\0A Version 0.1.2\0A Copyright (c) 2017 Airbus DS Limited\0A\0AUsage: dlep_router [options] [modem IP address [port]]\0AOptions:\0A -6 or --ipv6 Use IPv6 (default is IPv4)\0A -I or --interface <I> Bind the discovery to interface I, requires root\0A -H or --heartbeat <N> Use Heartbeat Interval N (default is 0)\0A -h or --help Show this text\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([383 x i8], [383 x i8]* @str, i64 0, i64 0))
ret void
}
void INT_Excep_TMR3_CMI3B(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TMR3_CMI3B() {
ret void
}
/* Variables and functions */
int unihex_init();
int module_unihex_init(void) { return unihex_init(); }


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

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

LLVM IR (-O0):
define i32 @module_unihex_init() {
%1 = call i32 (...) @unihex_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @module_unihex_init() {
%1 = tail call i32 (...) @unihex_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x45() {
  Assert_real((isgraph(69)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              350, ("isgraph should be 1 for E"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x45>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x15e,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x45>:
push   %rax
mov    $0x45,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x15e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for E\00"
define void @t_isgraph_0x45() {
%1 = call i32 @isgraph(i32 69)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for E\00"
define void @t_isgraph_0x45() {
%1 = tail call i32 @isgraph(i32 69)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void rop3_3_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T | S;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_3_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_3_0_0>:
or     %edx,%esi
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_3_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %7
%18 = load i8, i8* %7
%19 = load i8*, i8** %4
store i8 %18, i8* %19
ret void
}

LLVM IR (-O2):
define void @rop3_3_0_0(i8* nocapture writeonly %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_config_parse_string() {
  printf("NOT IMPLEMENTED:"
         "pa_config_parse_string"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_config_parse_string\0A\00"
define i32 @pa_config_parse_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_config_parse_string\00"
define i32 @pa_config_parse_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
hdrawc_(s) char *s;
{ hdrawchar(*s); }


x86 assembly (clang, -O0):
<hdrawc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <hdrawchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdrawc_>:
movsbl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hdrawchar@plt>

LLVM IR (-O0):
define i32 @hdrawc_(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @hdrawchar to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @hdrawc_(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @hdrawchar to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
void e(int u) { int z = u; }


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

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

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

LLVM IR (-O2):
define void @e(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_clamping();
int /*<<< orphan*/ test_enabled();
int /*<<< orphan*/ test_locked();
int /*<<< orphan*/ test_translate_atom();
int /*<<< orphan*/ test_translate_atom_airmont();
int /*<<< orphan*/ test_translate_default();
int main(void) {
  test_translate_default();
  test_translate_atom();
  test_translate_atom_airmont();
  test_locked();
  test_enabled();
  test_clamping();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_translate_default@plt>
mov    $0x0,%al
call   1060 <test_translate_atom@plt>
mov    $0x0,%al
call   1080 <test_translate_atom_airmont@plt>
mov    $0x0,%al
call   1030 <test_locked@plt>
mov    $0x0,%al
call   1040 <test_enabled@plt>
mov    $0x0,%al
call   1070 <test_clamping@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_translate_default@plt>
xor    %eax,%eax
call   1060 <test_translate_atom@plt>
xor    %eax,%eax
call   1080 <test_translate_atom_airmont@plt>
xor    %eax,%eax
call   1030 <test_locked@plt>
xor    %eax,%eax
call   1040 <test_enabled@plt>
xor    %eax,%eax
call   1070 <test_clamping@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_translate_default()
%3 = call i32 (...) @test_translate_atom()
%4 = call i32 (...) @test_translate_atom_airmont()
%5 = call i32 (...) @test_locked()
%6 = call i32 (...) @test_enabled()
%7 = call i32 (...) @test_clamping()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_translate_default()
%2 = tail call i32 (...) @test_translate_atom()
%3 = tail call i32 (...) @test_translate_atom_airmont()
%4 = tail call i32 (...) @test_locked()
%5 = tail call i32 (...) @test_enabled()
%6 = tail call i32 (...) @test_clamping()
ret i32 0
}
exit(code) int code;
{
  _cleanup();
  _exit(code);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_cleanup@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_cleanup@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @_cleanup()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define i32 @exit(i32 %0) {
%2 = tail call i32 (...) @_cleanup()
tail call void @_exit(i32 %0)
unreachable
}
/* Type definitions */
struct _WsbmFenceObject {
  int dummy;
};
struct _WsbmBufStorage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void pool_fence(struct _WsbmBufStorage *buf, struct _WsbmFenceObject *fence) {
  abort();
}


x86 assembly (clang, -O0):
<pool_fence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
%struct._WsbmBufStorage = type { i32 }
%struct._WsbmFenceObject = type { i32 }
define void @pool_fence(%struct._WsbmBufStorage* %0, %struct._WsbmFenceObject* %1) {
%3 = alloca %struct._WsbmBufStorage*
%4 = alloca %struct._WsbmFenceObject*
store %struct._WsbmBufStorage* %0, %struct._WsbmBufStorage** %3
store %struct._WsbmFenceObject* %1, %struct._WsbmFenceObject** %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct._WsbmBufStorage = type { i32 }
%struct._WsbmFenceObject = type { i32 }
define void @pool_fence(%struct._WsbmBufStorage* nocapture readnone %0, %struct._WsbmFenceObject* nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int file_write(char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int file_string_write(const char *filename, const char *what) {
  return file_write(filename, what, strlen(what));
}


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

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

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

LLVM IR (-O2):
define i32 @file_string_write(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @file_write(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
unsigned int mtrandom_uint(int);
int star_generate_more(unsigned int mulodds) {
  return (mtrandom_uint(100) < mulodds);
}


x86 assembly (clang, -O0):
<star_generate_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <mtrandom_uint@plt>
cmp    -0x4(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<star_generate_more>:
push   %rbx
mov    %edi,%ebx
mov    $0x64,%edi
call   1030 <mtrandom_uint@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setb   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @star_generate_more(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @mtrandom_uint(i32 100)
%4 = load i32, i32* %2
%5 = icmp ult i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @star_generate_more(i32 %0) {
%2 = tail call i32 @mtrandom_uint(i32 100)
%3 = icmp ult i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int xml_to_upper(int c) {
  if (c >= 'a' && c <= 'z') {
    return c - 'a' + 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<xml_to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <xml_to_upper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <xml_to_upper+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <xml_to_upper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_to_upper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @xml_to_upper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = add nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @xml_to_upper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn19() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn19");
  return result;
}


x86 assembly (clang, -O0):
<fn19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn19>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn19\00"
define i8* @fn19() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn19\00"
define i8* @fn19() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int average(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, unsigned int *, unsigned int *);
int main() {
  unsigned int a, b;
  scanf("%u %u", &a, &b);
  printf("%u\n", average(a, b));
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* null)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 undef)
ret i32 0
}
/* Variables and functions */
unsigned int executeHandleMessages(void *, char *, int, unsigned int *,
                                   unsigned int **);
unsigned int assertFacts(void *handle, char *messages,
                         unsigned int *resultsLength, unsigned int **results) {
  return executeHandleMessages(handle, messages, 1, resultsLength, results);
}


x86 assembly (clang, -O0):
<assertFacts>:
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),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%edx
call   1030 <executeHandleMessages@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertFacts>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <executeHandleMessages@plt>

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

LLVM IR (-O2):
define i32 @assertFacts(i8* %0, i8* %1, i32* %2, i32** %3) {
%5 = tail call i32 @executeHandleMessages(i8* %0, i8* %1, i32 1, i32* %2, i32** %3)
ret i32 %5
}
char *nsub(char *str1, int s) { return &str1[s]; }


x86 assembly (clang, -O0):
<nsub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsub>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @nsub(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @nsub(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void die(const char *err) {
  perror(err);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void radix_sort(void *base, size_t numel, size_t size, size_t buckets) {
  assert(base);
  assert(0 < size);
  assert(!(buckets < numel));
}


x86 assembly (clang, -O0):
<radix_sort>:
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),%rax
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_sort>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    %r15,%r14
setae  %dil
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @radix_sort(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %7
%13 = icmp ult i64 0, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i64, i64* %8
%17 = load i64, i64* %6
%18 = icmp ult i64 %16, %17
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}

LLVM IR (-O2):
define void @radix_sort(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = ptrtoint i8* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne i64 %2, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = icmp uge i64 %3, %1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
double ratio(uint64_t value1, uint64_t value2) {
  double r;
  if (value2 > 0) {
    r = (double)((double)value1 / (double)value2);
  } else {
    r = 0.0;
  }
  return (r);
}


x86 assembly (clang, -O0):
<ratio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1131 <ratio+0x31>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1139 <ratio+0x39>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ratio>:
test   %rsi,%rsi
jle    1114 <ratio+0x14>
cvtsi2sd %rdi,%xmm0
cvtsi2sd %rsi,%xmm1
divsd  %xmm1,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ratio(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %3
%10 = sitofp i64 %9 to double
%11 = load i64, i64* %4
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
store double %13, double* %5
br label %15
14: ; preds = %2
store double 0.000000e+00, double* %5
br label %15
15: ; preds = %14, %8
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @ratio(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sitofp i64 %0 to double
%6 = sitofp i64 %1 to double
%7 = fdiv double %5, %6
br label %8
8: ; preds = %2, %4
%9 = phi double [ %7, %4 ], [ 0.000000e+00, %2 ]
ret double %9
}
/* Variables and functions */
int f(int);
int main() {
  int a;
  return f(a);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void pe_exit(int rc) { exit(rc); }


x86 assembly (clang, -O0):
<pe_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<pe_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @pe_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ strcmp(char const *, char *);
int main(void) {
  const char s[] = "\u30b2";
  if (strcmp(s, "\u30b2") != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1159 <main+0x39>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xb282e3,0x4(%rsp)
lea    0xed0(%rip),%rsi
lea    0x4(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1143 <main+0x23>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.s = [4 x i8] c"\E3\82\B2\00"
@.str = [4 x i8] c"\E3\82\B2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\E3\82\B2\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 11698915, i32* %1
%3 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_Error(char *);
void *malloc(size_t);
void *MEM_Alloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    SYS_Error("Allocation failure!");
  return ptr;
}


x86 assembly (clang, -O0):
<MEM_Alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <MEM_Alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <SYS_Error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEM_Alloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <MEM_Alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <SYS_Error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Allocation failure!\00"
define i8* @MEM_Alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @SYS_Error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"Allocation failure!\00"
define noalias i8* @MEM_Alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @SYS_Error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}