xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void u24_to_bigendian(uint8_t *dst, uint32_t u24) {
  dst[0] = (u24 >> 16) & 0xFF;
  dst[1] = (u24 >> 8) & 0xFF;
  dst[2] = u24 & 0xFF;
}


x86 assembly (clang, -O0):
<u24_to_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u24_to_bigendian>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,(%rdi)
mov    %ecx,0x4(%rdi)
mov    %edx,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @u24_to_bigendian(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %6, i32* %7
%8 = and i32 %1, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
ret void
}
int play_state_pause(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @play_state_pause() {
ret i32 0
}
/* Variables and functions */
__attribute__((deprecated)) char *snd_device_name_get_hint(const void *hint,
                                                           const char *id) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @snd_device_name_get_hint(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
float i(float x) { return x * (x <= 0.f ? -1.f : 1.f); }


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xee5(%rip),%xmm4
movss  0xee1(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpless %xmm2,%xmm1
movaps %xmm1,%xmm2
andps  %xmm4,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpless %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @i(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp ole float %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, float -1.000000e+00, float 1.000000e+00
%8 = fmul float %3, %7
ret float %8
}

LLVM IR (-O2):
define float @i(float %0) {
%2 = fcmp ole float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_from_montgomery(uintptr_t, uintptr_t);
void fiat_p256_from_montgomery(uint32_t out1[8], const uint32_t arg1[8]) {
  internal_fiat_p256_from_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_from_montgomery>:
jmp    1030 <internal_fiat_p256_from_montgomery@plt>

LLVM IR (-O0):
define void @fiat_p256_from_montgomery(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_from_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_from_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_from_montgomery(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nHELLO WORLD!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"\0AHELLO WORLD!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *open_file(char *file_path, char *op) {
  FILE *fp;
  if (!(fp = fopen(file_path, op))) {
    perror("File open error!");
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1171 <open_file+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rax
call   1030 <fopen@plt>
test   %rax,%rax
je     113d <open_file+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"File open error!\00"
define i32* @open_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"File open error!\00"
define noalias i32* @open_file(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
int fun1302() { return 1302; }


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

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

LLVM IR (-O0):
define i32 @fun1302() {
ret i32 1302
}

LLVM IR (-O2):
define i32 @fun1302() {
ret i32 1302
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _resize_error(char const *message, int ret) {
  fputs("resize"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_resize_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_resize_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"resize: \00"
@stderr = global i32 0
define i32 @_resize_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"resize: \00"
@stderr = global i32 0
define i32 @_resize_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
void __attribute__((weak)) dma1_channel2_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dma1_channel2_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma1_channel2_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma1_channel2_isr = [18 x i8] c"dma1_channel2_isr\00"
define weak void @dma1_channel2_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.dma1_channel2_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma1_channel2_isr = [18 x i8] c"dma1_channel2_isr\00"
define weak void @dma1_channel2_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.dma1_channel2_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __syscall(char const *, int /*<<< orphan*/, int /*<<< orphan*/,
              int /*<<< orphan*/, int);
int unlink(const char *filename) { return __syscall(filename, 0, 0, 0, 0x407); }


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %ecx,%ecx
mov    $0x407,%r8d
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x407,%r8d
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = tail call i32 @__syscall(i8* %0, i32 0, i32 0, i32 0, i32 1031)
ret i32 %2
}
/* Variables and functions */
int munlock(void *, int);
int munlockall(void) { return munlock((void *)0x10000, 0xffff0000UL); }


x86 assembly (clang, -O0):
<munlockall>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000,%edi
mov    $0xffff0000,%esi
call   1030 <munlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<munlockall>:
mov    $0x10000,%edi
mov    $0xffff0000,%esi
jmp    1030 <munlock@plt>

LLVM IR (-O0):
define i32 @munlockall() {
%1 = call i32 @munlock(i8* inttoptr (i64 65536 to i8*), i32 -65536)
ret i32 %1
}

LLVM IR (-O2):
define i32 @munlockall() {
%1 = tail call i32 @munlock(i8* inttoptr (i64 65536 to i8*), i32 -65536)
ret i32 %1
}
/* Variables and functions */
const char *chr2esc(char c) {
  switch (c) {
  case '"':
    return "\\\"";
  case '\n':
    return "\\n";
  case '\\':
    return "\\\\";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<chr2esc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xa,%eax
je     1151 <chr2esc+0x51>
jmp    111f <chr2esc+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x22,%eax
je     1141 <chr2esc+0x41>
jmp    1130 <chr2esc+0x30>
mov    -0x10(%rbp),%eax
sub    $0x5c,%eax
je     1161 <chr2esc+0x61>
jmp    1171 <chr2esc+0x71>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <chr2esc+0x79>
lea    0xeab(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <chr2esc+0x79>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <chr2esc+0x79>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr2esc>:
cmp    $0x5c,%edi
je     1117 <chr2esc+0x17>
cmp    $0x22,%edi
je     111f <chr2esc+0x1f>
cmp    $0xa,%edi
jne    1127 <chr2esc+0x27>
lea    0xeed(%rip),%rax
ret
lea    0xee8(%rip),%rax
ret
lea    0xeda(%rip),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\\\22\00"
@.str.1 = [3 x i8] c"\\n\00"
@.str.2 = [3 x i8] c"\\\\\00"
define i8* @chr2esc(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 34, label %6
i32 10, label %7
i32 92, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* null, i8** %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\\22\00"
@.str.1 = [3 x i8] c"\\n\00"
@.str.2 = [3 x i8] c"\\\\\00"
define i8* @chr2esc(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 34, label %6
i32 10, label %3
i32 92, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i8* [ null, %5 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}
int test_imm_0Cint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x0C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Cint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Cint64_highword_mem>:
testb  $0xc,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Cint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 51539607552
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ heap_sort(int *, int);
int /*<<< orphan*/ insertion_sort(int *, int);
void sort(int array[], int num_of_elements) {
  if (num_of_elements < 1000) {
    insertion_sort(array, num_of_elements);
  } else {
    heap_sort(array, num_of_elements);
  }
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    114d <sort+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <insertion_sort@plt>
jmp    1159 <sort+0x39>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <heap_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x3e7,%esi
jg     112d <sort+0xd>
jmp    1040 <insertion_sort@plt>
jmp    1030 <heap_sort@plt>

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

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 1000
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @insertion_sort(i32* %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @heap_sort(i32* %0, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __Monicelli_abort() { abort(); }


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

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

LLVM IR (-O0):
define void @__Monicelli_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__Monicelli_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
int fib(int num) {
  if (num == 0)
    return 0;
  else if (num == 1)
    return 1;
  return fib(num - 1) + fib(num - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116f <fib+0x5f>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116f <fib+0x5f>
jmp    114c <fib+0x3c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Type definitions */
struct splaytree_node {
  int dummy;
};

/* Variables and functions */
struct splaytree_node *get_right(struct splaytree_node *);
struct splaytree_node *get_last(struct splaytree_node *node) {
  struct splaytree_node *right;
  while ((right = get_right(node)))
    node = right;
  return node;
}


x86 assembly (clang, -O0):
<get_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_right@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1140 <get_last+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    111c <get_last+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_last>:
push   %rbx
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <get_right@plt>
test   %rax,%rax
jne    1120 <get_last+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.splaytree_node = type { i32 }
define %struct.splaytree_node* @get_last(%struct.splaytree_node* %0) {
%2 = alloca %struct.splaytree_node*
%3 = alloca %struct.splaytree_node*
store %struct.splaytree_node* %0, %struct.splaytree_node** %2
br label %4
4: ; preds = %8, %1
%5 = load %struct.splaytree_node*, %struct.splaytree_node** %2
%6 = call %struct.splaytree_node* @get_right(%struct.splaytree_node* %5)
store %struct.splaytree_node* %6, %struct.splaytree_node** %3
%7 = icmp ne %struct.splaytree_node* %6, null
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load %struct.splaytree_node*, %struct.splaytree_node** %3
store %struct.splaytree_node* %9, %struct.splaytree_node** %2
br label %4
10: ; preds = %4
%11 = load %struct.splaytree_node*, %struct.splaytree_node** %2
ret %struct.splaytree_node* %11
}

LLVM IR (-O2):
%struct.splaytree_node = type { i32 }
define %struct.splaytree_node* @get_last(%struct.splaytree_node* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi %struct.splaytree_node* [ %0, %1 ], [ %4, %2 ]
%4 = tail call %struct.splaytree_node* @get_right(%struct.splaytree_node* %3)
%5 = icmp eq %struct.splaytree_node* %4, null
br i1 %5, label %6, label %2
6: ; preds = %2
ret %struct.splaytree_node* %3
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int *);
int hi_get_rcvbuf(int sd) {
  int status, size;
  socklen_t len;
  size = 0;
  len = sizeof(size);
  status = getsockopt(sd, SOL_SOCKET, SO_RCVBUF, &size, &len);
  if (status < 0) {
    return status;
  }
  return size;
}


x86 assembly (clang, -O0):
<hi_get_rcvbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1163 <hi_get_rcvbuf+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <hi_get_rcvbuf+0x59>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_get_rcvbuf>:
push   %rax
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
test   %eax,%eax
js     1146 <hi_get_rcvbuf+0x36>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @hi_get_rcvbuf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %5
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = load i32, i32* @SOL_SOCKET
%9 = load i32, i32* @SO_RCVBUF
%10 = call i32 @getsockopt(i32 %7, i32 %8, i32 %9, i32* %5, i32* %6)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @hi_get_rcvbuf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %2
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVBUF
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp slt i32 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i32 %8, i32 %10
ret i32 %11
}
double epb2mjd(epoch)
double epoch;
{ return (15019.81352 + ((epoch - 1900.0) * 365.242198781)); }


x86 assembly (clang, -O0):
<epb2mjd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<epb2mjd>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @epb2mjd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.900000e+03
%5 = call double @llvm.fmuladd.f64(double %4, double 0x4076D3E00BD4386B, double 0x40CD55E8216C6152)
ret double %5
}

LLVM IR (-O2):
define double @epb2mjd(double %0) {
%2 = fadd double %0, -1.900000e+03
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x4076D3E00BD4386B, double 0x40CD55E8216C6152)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Led2__toggle();
void LedsP__Leds__led2Toggle(void) {
  LedsP__Led2__toggle();
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Leds__led2Toggle() {
%1 = tail call i32 (...) @LedsP__Led2__toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int i = 10, j = 5, k = 0;
  k = (i++) > (++j) ? (i++) : (++j);
  printf("%d..%d..%d", i, j, k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    %ecx,%eax
jle    1163 <main+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x14(%rbp)
jmp    116f <main+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d..%d..%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 12, i32 6, i32 11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ overflow();
int main() {
  overflow();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @overflow()
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
scalar_t__ init_mysql();
int /*<<< orphan*/ print_mysql_error(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("!!!Hello World!!!");
  if (init_mysql())
    ;
  print_mysql_error(NULL);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <init_mysql@plt>
cmp    $0x0,%rax
je     1161 <main+0x31>
jmp    1161 <main+0x31>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <print_mysql_error@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <init_mysql@plt>
xor    %edi,%edi
call   1050 <print_mysql_error@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @init_mysql()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
%7 = call i32 @print_mysql_error(i32* null)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @init_mysql()
%3 = tail call i32 @print_mysql_error(i32* null)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
struct dstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DSAppendChar(struct dstring *, char);
void DSAppendString(struct dstring *pds, char *str) {
  while (*str) {
    DSAppendChar(pds, *str);
    ++str;
  }
}


x86 assembly (clang, -O0):
<DSAppendString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <DSAppendString+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <DSAppendChar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <DSAppendString+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSAppendString>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <DSAppendString+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <DSAppendChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <DSAppendString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dstring = type { i32 }
define void @DSAppendString(%struct.dstring* %0, i8* %1) {
%3 = alloca %struct.dstring*
%4 = alloca i8*
store %struct.dstring* %0, %struct.dstring** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load %struct.dstring*, %struct.dstring** %3
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = call i32 @DSAppendChar(%struct.dstring* %10, i8 signext %12)
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.dstring = type { i32 }
define void @DSAppendString(%struct.dstring* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 @DSAppendChar(%struct.dstring* %0, i8 signext %6)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_initialize_number_of_multprec_polynomials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(443, &length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_multprec_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1bb,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_multprec_polynomials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1bb,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_initialize_number_of_multprec_polynomials(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 443, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_multprec_polynomials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 443, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
void file2() { printf("Control in function %s\n", __func__); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file2 = [6 x i8] c"file2\00"
define void @file2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file2 = [6 x i8] c"file2\00"
define void @file2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
int /*<<< orphan*/ mbsinit(int /*<<< orphan*/ *);
void uninitvar_mbsinit(void) {
  mbstate_t *ps;
  (void)mbsinit(ps);
}


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

x86 assembly (clang, -O2):
<uninitvar_mbsinit>:
jmp    1030 <mbsinit@plt>

LLVM IR (-O0):
define void @uninitvar_mbsinit() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @mbsinit(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_mbsinit() {
%1 = tail call i32 @mbsinit(i32* undef)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int redhttp_negotiate_compare_types(const char *server_type,
                                    const char *client_type) {
  if (strcmp(client_type, "*/*") == 0) {
    return 1;
  } else {
    return strcmp(server_type, client_type) == 0;
  }
}


x86 assembly (clang, -O0):
<redhttp_negotiate_compare_types>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <redhttp_negotiate_compare_types+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1162 <redhttp_negotiate_compare_types+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redhttp_negotiate_compare_types>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1146 <redhttp_negotiate_compare_types+0x36>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    114b <redhttp_negotiate_compare_types+0x3b>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"*/*\00"
define i32 @redhttp_negotiate_compare_types(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %0, i8* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 1, %2 ]
ret i32 %10
}
double fract1_1_14_to_float(unsigned short val) {
  double ret = (double)(val & 0x7FFF) / 0x4000UL;
  if (val & 0x8000)
    return -ret;
  return ret;
}


x86 assembly (clang, -O0):
<fract1_1_14_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1161 <fract1_1_14_to_float+0x61>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116b <fract1_1_14_to_float+0x6b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fract1_1_14_to_float>:
mov    %edi,%eax
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xeed(%rip),%xmm0
test   $0x8000,%edi
je     1123 <fract1_1_14_to_float+0x23>
xorpd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fract1_1_14_to_float(i16 zeroext %0) {
%2 = alloca double
%3 = alloca i16
%4 = alloca double
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 32767
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.638400e+04
store double %9, double* %4
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = and i32 %11, 32768
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load double, double* %4
%16 = fneg double %15
store double %16, double* %2
br label %19
17: ; preds = %1
%18 = load double, double* %4
store double %18, double* %2
br label %19
19: ; preds = %17, %14
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @fract1_1_14_to_float(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = and i32 %2, 32767
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3F10000000000000
%6 = and i32 %2, 32768
%7 = icmp eq i32 %6, 0
%8 = fneg double %5
%9 = select i1 %7, double %5, double %8
ret double %9
}
int fun122() { return 122; }


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

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

LLVM IR (-O0):
define i32 @fun122() {
ret i32 122
}

LLVM IR (-O2):
define i32 @fun122() {
ret i32 122
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int open_port();
int /*<<< orphan*/ read_port(int *, char **);
int /*<<< orphan*/ setup_port(int *);
int write_port(int *, char *);
void send_message(char *str, char **replay_msg) {
  int fd, w;
  fd = open_port();
  setup_port(&fd);
  w = write_port(&fd, str);
  if (w > 0)
    read_port(&fd, replay_msg);
  close(fd);
}


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <open_port@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <setup_port@plt>
mov    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1060 <write_port@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    119a <send_message+0x4a>
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1030 <read_port@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1070 <open_port@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <setup_port@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <write_port@plt>
test   %eax,%eax
jle    1193 <send_message+0x43>
lea    0xc(%rsp),%rdi
mov    %r14,%rsi
call   1030 <read_port@plt>
mov    0xc(%rsp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @send_message(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
%7 = call i32 (...) @open_port()
store i32 %7, i32* %5
%8 = call i32 @setup_port(i32* %5)
%9 = load i8*, i8** %3
%10 = call i32 @write_port(i32* %5, i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = call i32 @read_port(i32* %5, i8** %14)
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %5
%18 = call i32 @close(i32 %17)
ret void
}

LLVM IR (-O2):
define void @send_message(i8* %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @open_port()
store i32 %5, i32* %3
%6 = call i32 @setup_port(i32* %3)
%7 = call i32 @write_port(i32* %3, i8* %0)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @read_port(i32* %3, i8** %1)
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %3
%13 = call i32 @close(i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Cryption under construction!");
  puts("Updates coming soon!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Cryption under construction!\00"
@.str.1 = [21 x i8] c"Updates coming soon!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Cryption under construction!\00"
@.str.1 = [21 x i8] c"Updates coming soon!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void C2Mod1Function1() { printf("Expected message: C2Mod1Function1.\n"); }


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"Expected message: C2Mod1Function1.\00"
define void @C2Mod1Function1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(void) {
  char *help = ""
               "Usage: jail-cmd [command] [args]\n"
               "run jail command.\n"
               "press CTRL+] to exit.\n";
  printf("%s", help);
}


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

x86 assembly (clang, -O2):
<help>:
lea    0xf33(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"Usage: jail-cmd [command] [args]\0Arun jail command.\0Apress CTRL+] to exit.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"Usage: jail-cmd [command] [args]\0Arun jail command.\0Apress CTRL+] to exit.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
ret void
}