xunge/DecIR huggingface dataset:
int main(void) { return 9; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 9
}
/* Variables and functions */
int /*<<< orphan*/ AsyncPowerManagerP__0__ResourceDefaultOwner__granted();
void ArbiterP__0__ResourceDefaultOwner__granted(void) {
  AsyncPowerManagerP__0__ResourceDefaultOwner__granted();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__0__ResourceDefaultOwner__granted() {
%1 = tail call i32 (...) @AsyncPowerManagerP__0__ResourceDefaultOwner__granted()
ret void
}
int ld_ble_rr1(long double a1, long double a2) {
  return (__builtin_islessequal(a1, a2));
}


x86 assembly (clang, -O0):
<ld_ble_rr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ble_rr1>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_ble_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ole x86_fp80 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ld_ble_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ole x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigHandler(int sig) { printf("printscreen"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"printscreen\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"printscreen\00"
define void @sigHandler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned char *cli_decodesig() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @cli_decodesig() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ atmel_atmega8_PB5_set__E();
void pollen_hardware_Led_on__E() {
  { atmel_atmega8_PB5_set__E(); }
}


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

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

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

LLVM IR (-O2):
define void @pollen_hardware_Led_on__E() {
%1 = tail call i32 (...) @atmel_atmega8_PB5_set__E()
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, ...);
int _errno(char const *progname) {
  printf("%s: Testing errno\n", progname);
  printf("%d\n", errno);
  errno = 17;
  printf("%d\n", errno);
  return (errno == 17) ? 0 : 2;
}


x86 assembly (clang, -O0):
<_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
movl   $0x11,(%rax)
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x11,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_errno>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2eb4(%rip),%rbx
mov    (%rbx),%esi
lea    0xede(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x11,(%rbx)
mov    %r14,%rdi
mov    $0x11,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x11,(%rbx)
setne  %al
add    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%s: Testing errno\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@errno = global i32 0
define i32 @_errno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @errno
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
store i32 17, i32* @errno
%7 = load i32, i32* @errno
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @errno
%10 = icmp eq i32 %9, 17
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 2
ret i32 %12
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s: Testing errno\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@errno = global i32 0
define i32 @_errno(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @errno
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
store i32 17, i32* @errno
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 17)
%6 = load i32, i32* @errno
%7 = icmp eq i32 %6, 17
%8 = select i1 %7, i32 0, i32 2
ret i32 %8
}
void test1() {
#pragma clang __debug captured
  {}
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1120 <__captured_stmt>
add    $0x10,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

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

LLVM IR (-O0):
%struct.anon = type {}
define void @test1() {
%1 = alloca %struct.anon
ret void
}
define internal void @__captured_stmt(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
%3 = load %struct.anon*, %struct.anon** %2
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
double log(double);
double inv_xpect(double invbeta, double p) {
  return (-1.0 * invbeta) * log(100.0 / p - 1.0);
}


x86 assembly (clang, -O0):
<inv_xpect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xee6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecc(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_xpect>:
sub    $0x18,%rsp
xorps  0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movsd  0xee9(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xee5(%rip),%xmm0
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @inv_xpect(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double -1.000000e+00, %5
%7 = load double, double* %4
%8 = fdiv double 1.000000e+02, %7
%9 = fsub double %8, 1.000000e+00
%10 = call double @log(double %9)
%11 = fmul double %6, %10
ret double %11
}

LLVM IR (-O2):
define double @inv_xpect(double %0, double %1) {
%3 = fneg double %0
%4 = fdiv double 1.000000e+02, %1
%5 = fadd double %4, -1.000000e+00
%6 = tail call double @log(double %5)
%7 = fmul double %6, %3
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ motor(int, int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ off(int);
void turnRight(int dist) {
  motor(3, 75);
  motor(1, -90);
  msleep(dist);
  off(1);
  off(3);
}


x86 assembly (clang, -O0):
<turnRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x4b,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0xffffffa6,%esi
call   1030 <motor@plt>
mov    -0x4(%rbp),%edi
call   1050 <msleep@plt>
mov    $0x1,%edi
call   1040 <off@plt>
mov    $0x3,%edi
call   1040 <off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnRight>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%edi
mov    $0x4b,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0xffffffa6,%esi
call   1030 <motor@plt>
mov    %ebx,%edi
call   1050 <msleep@plt>
mov    $0x1,%edi
call   1040 <off@plt>
mov    $0x3,%edi
pop    %rbx
jmp    1040 <off@plt>

LLVM IR (-O0):
define void @turnRight(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @motor(i32 3, i32 75)
%4 = call i32 @motor(i32 1, i32 -90)
%5 = load i32, i32* %2
%6 = call i32 @msleep(i32 %5)
%7 = call i32 @off(i32 1)
%8 = call i32 @off(i32 3)
ret void
}

LLVM IR (-O2):
define void @turnRight(i32 %0) {
%2 = tail call i32 @motor(i32 3, i32 75)
%3 = tail call i32 @motor(i32 1, i32 -90)
%4 = tail call i32 @msleep(i32 %0)
%5 = tail call i32 @off(i32 1)
%6 = tail call i32 @off(i32 3)
ret void
}
char *wrap_ptr_if_necessary(char *buffer, char *p, char *bufend) {
  return p == bufend ? buffer : p;
}


x86 assembly (clang, -O0):
<wrap_ptr_if_necessary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    112b <wrap_ptr_if_necessary+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1133 <wrap_ptr_if_necessary+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_ptr_if_necessary>:
mov    %rdi,%rax
cmp    %rdx,%rsi
cmovne %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @wrap_ptr_if_necessary(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp eq i8* %1, %2
%5 = select i1 %4, i8* %0, i8* %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ ETHER_ADDR_LEN;
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int is_source_mac(char *frame, char *mac) {
  return (strncmp(mac, frame, ETHER_ADDR_LEN) == 0);
}


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

x86 assembly (clang, -O2):
<is_source_mac>:
push   %rax
mov    %rdi,%rax
mov    0x2ed5(%rip),%rcx
mov    (%rcx),%edx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ETHER_ADDR_LEN = global i32 0
define i32 @is_source_mac(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = load i32, i32* @ETHER_ADDR_LEN
%8 = call i64 @strncmp(i8* %5, i8* %6, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@ETHER_ADDR_LEN = global i32 0
define i32 @is_source_mac(i8* %0, i8* %1) {
%3 = load i32, i32* @ETHER_ADDR_LEN
%4 = tail call i64 @strncmp(i8* %1, i8* %0, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *get_system_type(void) { return "TANBAC TB0226"; }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"TANBAC TB0226\00"
define i8* @get_system_type() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ FlashInit();
void NvmInit(void) { FlashInit(); }


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

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

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

LLVM IR (-O2):
define void @NvmInit() {
%1 = tail call i32 (...) @FlashInit()
ret void
}
int score_state_resume(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @score_state_resume() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lp4pole_note_free(void *data) { free(data); }


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

LLVM IR (-O0):
define void @lp4pole_note_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 @lp4pole_note_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *memmove(void *dstptr, const void *srcptr, size_t size) {
  abort();
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define noalias i8* @memmove(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char const,
                           unsigned char const, unsigned char const);
void RGB2Hex(unsigned char const aRGB[3], char aoResultHexRGB[8]) {
  sprintf(aoResultHexRGB, "#%02hhx%02hhx%02hhx", aRGB[0], aRGB[1], aRGB[2]);
}


x86 assembly (clang, -O0):
<RGB2Hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xec4(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl 0x2(%rax),%r8d
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB2Hex>:
mov    %rsi,%rax
movzbl (%rdi),%edx
movzbl 0x1(%rdi),%ecx
movzbl 0x2(%rdi),%r8d
lea    0xeda(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"#%02hhx%02hhx%02hhx\00"
define void @RGB2Hex(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i8 zeroext %11, i8 zeroext %14)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"#%02hhx%02hhx%02hhx\00"
define void @RGB2Hex(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %5, i8 zeroext %7)
ret void
}
/* Variables and functions */
int errno;
void scalanative_set_errno(int value) { errno = value; }


x86 assembly (clang, -O0):
<scalanative_set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_set_errno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @scalanative_set_errno(i32 %0) {
store i32 %0, i32* @errno
ret void
}
unsigned char _ucAsyncClose(void) { return (1); }


x86 assembly (clang, -O0):
<_ucAsyncClose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @_ucAsyncClose() {
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @_ucAsyncClose() {
ret i8 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void myexit(int whatsig) { exit(0); }


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

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

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

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

/* Variables and functions */
double pop(struct lifo *);
double sinh(double);
double opr_sinh(struct lifo *stack) {
  double op = pop(stack);
  return sinh(op);
}


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

x86 assembly (clang, -O2):
<opr_sinh>:
push   %rax
call   1040 <pop@plt>
pop    %rax
jmp    1030 <sinh@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_sinh(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @sinh(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_sinh(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @sinh(double %2)
ret double %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int countTerms(int64_t number) {
  int counter = 1;
  do {
    if (number % 2 == 0) {
      number /= 2;
    } else {
      number = 3 * number + 1;
    }
    counter++;
  } while (number != 1);
  return counter;
}


x86 assembly (clang, -O0):
<countTerms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1135 <countTerms+0x35>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    113f <countTerms+0x3f>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    110e <countTerms+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countTerms>:
mov    $0x1,%eax
jmp    111e <countTerms+0x1e>
nopw   0x0(%rax,%rax,1)
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
add    $0x1,%eax
cmp    $0x1,%edi
je     1131 <countTerms+0x31>
test   $0x1,%dil
jne    1110 <countTerms+0x10>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
jmp    1116 <countTerms+0x16>
ret

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

LLVM IR (-O2):
define i32 @countTerms(i32 %0) {
br label %2
2: ; preds = %12, %1
%3 = phi i32 [ %0, %1 ], [ %13, %12 ]
%4 = phi i32 [ 1, %1 ], [ %14, %12 ]
%5 = and i32 %3, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = sdiv i32 %3, 2
br label %12
9: ; preds = %2
%10 = mul nsw i32 %3, 3
%11 = add nsw i32 %10, 1
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %8, %7 ], [ %11, %9 ]
%14 = add nuw nsw i32 %4, 1
%15 = icmp eq i32 %13, 1
br i1 %15, label %16, label %2
16: ; preds = %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr,
          "Usage: %s [-lav] [-s localport] [-f file] destination/port[/ttl]\n",
          argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: %s [-lav] [-s localport] [-f file] destination/port[/ttl]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: %s [-lav] [-s localport] [-f file] destination/port[/ttl]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ cnd_t;

/* Variables and functions */
int /*<<< orphan*/ cond_destroy(int /*<<< orphan*/ *);
void cnd_destroy(cnd_t *cond) { (void)cond_destroy(cond); }


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

x86 assembly (clang, -O2):
<cnd_destroy>:
jmp    1030 <cond_destroy@plt>

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

LLVM IR (-O2):
define void @cnd_destroy(i32* %0) {
%2 = tail call i32 @cond_destroy(i32* %0)
ret void
}
/* Type definitions */
struct libkeccak_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libkeccak_state *);
int /*<<< orphan*/ libkeccak_state_fast_destroy(struct libkeccak_state *);
void libkeccak_state_fast_free(struct libkeccak_state *restrict state) {
  libkeccak_state_fast_destroy(state);
  free(state);
}


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

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

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

LLVM IR (-O2):
%struct.libkeccak_state = type { i32 }
define void @libkeccak_state_fast_free(%struct.libkeccak_state* noalias %0) {
%2 = tail call i32 @libkeccak_state_fast_destroy(%struct.libkeccak_state* %0)
%3 = tail call i32 @free(%struct.libkeccak_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void test(void) { printk("A lib test.\n"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"A lib test.\0A\00"
define void @test() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct whoami_cmdline_parser_params {
  int dummy;
};
struct whoami_args_info {
  int dummy;
};

/* Variables and functions */
int whoami_cmdline_parser_internal(int, char **, struct whoami_args_info *,
                                   struct whoami_cmdline_parser_params *,
                                   int /*<<< orphan*/);
int whoami_cmdline_parser_ext(int argc, char **argv,
                              struct whoami_args_info *args_info,
                              struct whoami_cmdline_parser_params *params) {
  int result;
  result = whoami_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


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

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

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

LLVM IR (-O2):
%struct.whoami_args_info = type { i32 }
%struct.whoami_cmdline_parser_params = type { i32 }
define i32 @whoami_cmdline_parser_ext(i32 %0, i8** %1, %struct.whoami_args_info* %2, %struct.whoami_cmdline_parser_params* %3) {
%5 = tail call i32 @whoami_cmdline_parser_internal(i32 %0, i8** %1, %struct.whoami_args_info* %2, %struct.whoami_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
int main() { return ~-0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
int arraylen(char **array) {
  int index;
  index = 0;
  while (array && *array)
    index++;
  return (index);
}


x86 assembly (clang, -O0):
<arraylen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     112d <arraylen+0x2d>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113d <arraylen+0x3d>
jmp    114b <arraylen+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <arraylen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @arraylen(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8**, i8*** %2
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %7, %4
%12 = phi i1 [ false, %4 ], [ %10, %7 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @arraylen(i8** %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int die(const char *reason) {
  fprintf(stderr, "Err: %s - %s \n ", strerror(errno), reason);
  exit(EXIT_FAILURE);
  return -1;
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Err: %s - %s \0A \00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Err: %s - %s \0A \00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
void set_723(void *pnt, unsigned int i) {
  unsigned char *p = (unsigned char *)pnt;
  p[3] = p[0] = i & 0xff;
  p[2] = p[1] = (i >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<set_723>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_723>:
mov    %sil,(%rdi)
mov    %sil,0x3(%rdi)
shr    $0x8,%esi
mov    %sil,0x1(%rdi)
mov    %sil,0x2(%rdi)
ret

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

LLVM IR (-O2):
define void @set_723(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *getTime() {
  time_t t;
  time(&t);
  return ctime(&t);
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getTime() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call i8* @ctime(i32* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @getTime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
ret i8* %4
}
int checkOutBounds(int headX, int headY, float TOP_MARGIN, float LEFT_MARGIN,
                   float BOT_END, float RIGHT_END) {
  if (headY < TOP_MARGIN || headY > BOT_END || headX < LEFT_MARGIN ||
      headX > RIGHT_END) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkOutBounds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  %xmm2,-0x18(%rbp)
movss  %xmm3,-0x1c(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     1162 <checkOutBounds+0x62>
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
ja     1162 <checkOutBounds+0x62>
cvtsi2ssl -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     1162 <checkOutBounds+0x62>
cvtsi2ssl -0x8(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    116e <checkOutBounds+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <checkOutBounds+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkOutBounds>:
cvtsi2ss %esi,%xmm4
ucomiss %xmm4,%xmm0
mov    $0x1,%eax
ja     112b <checkOutBounds+0x2b>
ucomiss %xmm2,%xmm4
ja     112b <checkOutBounds+0x2b>
xorps  %xmm0,%xmm0
cvtsi2ss %edi,%xmm0
ucomiss %xmm0,%xmm1
seta   %al
ucomiss %xmm3,%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @checkOutBounds(i32 %0, i32 %1, float %2, float %3, float %4, float %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store i32 %0, i32* %8
store i32 %1, i32* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
%14 = load i32, i32* %9
%15 = sitofp i32 %14 to float
%16 = load float, float* %10
%17 = fcmp olt float %15, %16
br i1 %17, label %33, label %18
18: ; preds = %6
%19 = load i32, i32* %9
%20 = sitofp i32 %19 to float
%21 = load float, float* %12
%22 = fcmp ogt float %20, %21
br i1 %22, label %33, label %23
23: ; preds = %18
%24 = load i32, i32* %8
%25 = sitofp i32 %24 to float
%26 = load float, float* %11
%27 = fcmp olt float %25, %26
br i1 %27, label %33, label %28
28: ; preds = %23
%29 = load i32, i32* %8
%30 = sitofp i32 %29 to float
%31 = load float, float* %13
%32 = fcmp ogt float %30, %31
br i1 %32, label %33, label %34
33: ; preds = %28, %23, %18, %6
store i32 1, i32* %7
br label %35
34: ; preds = %28
store i32 0, i32* %7
br label %35
35: ; preds = %34, %33
%36 = load i32, i32* %7
ret i32 %36
}

LLVM IR (-O2):
define i32 @checkOutBounds(i32 %0, i32 %1, float %2, float %3, float %4, float %5) {
%7 = sitofp i32 %1 to float
%8 = fcmp olt float %7, %2
%9 = fcmp ogt float %7, %4
%10 = or i1 %8, %9
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = sitofp i32 %0 to float
%13 = fcmp olt float %12, %3
%14 = fcmp ogt float %12, %5
%15 = or i1 %13, %14
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %11, %6
%18 = phi i32 [ 1, %6 ], [ %16, %11 ]
ret i32 %18
}
/* Variables and functions */
int SOCK_CLOEXEC;
int SOCK_NONBLOCK;
int socket(int, int, int);
int us_socket(int domain, int type, int protocol) {
  return socket(domain, type | SOCK_NONBLOCK | SOCK_CLOEXEC, protocol);
}


x86 assembly (clang, -O0):
<us_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eaa(%rip),%rax
or     (%rax),%esi
mov    0x2eb9(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<us_socket>:
mov    0x2ec1(%rip),%rax
or     (%rax),%esi
mov    0x2ed0(%rip),%rax
or     (%rax),%esi
jmp    1030 <socket@plt>

LLVM IR (-O0):
@SOCK_NONBLOCK = global i32 0
@SOCK_CLOEXEC = global i32 0
define i32 @us_socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* @SOCK_NONBLOCK
%10 = or i32 %8, %9
%11 = load i32, i32* @SOCK_CLOEXEC
%12 = or i32 %10, %11
%13 = load i32, i32* %6
%14 = call i32 @socket(i32 %7, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@SOCK_NONBLOCK = global i32 0
@SOCK_CLOEXEC = global i32 0
define i32 @us_socket(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SOCK_NONBLOCK
%5 = or i32 %4, %1
%6 = load i32, i32* @SOCK_CLOEXEC
%7 = or i32 %5, %6
%8 = tail call i32 @socket(i32 %0, i32 %7, i32 %2)
ret i32 %8
}
/* Variables and functions */
scalar_t__ mib_set(scalar_t__, void *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ restart_urlblocking();
int setUrlBlockingCapability(char enabled) {
  if (mib_set(0 + 73, (void *)&enabled) == 0) {
    printf("Set enabled flag error!\n");
    return -1;
  }
  restart_urlblocking();
  return 0;
}


x86 assembly (clang, -O0):
<setUrlBlockingCapability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x49,%edi
lea    -0x5(%rbp),%rsi
call   1030 <mib_set@plt>
cmp    $0x0,%rax
jne    116e <setUrlBlockingCapability+0x3e>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <setUrlBlockingCapability+0x4c>
mov    $0x0,%al
call   1050 <restart_urlblocking@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setUrlBlockingCapability>:
push   %rbx
sub    $0x10,%rsp
mov    %dil,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x49,%edi
call   1040 <mib_set@plt>
test   %rax,%rax
je     1159 <setUrlBlockingCapability+0x29>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <restart_urlblocking@plt>
jmp    116a <setUrlBlockingCapability+0x3a>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Set enabled flag error!\0A\00"
define i32 @setUrlBlockingCapability(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i64 @mib_set(i64 73, i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 (...) @restart_urlblocking()
store i32 0, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@str = [24 x i8] c"Set enabled flag error!\00"
define i32 @setUrlBlockingCapability(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i64 @mib_set(i64 73, i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 (...) @restart_urlblocking()
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
unsigned int SwapULong(unsigned int in) {
  char sin[4];
  char sout[4];
  memcpy((char *)sin, (char *)&in, 4);
  sout[0] = sin[3];
  sout[1] = sin[2];
  sout[2] = sin[1];
  sout[3] = sin[0];
  return *((unsigned int *)sout);
}


x86 assembly (clang, -O0):
<SwapULong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x5(%rbp),%al
mov    %al,-0xc(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapULong>:
push   %rax
mov    %edi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
bswap  %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SwapULong(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 4)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%9 = load i8, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 %9, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%15 = load i8, i8* %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %15, i8* %16
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%18 = load i8, i8* %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 %18, i8* %19
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @SwapULong(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 4)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%8 = load i8, i8* %7
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%12 = load i8, i8* %11
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = shl nuw i32 %14, 24
%16 = zext i8 %12 to i32
%17 = shl nuw nsw i32 %16, 16
%18 = zext i8 %10 to i32
%19 = shl nuw nsw i32 %18, 8
%20 = zext i8 %8 to i32
%21 = or i32 %19, %20
%22 = or i32 %21, %17
%23 = or i32 %22, %15
ret i32 %23
}
int ED2K_is_msg(int type, int subtype) {
  switch (type) {
  case 0xe3:
    switch (subtype) {
    case 0x4E:
      return 1;
    default:
      return 0;
    }
    break;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ED2K_is_msg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xe3,%eax
jne    1146 <ED2K_is_msg+0x46>
jmp    111d <ED2K_is_msg+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x4e,%eax
jne    113a <ED2K_is_msg+0x3a>
jmp    112e <ED2K_is_msg+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    114d <ED2K_is_msg+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    114d <ED2K_is_msg+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ED2K_is_msg>:
xor    $0xe3,%edi
xor    $0x4e,%esi
xor    %eax,%eax
or     %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @ED2K_is_msg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %11 [
i32 227, label %7
]
7: ; preds = %2
%8 = load i32, i32* %5
switch i32 %8, label %10 [
i32 78, label %9
]
9: ; preds = %7
store i32 1, i32* %3
br label %12
10: ; preds = %7
store i32 0, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10, %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @ED2K_is_msg(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 227
%4 = icmp eq i32 %1, 78
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}