xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage() {
  fputs("Usage: pp [-lsr] [file-to-read]\n"
        "  -l: line mode, show progress based on approximate size of file in "
        "lines\n"
        "  -r: do not write data to STDOUT\n"
        "  -s: manually set size of pipe (10Mb, 1Gb, 1Tb etc)\n"
        "\n"
        "EXAMPLES:\n"
        "  pp bigfile | gzip > bigfile.gz   progress of compression\n"
        "  pp -r /dev/ad0                   determine HDD line read speed\n"
        "  somecmd | pp | gzip > file.gz    progress of pipe compression\n"
        "  pp file > /path/to/copy          copy file with bar\n",
        stderr);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [447 x i8] c"Usage: pp [-lsr] [file-to-read]\0A -l: line mode, show progress based on approximate size of file in lines\0A -r: do not write data to STDOUT\0A -s: manually set size of pipe (10Mb, 1Gb, 1Tb etc)\0A\0AEXAMPLES:\0A pp bigfile | gzip > bigfile.gz progress of compression\0A pp -r /dev/ad0 determine HDD line read speed\0A somecmd | pp | gzip > file.gz progress of pipe compression\0A pp file > /path/to/copy copy file with bar\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([447 x i8], [447 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [447 x i8] c"Usage: pp [-lsr] [file-to-read]\0A -l: line mode, show progress based on approximate size of file in lines\0A -r: do not write data to STDOUT\0A -s: manually set size of pipe (10Mb, 1Gb, 1Tb etc)\0A\0AEXAMPLES:\0A pp bigfile | gzip > bigfile.gz progress of compression\0A pp -r /dev/ad0 determine HDD line read speed\0A somecmd | pp | gzip > file.gz progress of pipe compression\0A pp file > /path/to/copy copy file with bar\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([447 x i8], [447 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t lfs2_fromle32(uint32_t a) { return a; }


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

x86 assembly (clang, -O2):
<lfs2_fromle32>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @lfs2_fromle32(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t onPerform(void *context, int32_t type, void *task) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @onPerform(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
int rchild(int x) { return 2 * x + 1; }


x86 assembly (clang, -O0):
<rchild>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rchild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @rchild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ emit_neg(int, int);
void emit_negs(int rs, int rt) { emit_neg(rs, rt); }


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

x86 assembly (clang, -O2):
<emit_negs>:
jmp    1030 <emit_neg@plt>

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

LLVM IR (-O2):
define void @emit_negs(i32 %0, i32 %1) {
%3 = tail call i32 @emit_neg(i32 %0, i32 %1)
ret void
}
float makeIntoDollars(int cents) {
  float dollars;
  dollars = (float)cents / 100.0;
  return dollars;
}


x86 assembly (clang, -O0):
<makeIntoDollars>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeIntoDollars>:
cvtsi2ss %edi,%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @makeIntoDollars(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.000000e+02
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @makeIntoDollars(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fdiv float %2, 1.000000e+02
ret float %3
}
unsigned int rol(int x, int n) {
  __asm__("roll %%cl,%0" : "=r"(x) : "0"(x), "c"(n));
  return x;
}


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

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 asm "roll %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = tail call i32 asm "roll %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ primitive_voidp_receiver(int *);
void test_primitive_ptr_cast() {
  int x = 96;
  primitive_voidp_receiver(&x);
}


x86 assembly (clang, -O0):
<test_primitive_ptr_cast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x60,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <primitive_voidp_receiver@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_primitive_ptr_cast>:
push   %rax
movl   $0x60,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <primitive_voidp_receiver@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_primitive_ptr_cast() {
%1 = alloca i32
store i32 96, i32* %1
%2 = call i32 @primitive_voidp_receiver(i32* %1)
ret void
}

LLVM IR (-O2):
define void @test_primitive_ptr_cast() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 96, i32* %1
%3 = call i32 @primitive_voidp_receiver(i32* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t david_sum(uint32_t a, uint32_t b) { return a + b; }


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

LLVM IR (-O0):
define i64 @david_sum(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 @david_sum(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *x1();
char *x2();
int main() {
  printf("%s\n", x1());
  printf("%s\n", x2());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <x1@plt>
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <x2@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @x1()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* (...) @x2()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ getegid();
scalar_t__ geteuid();
scalar_t__ getgid();
scalar_t__ getuid();
int OPENSSL_issetugid(void) {
  return getuid() != geteuid() || getgid() != getegid();
}


x86 assembly (clang, -O0):
<OPENSSL_issetugid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,%rdx
mov    $0x1,%al
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1191 <OPENSSL_issetugid+0x51>
mov    $0x0,%al
call   1050 <getgid@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <getegid@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPENSSL_issetugid>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    %rcx,%rbx
jne    117b <OPENSSL_issetugid+0x3b>
xor    %eax,%eax
call   1050 <getgid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <getegid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @OPENSSL_issetugid() {
%1 = call i64 (...) @getuid()
%2 = call i64 (...) @geteuid()
%3 = icmp ne i64 %1, %2
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = call i64 (...) @getgid()
%6 = call i64 (...) @getegid()
%7 = icmp ne i64 %5, %6
br label %8
8: ; preds = %4, %0
%9 = phi i1 [ true, %0 ], [ %7, %4 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @OPENSSL_issetugid() {
%1 = tail call i64 (...) @getuid()
%2 = tail call i64 (...) @geteuid()
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 (...) @getgid()
%6 = tail call i64 (...) @getegid()
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ 1, %0 ], [ %8, %4 ]
ret i32 %10
}
unsigned long module_kallsyms_lookup_name(const char *name) { return 0; }


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

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

LLVM IR (-O0):
define i64 @module_kallsyms_lookup_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 0
}

LLVM IR (-O2):
define i64 @module_kallsyms_lookup_name(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ mew_duart_print_hex(char const *, unsigned int);
void mew_debug_print_hex(const char *message, unsigned int len) {
  mew_duart_print_hex(message, len);
}


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

x86 assembly (clang, -O2):
<mew_debug_print_hex>:
jmp    1030 <mew_duart_print_hex@plt>

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

LLVM IR (-O2):
define void @mew_debug_print_hex(i8* %0, i32 %1) {
%3 = tail call i32 @mew_duart_print_hex(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ remove_process(int);
int waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
void clean_up(int sig) {
  int status;
  int ret;
  do {
    ret = waitpid(0, &status, WNOHANG);
    if (ret > 0)
      remove_process(ret);
  } while (ret > 0);
}


x86 assembly (clang, -O0):
<clean_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1154 <clean_up+0x34>
mov    -0xc(%rbp),%edi
call   1030 <remove_process@plt>
jmp    1159 <clean_up+0x39>
cmpl   $0x0,-0xc(%rbp)
jg     112b <clean_up+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_up>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edx
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    1168 <clean_up+0x48>
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <remove_process@plt>
mov    (%r14),%edx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1150 <clean_up+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @clean_up(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 0, i32* %3, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %4
%12 = call i32 @remove_process(i32 %11)
br label %13
13: ; preds = %10, %5
br label %14
14: ; preds = %13
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 0
br i1 %16, label %5, label %17
17: ; preds = %14
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @clean_up(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 0, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @remove_process(i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 0, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int wave_get_cbs(int pi) { return pigpio_command(pi, 36, 0, 0, 1); }


x86 assembly (clang, -O0):
<wave_get_cbs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x24,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_get_cbs>:
mov    $0x24,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @wave_get_cbs(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 36, i32 0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
void a();
void d() { return a(); }


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

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

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

LLVM IR (-O2):
define void @d() {
tail call void (...) @a()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ term_send(char);
void term_erase_screenBottom() {
  term_send(27);
  term_send('[');
  term_send('J');
}


x86 assembly (clang, -O0):
<term_erase_screenBottom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x4a,%edi
call   1030 <term_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_erase_screenBottom>:
push   %rax
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x4a,%edi
pop    %rax
jmp    1030 <term_send@plt>

LLVM IR (-O0):
define void @term_erase_screenBottom() {
%1 = call i32 @term_send(i8 signext 27)
%2 = call i32 @term_send(i8 signext 91)
%3 = call i32 @term_send(i8 signext 74)
ret void
}

LLVM IR (-O2):
define void @term_erase_screenBottom() {
%1 = tail call i32 @term_send(i8 signext 27)
%2 = tail call i32 @term_send(i8 signext 91)
%3 = tail call i32 @term_send(i8 signext 74)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int run();
int main(int argc, char *argv[]) {
  int i;
  int result;
  for (i = 0; i < 100000; i++)
    result = run();
  if (result != 6)
    printf("*** wrong result ***\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x186a0,-0x14(%rbp)
jge    1162 <main+0x42>
mov    $0x0,%al
call   1030 <run@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x6,-0x18(%rbp)
je     1178 <main+0x58>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x186a0,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <run@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
cmp    $0x6,%eax
je     114d <main+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [21 x i8] c"*** wrong result ***\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 (...) @run()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 100000
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = icmp eq i32 %5, 6
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int sexit(char **command, struct tm start) {
  printf("Goodbye!\r\n");
  return -1;
}


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [11 x i8] c"Goodbye!\0D\0A\00"
define i32 @sexit(i8** %0, i32 %1) {
%3 = alloca %struct.tm
%4 = alloca i8**
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i32 %1, i32* %5
store i8** %0, i8*** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [10 x i8] c"Goodbye!\0D\00"
define i32 @sexit(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
void f(void) {
l:
  dummy();
  {
    __label__ l;
  l:
    dummy();
  };
  goto l;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <f+0x9>
mov    $0x0,%al
call   1030 <dummy@plt>
mov    $0x0,%al
call   1030 <dummy@plt>
jmp    1119 <f+0x9>

x86 assembly (clang, -O2):
<f>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <dummy@plt>
xor    %eax,%eax
call   1030 <dummy@plt>
jmp    1120 <f+0x10>

LLVM IR (-O0):
define void @f() {
br label %1
1: ; preds = %3, %0
%2 = call i32 (...) @dummy()
br label %3
3: ; preds = %1
%4 = call i32 (...) @dummy()
br label %1
}

LLVM IR (-O2):
define void @f() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @dummy()
%3 = tail call i32 (...) @dummy()
br label %1
}
/* Variables and functions */
double exp(double);
double pow(double, double);
double normalpdf(double z) {
  return exp(-0.5 * pow(z, 2)) /
         pow(3.14159265358979323846264338327950288 * 2, 0.5);
}


x86 assembly (clang, -O0):
<normalpdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xea0(%rip),%xmm0
movsd  0xea0(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalpdf>:
push   %rax
mulsd  %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <exp@plt>
divsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @normalpdf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 2.000000e+00)
%5 = fmul double -5.000000e-01, %4
%6 = call double @exp(double %5)
%7 = call double @pow(double 0x401921FB54442D18, double 5.000000e-01)
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @normalpdf(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, -5.000000e-01
%4 = tail call double @exp(double %3)
%5 = fdiv double %4, 0x40040D931FF62705
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_44_neg();
void z80_ed_7c_neg(void) { z80_ed_44_neg(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_7c_neg() {
%1 = tail call i32 (...) @z80_ed_44_neg()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clean() { printf("\e[0;0H\e[2J"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[0;0H\1B[2J\00"
define void @clean() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[0;0H\1B[2J\00"
define void @clean() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay() { usleep(200 * 1000); }


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

x86 assembly (clang, -O2):
<delay>:
mov    $0x30d40,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay() {
%1 = call i32 @usleep(i32 200000)
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = tail call i32 @usleep(i32 200000)
ret void
}
int main() {
  char tab[5];
  __builtin_memset(tab, 1, sizeof(tab));
  __builtin_memset(tab, 1, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void half_success_setup(struct mu_test_desc *desc) {}


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

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

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

LLVM IR (-O2):
%struct.mu_test_desc = type opaque
define void @half_success_setup(%struct.mu_test_desc* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *hexstrToStr(int, char *);
char *strToHexstr(int, char *);
scalar_t__ strcmp(char *, char *);
int testHexStr(int len, char *s) {
  int res;
  char *hexstr = strToHexstr(len, s);
  char *ns = hexstrToStr(len * 8, hexstr);
  res = (0 == strcmp(s, ns));
  free(hexstr);
  free(ns);
  return res;
}


x86 assembly (clang, -O0):
<testHexStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <strToHexstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
mov    -0x20(%rbp),%rsi
call   1050 <hexstrToStr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testHexStr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
call   1060 <strToHexstr@plt>
mov    %rax,%r14
shl    $0x3,%ebp
mov    %ebp,%edi
mov    %rax,%rsi
call   1050 <hexstrToStr@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @testHexStr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i8* @strToHexstr(i32 %8, i8* %9)
store i8* %10, i8** %6
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 8
%13 = load i8*, i8** %6
%14 = call i8* @hexstrToStr(i32 %12, i8* %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %4
%16 = load i8*, i8** %7
%17 = call i64 @strcmp(i8* %15, i8* %16)
%18 = icmp eq i64 0, %17
%19 = zext i1 %18 to i32
store i32 %19, i32* %5
%20 = load i8*, i8** %6
%21 = call i32 @free(i8* %20)
%22 = load i8*, i8** %7
%23 = call i32 @free(i8* %22)
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @testHexStr(i32 %0, i8* %1) {
%3 = tail call i8* @strToHexstr(i32 %0, i8* %1)
%4 = shl nsw i32 %0, 3
%5 = tail call i8* @hexstrToStr(i32 %4, i8* %3)
%6 = tail call i64 @strcmp(i8* %1, i8* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @free(i8* %3)
%10 = tail call i32 @free(i8* %5)
ret i32 %8
}
int aa_pro_ctr_a1f(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a1f>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a1f = [15 x i8] c"aa_pro_ctr_a1f\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a1f(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a1f, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a1f = [15 x i8] c"aa_pro_ctr_a1f\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a1f(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a1f, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
void str_ncpy(dst, src, n) char *dst;
char *src;
int n;
{
  char *end;
  end = dst + n - 1;
  do {
    n = (dst >= end) ? 0 : *src++;
    *dst++ = n;
  } while (n);
}


x86 assembly (clang, -O0):
<str_ncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     113a <str_ncpy+0x3a>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    114f <str_ncpy+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
cmpl   $0x0,-0x14(%rbp)
jne    1122 <str_ncpy+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_ncpy>:
movslq %edx,%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rdi
jae    1127 <str_ncpy+0x27>
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,(%rdi)
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_ncpy+0x10>
ret
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @str_ncpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 -1
store i8* %12, i8** %7
br label %13
13: ; preds = %29, %3
%14 = load i8*, i8** %4
%15 = load i8*, i8** %7
%16 = icmp uge i8* %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
br label %23
18: ; preds = %13
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
br label %23
23: ; preds = %18, %17
%24 = phi i32 [ 0, %17 ], [ %22, %18 ]
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
store i8 %26, i8* %27
br label %29
29: ; preds = %23
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, 0
br i1 %31, label %13, label %32
32: ; preds = %29
ret void
}

LLVM IR (-O2):
define void @str_ncpy(i8* writeonly %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
br label %7
7: ; preds = %12, %3
%8 = phi i8* [ %1, %3 ], [ %13, %12 ]
%9 = phi i8* [ %0, %3 ], [ %15, %12 ]
%10 = icmp ult i8* %9, %6
br i1 %10, label %12, label %11
11: ; preds = %7
store i8 0, i8* %9
br label %17
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %8
%15 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %14, i8* %9
%16 = icmp eq i8 %14, 0
br i1 %16, label %17, label %7
17: ; preds = %12, %11
ret void
}
int iIsZero(unsigned char *psA, unsigned int uiLen) {
  int i;
  for (i = 0; i < (int)uiLen; i++)
    if (*psA++)
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<iIsZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1155 <iIsZero+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1142 <iIsZero+0x42>
movl   $0x0,-0x4(%rbp)
jmp    115c <iIsZero+0x5c>
jmp    1147 <iIsZero+0x47>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <iIsZero+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iIsZero>:
mov    $0x1,%eax
test   %esi,%esi
jle    111e <iIsZero+0x1e>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,(%rdi,%rdx,1)
jne    111f <iIsZero+0x1f>
add    $0x1,%rdx
cmp    %edx,%ecx
jne    1110 <iIsZero+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iIsZero(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %9
%5 = phi i32 [ %11, %9 ], [ 0, %2 ]
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i32 [ 1, %2 ], [ 1, %9 ], [ 0, %4 ]
ret i32 %14
}
void init_required_fw_features(void) {
  extern void _init_focus_eventflag();
  _init_focus_eventflag();
  extern int av_override_semaphore;
  extern int _CreateBinarySemaphoreStrictly(int x, int y);
  av_override_semaphore = _CreateBinarySemaphoreStrictly(0, 0);
}


x86 assembly (clang, -O0):
<init_required_fw_features>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_init_focus_eventflag@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <_CreateBinarySemaphoreStrictly@plt>
mov    %eax,%ecx
mov    0x2eab(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_required_fw_features>:
push   %rax
xor    %eax,%eax
call   1030 <_init_focus_eventflag@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <_CreateBinarySemaphoreStrictly@plt>
mov    0x2eb0(%rip),%rcx
mov    %eax,(%rcx)
pop    %rax
ret

LLVM IR (-O0):
@av_override_semaphore = external global i32
define void @init_required_fw_features() {
%1 = call i32 @_CreateBinarySemaphoreStrictly(i32 0, i32 0)
store i32 %1, i32* @av_override_semaphore
ret void
}

LLVM IR (-O2):
@av_override_semaphore = external global i32
define void @init_required_fw_features() {
tail call void (...) @_init_focus_eventflag()
%1 = tail call i32 @_CreateBinarySemaphoreStrictly(i32 0, i32 0)
store i32 %1, i32* @av_override_semaphore
ret void
}
void XWtClassInitialize(void) { ; }


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

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

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

LLVM IR (-O2):
define void @XWtClassInitialize() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int icmp_uint32_t(uint32_t a, uint32_t b) {
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<icmp_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1126 <icmp_uint32_t+0x26>
movl   $0x1,-0x4(%rbp)
jmp    1147 <icmp_uint32_t+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1140 <icmp_uint32_t+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <icmp_uint32_t+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp_uint32_t>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setl   %cl
neg    %ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @icmp_uint32_t(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = icmp slt i64 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void Pthread_exit(void *retval) { pthread_exit(retval); }


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

x86 assembly (clang, -O2):
<Pthread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @Pthread_exit(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Variables and functions */
void *malloc(int bytes) {
  static void *position = 0x700000;
  void *aux = position;
  position += bytes;
  return aux;
}


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f12(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2f04(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2ef7(%rip)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
mov    0x2f19(%rip),%rax
movslq %edi,%rcx
add    %rax,%rcx
mov    %rcx,0x2f0c(%rip)
ret

LLVM IR (-O0):
@malloc.position = internal global i8* inttoptr (i64 7340032 to i8*)
define i8* @malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i8*, i8** @malloc.position
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = load i8*, i8** @malloc.position
%7 = sext i32 %5 to i64
%8 = getelementptr i8, i8* %6, i64 %7
store i8* %8, i8** @malloc.position
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@malloc.position = internal unnamed_addr global i8* inttoptr (i64 7340032 to i8*)
define i8* @malloc(i32 %0) {
%2 = load i8*, i8** @malloc.position
%3 = sext i32 %0 to i64
%4 = getelementptr i8, i8* %2, i64 %3
store i8* %4, i8** @malloc.position
ret i8* %2
}
void interval2minimum_intervalDelim() {}


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

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

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

LLVM IR (-O2):
define void @interval2minimum_intervalDelim() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RunSub();
int main(int argc, char **argv) {
  RunSub();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @RunSub()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nl();
int /*<<< orphan*/ ot(char *);
int /*<<< orphan*/ outstr(char *);
void callrts(char *sname) {
  ot("call\t");
  outstr(sname);
  nl();
}


x86 assembly (clang, -O0):
<callrts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <ot@plt>
mov    -0x8(%rbp),%rdi
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callrts>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <ot@plt>
mov    %rbx,%rdi
call   1040 <outstr@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"call\09\00"
define void @callrts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @outstr(i8* %4)
%6 = call i32 (...) @nl()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"call\09\00"
define void @callrts(i8* %0) {
%2 = tail call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @outstr(i8* %0)
%4 = tail call i32 (...) @nl()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cs;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int CPU_COUNT(int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ sched_getaffinity(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
int num_cores(void) {
  cpu_set_t cs;
  CPU_ZERO(&cs);
  sched_getaffinity(0, sizeof(cs), &cs);
  return CPU_COUNT(&cs);
}


x86 assembly (clang, -O0):
<num_cores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x4(%rbp),%rdx
call   1050 <sched_getaffinity@plt>
lea    -0x4(%rbp),%rdi
call   1030 <CPU_COUNT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_cores>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <CPU_ZERO@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1050 <sched_getaffinity@plt>
mov    %rbx,%rdi
call   1030 <CPU_COUNT@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @num_cores() {
%1 = alloca i32
%2 = call i32 @CPU_ZERO(i32* %1)
%3 = call i32 @sched_getaffinity(i32 0, i32 4, i32* %1)
%4 = call i32 @CPU_COUNT(i32* %1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @num_cores() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @CPU_ZERO(i32* %1)
%4 = call i32 @sched_getaffinity(i32 0, i32 4, i32* %1)
%5 = call i32 @CPU_COUNT(i32* %1)
ret i32 %5
}