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

/* Variables and functions */
uint64_t ptr_to_u64(const void *ptr) { return (uint64_t)(unsigned long)ptr; }


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

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

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

LLVM IR (-O2):
define i32 @ptr_to_u64(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
float __ocml_exp10_f32(float);
float exp10f(float x) { return __ocml_exp10_f32(x); }


x86 assembly (clang, -O0):
<exp10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_exp10_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp10f>:
jmp    1030 <__ocml_exp10_f32@plt>

LLVM IR (-O0):
define float @exp10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__ocml_exp10_f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @exp10f(float %0) {
%2 = tail call float @__ocml_exp10_f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int dns_close_pipe(int fd) {
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<dns_close_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dns_close_pipe(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int testfunc(int);
int main() {
  printf("return = %d\n", testfunc(10));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"return = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @testfunc(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"return = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @testfunc(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double clock();
int /*<<< orphan*/ parse_code(char *, char *);
int /*<<< orphan*/ printf(char *, double);
void decode(char *input_file, char *output_file) {
  clock_t start_time = clock();
  parse_code(input_file, output_file);
  clock_t end_time = clock();
  printf("time of decoding: \t\t%lf\n",
         ((double)end_time - start_time) / CLOCKS_PER_SEC);
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <parse_code@plt>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mov    0x2e72(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <parse_code@plt>
xor    %eax,%eax
call   1030 <clock@plt>
subsd  (%rsp),%xmm0
mov    0x2e84(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe91(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"time of decoding: \09\09%lf\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @decode(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call double (...) @clock()
store double %7, double* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @parse_code(i8* %8, i8* %9)
%11 = call double (...) @clock()
store double %11, double* %6
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = load double, double* @CLOCKS_PER_SEC
%16 = fdiv double %14, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %16)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"time of decoding: \09\09%lf\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @decode(i8* %0, i8* %1) {
%3 = tail call double (...) @clock()
%4 = tail call i32 @parse_code(i8* %0, i8* %1)
%5 = tail call double (...) @clock()
%6 = fsub double %5, %3
%7 = load double, double* @CLOCKS_PER_SEC
%8 = fdiv double %6, %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}
/* Variables and functions */
void *malloc(unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long, void *);
void *my_malloc(unsigned long s) {
  void *p = malloc(s);
  printf(">>> malloc %lu\t-> 0x%8.8X\n", s, p);
  return p;
}


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

x86 assembly (clang, -O2):
<my_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c">>> malloc %lu\09-> 0x%8.8X\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [27 x i8] c">>> malloc %lu\09-> 0x%8.8X\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ uartB_putc(char);
void uartB_puts(const char *s) {
  while (*s) {
    if (*s == '\n') {
      uartB_putc('\r');
    }
    uartB_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<uartB_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <uartB_puts+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <uartB_puts+0x33>
mov    $0xd,%edi
call   1030 <uartB_putc@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uartB_putc@plt>
jmp    111c <uartB_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uartB_puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <uartB_puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <uartB_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <uartB_putc@plt>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <uartB_puts+0x10>
test   %al,%al
jne    112d <uartB_puts+0x1d>
pop    %rbx
ret

LLVM IR (-O0):
define void @uartB_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %14, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @uartB_putc(i8 signext 13)
br label %14
14: ; preds = %12, %7
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
%17 = load i8, i8* %15
%18 = call i32 @uartB_putc(i8 signext %17)
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @uartB_puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @uartB_putc(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i32 @uartB_putc(i8 signext %9)
br label %2
12: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t(int);
m() { t(1); }


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <t@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
mov    $0x1,%edi
jmp    1030 <t@plt>

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

LLVM IR (-O2):
define i32 @m() {
%1 = tail call i32 @t(i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void DisplayUsage(void) {
  {
    fprintf(
        stderr, "%s\n",
        "usage: xy2ll [-v] mppfile <xy.txt >xyll.txt\n"
        "\n"
        " input : mppfile - grid parameters definition file\n"
        "         xy.txt - (from stdin) ascii text containing x and y values\n"
        "\n"
        " output: xyll.txt - (to stdout) ascii text containing x, y, lat, lon, "
        "and\n"
        "                    status values\n"
        "\n"
        " options:v - verbose\n"
        "\n");
    exit(EXIT_FAILURE);
  };
}


x86 assembly (clang, -O0):
<DisplayUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xec9(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<DisplayUsage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecc(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [297 x i8] c"usage: xy2ll [-v] mppfile <xy.txt >xyll.txt\0A\0A input : mppfile - grid parameters definition file\0A xy.txt - (from stdin) ascii text containing x and y values\0A\0A output: xyll.txt - (to stdout) ascii text containing x, y, lat, lon, and\0A status values\0A\0A options:v - verbose\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @DisplayUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([297 x i8], [297 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [297 x i8] c"usage: xy2ll [-v] mppfile <xy.txt >xyll.txt\0A\0A input : mppfile - grid parameters definition file\0A xy.txt - (from stdin) ascii text containing x and y values\0A\0A output: xyll.txt - (to stdout) ascii text containing x, y, lat, lon, and\0A status values\0A\0A options:v - verbose\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @DisplayUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([297 x i8], [297 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
double asinf(double);
double asin(double arg) { return asinf(arg); }


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

x86 assembly (clang, -O2):
<asin>:
jmp    1030 <asinf@plt>

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @asinf(double %3)
ret double %4
}

LLVM IR (-O2):
define double @asin(double %0) {
%2 = tail call double @asinf(double %0)
ret double %2
}
void foo(int **a) {
  int b = 1;
  **a = b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rax
movl   $0x1,(%rax)
ret

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

LLVM IR (-O2):
define void @foo(i32** nocapture %0) {
%2 = load i32*, i32** %0
store i32 1, i32* %2
ret void
}
/* Variables and functions */
int _moncom(int, void *, void *, void *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_com(int cmd, void *arg1, void *arg2, void *arg3) {
  int ret;
  monLock();
  ret = _moncom(cmd, arg1, arg2, arg3);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_com>:
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    $0x0,%al
call   1040 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <_moncom@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_com>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <_moncom@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_com(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = call i32 (...) @monLock()
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 @_moncom(i32 %11, i8* %12, i8* %13, i8* %14)
store i32 %15, i32* %9
%16 = call i32 (...) @monUnlock()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
define i32 @mon_com(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 (...) @monLock()
%6 = tail call i32 @_moncom(i32 %0, i8* %1, i8* %2, i8* %3)
%7 = tail call i32 (...) @monUnlock()
ret i32 %6
}
/* Variables and functions */
double HUGE_VAL;
double dirac_delta(double x) {
  if (x == 0.0) {
    return HUGE_VAL;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<dirac_delta>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1136 <dirac_delta+0x36>
jp     1136 <dirac_delta+0x36>
mov    0x2ec0(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113e <dirac_delta+0x3e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirac_delta>:
mov    0x2ee1(%rip),%rax
xorpd  %xmm1,%xmm1
cmpeqsd %xmm1,%xmm0
movsd  (%rax),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define double @dirac_delta(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* @HUGE_VAL
store double %7, double* %2
br label %9
8: ; preds = %1
store double 0.000000e+00, double* %2
br label %9
9: ; preds = %8, %6
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define double @dirac_delta(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = load double, double* @HUGE_VAL
%4 = select i1 %2, double %3, double 0.000000e+00
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int popen2_impl(int /*<<< orphan*/ **, char const *, char const *const *,
                int /*<<< orphan*/ *, int, char const *);
FILE *popen_arr(const char *program, const char *const argv[],
                const char *mode) {
  FILE *f = NULL;
  int ret = popen2_impl(&f, program, argv, NULL, 1, mode);
  (void)ret;
  return f;
}


x86 assembly (clang, -O0):
<popen_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%r9
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%r8d
call   1030 <popen2_impl@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popen_arr>:
push   %rax
mov    %rdx,%r9
mov    %rsi,%rdx
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    %rsp,%rdi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <popen2_impl@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @popen_arr(i8* %0, i8** %1, i8* %2) {
%4 = alloca i32*
%5 = bitcast i32** %4 to i8*
store i32* null, i32** %4
%6 = call i32 @popen2_impl(i32** %4, i8* %0, i8** %1, i32* null, i32 1, i8* %2)
%7 = load i32*, i32** %4
ret i32* %7
}
/* Variables and functions */
char *strstr(char *, char *);
char *bot_nick_exists(char *str, char *nick) {
  char *searchstr = strstr(str, nick);
  if (searchstr) {
    return "0";
  }
  return "1";
}


x86 assembly (clang, -O0):
<bot_nick_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114c <bot_nick_exists+0x3c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <bot_nick_exists+0x47>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_nick_exists>:
push   %rax
call   1030 <strstr@plt>
test   %rax,%rax
lea    0xee2(%rip),%rcx
lea    0xed9(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
define i8* @bot_nick_exists(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rabourn17() { printf("rabourn17 likes pizza.\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"rabourn17 likes pizza.\00"
define void @rabourn17() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmallocd(size_t s, char *descrl) {
  void *new = (void *)malloc(s);
  if (!new)
    fprintf(stderr, "mplib: Memory exhausted: Could not allocate %d bytes\n",
            s);
  return new;
}


x86 assembly (clang, -O0):
<xmallocd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <xmallocd+0x41>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmallocd>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xmallocd+0x2c>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"mplib: Memory exhausted: Could not allocate %d bytes\0A\00"
define i8* @xmallocd(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i64, i64* %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"mplib: Memory exhausted: Could not allocate %d bytes\0A\00"
define i8* @xmallocd(i64 %0, i8* nocapture readnone %1) {
%3 = tail call i64 @malloc(i64 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %8
8: ; preds = %5, %2
%9 = inttoptr i64 %3 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
extern double printd(double X) {
  printf("%f\n", X);
  return 0;
}


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

x86 assembly (clang, -O2):
<printd>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define double @printd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define double @printd(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret double 0.000000e+00
}
int fun1347() { return 1347; }


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

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

LLVM IR (-O0):
define i32 @fun1347() {
ret i32 1347
}

LLVM IR (-O2):
define i32 @fun1347() {
ret i32 1347
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int C_S_ISREG(mode_t mode) { return S_ISREG(mode); }


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

x86 assembly (clang, -O2):
<C_S_ISREG>:
jmp    1030 <S_ISREG@plt>

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

LLVM IR (-O2):
define i32 @C_S_ISREG(i32 %0) {
%2 = tail call i32 @S_ISREG(i32 %0)
ret i32 %2
}
float Activator_Step(float Input) {
  if (Input > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Activator_Step>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    112c <Activator_Step+0x2c>
movss  0xede(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1134 <Activator_Step+0x34>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Activator_Step>:
xorps  %xmm1,%xmm1
cmpltss %xmm0,%xmm1
movss  0xef0(%rip),%xmm0
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Activator_Step(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %2
br label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %8
8: ; preds = %7, %6
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @Activator_Step(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = select i1 %2, float 1.000000e+00, float 0.000000e+00
ret float %3
}
/* Variables and functions */
int fork();
int vfork() { return (fork()); }


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

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

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

LLVM IR (-O2):
define i32 @vfork() {
%1 = tail call i32 (...) @fork()
ret i32 %1
}
/* Variables and functions */
int GetInput();
int /*<<< orphan*/ printf(char *, int);
void BasicDoWhileLoop() {
  int x = 0;
  int condition = GetInput();
  do {
    printf("Executed %d times \n", x);
    x++;
  } while (x < condition);
}


x86 assembly (clang, -O0):
<BasicDoWhileLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GetInput@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1139 <BasicDoWhileLoop+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BasicDoWhileLoop>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <GetInput@plt>
cmp    $0x2,%eax
mov    $0x1,%ebp
cmovge %eax,%ebp
lea    0xec1(%rip),%r14
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <BasicDoWhileLoop+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Executed %d times \0A\00"
define void @BasicDoWhileLoop() {
%1 = tail call i32 (...) @GetInput()
%2 = call i32 @llvm.smax.i32(i32 %1, i32 1)
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %2
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
float pow(float, int);
float hypot(float x, float y) { return pow(x, 2) + pow(y, 2); }


x86 assembly (clang, -O0):
<hypot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypot>:
push   %rax
movss  %xmm1,0x4(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @hypot(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @pow(float %5, i32 2)
%7 = load float, float* %4
%8 = call float @pow(float %7, i32 2)
%9 = fadd float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @hypot(float %0, float %1) {
%3 = tail call float @pow(float %0, i32 2)
%4 = tail call float @pow(float %1, i32 2)
%5 = fadd float %3, %4
ret float %5
}
/* Variables and functions */
int getopt(int, char **, char *);
int /*<<< orphan*/ usage();
int commandline(int argc, char **argv) {
  int opt;
  while ((opt = getopt(argc, argv, "c:f")) != -1) {
    switch (opt) {
    default:
      usage();
      break;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<commandline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     115a <commandline+0x3a>
mov    $0x0,%al
call   1030 <usage@plt>
jmp    112f <commandline+0xf>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandline>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed0(%rip),%rdx
call   1040 <getopt@plt>
cmp    $0xffffffff,%eax
je     1169 <commandline+0x49>
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <getopt@plt>
cmp    $0xffffffff,%eax
jne    1150 <commandline+0x30>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"c:f\00"
define i32 @commandline(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @usage()
%7 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %5
9: ; preds = %5, %2
ret i32 1
}
void av_vorbis_parse_init() {}


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

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

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

LLVM IR (-O2):
define void @av_vorbis_parse_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
int sysconf(int /*<<< orphan*/);
int get_user_hz(void) { return sysconf(_SC_CLK_TCK); }


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

x86 assembly (clang, -O2):
<get_user_hz>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
define i32 @get_user_hz() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define i32 @get_user_hz() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Type definitions */
struct vec2i {
  int dummy;
};
struct vec2 {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_ceil(int /*<<< orphan*/ *, float *);
__attribute__((always_)) struct vec2i *psvec2i_ceil(struct vec2i *result,
                                                    struct vec2 *a) {
  vec2i_ceil((int32_t *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec2i_ceil>:
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 <vec2i_ceil@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2i_ceil>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_ceil@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
%struct.vec2 = type { i32 }
define %struct.vec2i* @psvec2i_ceil(%struct.vec2i* %0, %struct.vec2* %1) {
%3 = alloca %struct.vec2i*
%4 = alloca %struct.vec2*
store %struct.vec2i* %0, %struct.vec2i** %3
store %struct.vec2* %1, %struct.vec2** %4
%5 = load %struct.vec2i*, %struct.vec2i** %3
%6 = bitcast %struct.vec2i* %5 to i32*
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = call i32 @vec2i_ceil(i32* %6, float* %8)
%10 = load %struct.vec2i*, %struct.vec2i** %3
ret %struct.vec2i* %10
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
%struct.vec2 = type { i32 }
define %struct.vec2i* @psvec2i_ceil(%struct.vec2i* returned %0, %struct.vec2* %1) {
%3 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call i32 @vec2i_ceil(i32* %3, float* %4)
ret %struct.vec2i* %0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void system_timer_init(void) {
  outb(0x43, 0x34);
  outb(0x40, ((1193180 + 100 / 2) / 100) & 0xff);
  outb(0x40, ((1193180 + 100 / 2) / 100) >> 8);
}


x86 assembly (clang, -O0):
<system_timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x9c,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x2e,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_timer_init>:
push   %rax
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x9c,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x2e,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @system_timer_init() {
%1 = call i32 @outb(i32 67, i32 52)
%2 = call i32 @outb(i32 64, i32 156)
%3 = call i32 @outb(i32 64, i32 46)
ret void
}

LLVM IR (-O2):
define void @system_timer_init() {
%1 = tail call i32 @outb(i32 67, i32 52)
%2 = tail call i32 @outb(i32 64, i32 156)
%3 = tail call i32 @outb(i32 64, i32 46)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, char *);
int getpid();
int gettid();
int /*<<< orphan*/ stderr;
void whoami(char *msg) {
  fprintf(stderr, "pid %d Thread %d %s\n", getpid(), gettid(), msg);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<whoami>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
lea    0xe84(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whoami>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e8f(%rip),%r15
mov    (%r15),%ebp
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xe95(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %eax,%ecx
mov    %r14,%r8
call   1050 <fprintf@plt>
mov    (%r15),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"pid %d Thread %d %s\0A\00"
define void @whoami(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (...) @getpid()
%5 = call i32 (...) @gettid()
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"pid %d Thread %d %s\0A\00"
define void @whoami(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (...) @gettid()
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
ret void
}
long addsi3(long a, long b) { return a + b; }


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

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

LLVM IR (-O0):
define i64 @addsi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @addsi3(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
scalar_t__ pcg32_int();
double pcg32_float() { return ((double)pcg32_int()) / (1LL << 32); }


x86 assembly (clang, -O0):
<pcg32_float>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pcg32_int@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg32_float>:
push   %rax
xor    %eax,%eax
call   1030 <pcg32_int@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pcg32_float() {
%1 = call i64 (...) @pcg32_int()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41F0000000000000
ret double %3
}

LLVM IR (-O2):
define double @pcg32_float() {
%1 = tail call i64 (...) @pcg32_int()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}
int procnum() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @procnum() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void jp_rj(unsigned char saut) {
  put8(0x7A);
  put8(saut);
}


x86 assembly (clang, -O0):
<jp_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7a,%edi
call   1030 <put8@plt>
movzbl -0x1(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jp_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0x7a,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jp_rj(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 122)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @jp_rj(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 122)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
void test05(int flag, int num) {
  {
    if (flag)
      num = 0;
    (num = 1);
  };
}


x86 assembly (clang, -O0):
<test05>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111b <test05+0x1b>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test05(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 0, i32* %4
br label %8
8: ; preds = %7, %2
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
define void @test05(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBClockDisable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) = 0;
}


x86 assembly (clang, -O0):
<USBClockDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBClockDisable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
movl   $0x0,0xfc8(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @USBClockDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 4040
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 0, i32* %10
ret void
}

LLVM IR (-O2):
define void @USBClockDisable(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 4040
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 0, i32* %7
ret void
}
/* Variables and functions */
int csum_partial(char *, int, int);
int /*<<< orphan*/ memcpy(char *, char *, int);
extern unsigned int csum_partial_copy(char *src, char *dst, int len, int sum) {
  sum = csum_partial(src, len, sum);
  memcpy(dst, src, len);
  return sum;
}


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

x86 assembly (clang, -O2):
<csum_partial_copy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <csum_partial@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @csum_partial_copy(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @csum_partial(i8* %0, i32 %2, i32 %3)
%6 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %2)
ret i32 %5
}
void one_minute_refresh(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTAvlrFileOffsetRangeRemove() {
ret void
}
unsigned char calcZprime(unsigned char *Q, const unsigned char *D) {
  return ~(*Q ^ *D);
}


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

x86 assembly (clang, -O2):
<calcZprime>:
mov    (%rdi),%al
xor    (%rsi),%al
not    %al
ret

LLVM IR (-O0):
define zeroext i8 @calcZprime(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = xor i32 %7, %10
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @calcZprime(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = xor i8 %3, %4
%6 = xor i8 %5, -1
ret i8 %6
}