xunge/DecIR huggingface dataset:
int fun613() { return 613; }


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

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

LLVM IR (-O0):
define i32 @fun613() {
ret i32 613
}

LLVM IR (-O2):
define i32 @fun613() {
ret i32 613
}
void foo495(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo495(i32 %0) {
ret void
}
int letsgo_get_p(int x, int y) { return (x << 5) | y; }


x86 assembly (clang, -O0):
<letsgo_get_p>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letsgo_get_p>:
mov    %edi,%eax
shl    $0x5,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @letsgo_get_p(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 = shl i32 %5, 5
%7 = load i32, i32* %4
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @letsgo_get_p(i32 %0, i32 %1) {
%3 = shl i32 %0, 5
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_data();
int /*<<< orphan*/ check_infinity();
int /*<<< orphan*/ check_low_z_one();
int /*<<< orphan*/ check_one_2exp();
int /*<<< orphan*/ check_onebits();
void testmain(int argc, char *argv[]) {
  check_data();
  check_onebits();
  check_low_z_one();
  check_one_2exp();
  check_infinity();
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <check_data@plt>
mov    $0x0,%al
call   1070 <check_onebits@plt>
mov    $0x0,%al
call   1050 <check_low_z_one@plt>
mov    $0x0,%al
call   1030 <check_one_2exp@plt>
mov    $0x0,%al
call   1060 <check_infinity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rax
xor    %eax,%eax
call   1040 <check_data@plt>
xor    %eax,%eax
call   1070 <check_onebits@plt>
xor    %eax,%eax
call   1050 <check_low_z_one@plt>
xor    %eax,%eax
call   1030 <check_one_2exp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <check_infinity@plt>

LLVM IR (-O0):
define void @testmain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @check_data()
%6 = call i32 (...) @check_onebits()
%7 = call i32 (...) @check_low_z_one()
%8 = call i32 (...) @check_one_2exp()
%9 = call i32 (...) @check_infinity()
ret void
}

LLVM IR (-O2):
define void @testmain(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @check_data()
%4 = tail call i32 (...) @check_onebits()
%5 = tail call i32 (...) @check_low_z_one()
%6 = tail call i32 (...) @check_one_2exp()
%7 = tail call i32 (...) @check_infinity()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t_for();
int /*<<< orphan*/ t_if();
int /*<<< orphan*/ t_switch();
int /*<<< orphan*/ t_while();
main() {
  t_if();
  t_while();
  t_switch();
  t_for();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <t_if@plt>
mov    $0x0,%al
call   1060 <t_while@plt>
mov    $0x0,%al
call   1030 <t_switch@plt>
mov    $0x0,%al
call   1040 <t_for@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <t_if@plt>
xor    %eax,%eax
call   1060 <t_while@plt>
xor    %eax,%eax
call   1030 <t_switch@plt>
xor    %eax,%eax
call   1040 <t_for@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @t_if()
%2 = call i32 (...) @t_while()
%3 = call i32 (...) @t_switch()
%4 = call i32 (...) @t_for()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @t_if()
%2 = tail call i32 (...) @t_while()
%3 = tail call i32 (...) @t_switch()
%4 = tail call i32 (...) @t_for()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_or(void) {
  gen_pop();
  gen_call("ccor");
}


x86 assembly (clang, -O0):
<gen_or>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_or>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ccor\00"
define void @gen_or() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccor\00"
define void @gen_or() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool nrf51_errata_36(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_36() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strtoul(char const *, char **, int);
int isaHexNum(const char *str) {
  char *str2 = NULL;
  strtoul(str, &str2, 16);
  return *str2 ? 0 : -1;
}


x86 assembly (clang, -O0):
<isaHexNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaHexNum>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    (%rsp),%rax
cmpb   $0x1,(%rax)
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isaHexNum(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = call i32 @strtoul(i8* %4, i8** %3, i32 16)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @isaHexNum(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @strtoul(i8* %0, i8** %2, i32 16)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Sys_ShowIP();
void CL_ShowIP_f(void) { Sys_ShowIP(); }


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

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

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

LLVM IR (-O2):
define void @CL_ShowIP_f() {
%1 = tail call i32 (...) @Sys_ShowIP()
ret void
}
void nop_pause(void) { __asm __volatile("pause" ::); }


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

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

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

LLVM IR (-O2):
define void @nop_pause() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int open_tcp_sock(unsigned short port) { return -1; }


x86 assembly (clang, -O0):
<open_tcp_sock>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @open_tcp_sock(i16 zeroext %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_l5();
int /*<<< orphan*/ take_struct_l5(int /*<<< orphan*/);
void test_struct_l5() { take_struct_l5(return_struct_l5()); }


x86 assembly (clang, -O0):
<test_struct_l5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_l5@plt>
mov    %eax,%edi
call   1030 <take_struct_l5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_l5>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_l5@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_l5@plt>

LLVM IR (-O0):
define void @test_struct_l5() {
%1 = call i32 (...) @return_struct_l5()
%2 = call i32 @take_struct_l5(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_l5() {
%1 = tail call i32 (...) @return_struct_l5()
%2 = tail call i32 @take_struct_l5(i32 %1)
ret void
}
/* Variables and functions */
char *reverse(char *);
int is_palindrome(char *string) { return (string == reverse(string)) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rdx
mov    %rax,%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome>:
push   %rbx
mov    %rdi,%rbx
call   1030 <reverse@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_palindrome(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @reverse(i8* %4)
%6 = icmp eq i8* %3, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_palindrome(i8* %0) {
%2 = tail call i8* @reverse(i8* %0)
%3 = icmp eq i8* %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void INT_Excep_TPU10_TCI10V(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU10_TCI10V() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void setfdnonblock(int fd) {
  int fctl = fcntl(fd, F_GETFL);
  fctl |= O_NONBLOCK;
  fcntl(fd, F_SETFL, fctl);
}


x86 assembly (clang, -O0):
<setfdnonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setfdnonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @setfdnonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @setfdnonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %5)
ret void
}
float Minf(float x, float y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<Minf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <Minf+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <Minf+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Minf>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Minf(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 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @Minf(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void bencode_4(b, p) void *b;
void *p;
{ bcopy(p, b, 4); }


x86 assembly (clang, -O0):
<bencode_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <bcopy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bencode_4>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
xor    %eax,%eax
jmp    1030 <bcopy@plt>

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

LLVM IR (-O2):
define void @bencode_4(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %1, i8* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void error_log(char *str) {
  fputs("Board : ", stderr);
  fputs(str, stderr);
  return;
}


x86 assembly (clang, -O0):
<error_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_log>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%esi
lea    0xed8(%rip),%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"Board : \00"
@stderr = global i32 0
define void @error_log(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t intrev(uint32_t i) {
  uint32_t rev = 0;
  uint32_t rem;
  while (i) {
    rem = i % 10;
    rev *= 10;
    rev += rem;
    i /= 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<intrev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <intrev+0x49>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <intrev+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intrev>:
xor    %eax,%eax
test   %edi,%edi
je     113f <intrev+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <intrev+0x10>
ret

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

LLVM IR (-O2):
define i32 @intrev(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
void RTAvlPVDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlPVDestroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void putchars(const char *buf, size_t n) {
  while (n--) {
    putchar(*buf++);
  }
}


x86 assembly (clang, -O0):
<putchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1155 <putchars+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    1120 <putchars+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchars>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <putchars+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <putchars+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @putchars(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
void App_NMI_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @App_NMI_ISR() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *extract_domain(char *jid) {
  char *p;
  if ((p = strchr(jid, '/')))
    *p = 0;
  if ((p = strchr(jid, '@'))) {
    *p++ = 0;
    return p;
  }
  return p;
}


x86 assembly (clang, -O0):
<extract_domain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     113f <extract_domain+0x2f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     117a <extract_domain+0x6a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <extract_domain+0x72>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_domain>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <extract_domain+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1144 <extract_domain+0x34>
mov    %rax,%rcx
add    $0x1,%rax
movb   $0x0,(%rcx)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @extract_domain(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %6
br label %10
10: ; preds = %5, %8
%11 = phi i8* [ %9, %8 ], [ null, %5 ]
ret i8* %11
}
int is_start_with_1(const char *phoneNumber) {
  int flag = 0;
  if (phoneNumber[0] == '1')
    flag = 1;
  return flag;
}


x86 assembly (clang, -O0):
<is_start_with_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1126 <is_start_with_1+0x26>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_start_with_1>:
xor    %eax,%eax
cmpb   $0x31,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_start_with_1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 49
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_start_with_1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 49
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Multiface_Finish();
void Multiface_DeInstall(void) { Multiface_Finish(); }


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

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

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

LLVM IR (-O2):
define void @Multiface_DeInstall() {
%1 = tail call i32 (...) @Multiface_Finish()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void emit_idconst(char *name, int value) {
  printf("\t\t\t\t\t; %s = %d\n", name, value);
}


x86 assembly (clang, -O0):
<emit_idconst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_idconst>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\09\09\09\09\09; %s = %d\0A\00"
define void @emit_idconst(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 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\09\09\09\09\09; %s = %d\0A\00"
define void @emit_idconst(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
int main() {
  int a;
  int b;
  a = 1;
  b = 2;
  while (a + b < 5) {
    a = a - b;
    b = a + b;
    a = b - a;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x5,%eax
jge    1148 <main+0x48>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O2):
int C_Utils_compare_longlong(const long long item1, const long long item2) {
  if (item1 == item2)
    return 0;
  return item1 < item2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <C_Utils_compare_longlong+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1141 <C_Utils_compare_longlong+0x41>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_longlong>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
setge  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @C_Utils_compare_longlong(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 eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = icmp slt i64 %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 1
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @C_Utils_compare_longlong(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = icmp slt i64 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
struct utsname {
  int dummy;
};
typedef int /*<<< orphan*/ new_hname;

/* Variables and functions */
int /*<<< orphan*/ sethostname(char *, int);
int /*<<< orphan*/ uname(struct utsname *);
int main() {
  char orig_hname[1024];
  char *new_hname = "stap_test";
  int rc;
  struct utsname uts;
  uname(&uts);
  uname((struct utsname *)-1);
  sethostname((char *)-1, sizeof(new_hname));
  sethostname(NULL, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x418(%rbp)
lea    -0x420(%rbp),%rdi
call   1030 <uname@plt>
mov    $0xffffffffffffffff,%rdi
call   1030 <uname@plt>
mov    $0xffffffffffffffff,%rdi
mov    $0x8,%esi
call   1040 <sethostname@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <sethostname@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <uname@plt>
mov    $0xffffffffffffffff,%rdi
call   1030 <uname@plt>
mov    $0xffffffffffffffff,%rdi
mov    $0x8,%esi
call   1040 <sethostname@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <sethostname@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
@.str = [10 x i8] c"stap_test\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.utsname
store i32 0, i32* %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = call i32 @uname(%struct.utsname* %5)
%7 = call i32 @uname(%struct.utsname* inttoptr (i64 -1 to %struct.utsname*))
%8 = call i32 @sethostname(i8* inttoptr (i64 -1 to i8*), i32 8)
%9 = call i32 @sethostname(i8* null, i32 -1)
ret i32 0
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @main() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = tail call i32 @uname(%struct.utsname* inttoptr (i64 -1 to %struct.utsname*))
%5 = tail call i32 @sethostname(i8* inttoptr (i64 -1 to i8*), i32 8)
%6 = tail call i32 @sethostname(i8* null, i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ buffers_current();
int /*<<< orphan*/ exit(int const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int const);
int /*<<< orphan*/ gui_term();
int /*<<< orphan*/ preserve(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void sigh(const int sig) {
  gui_term();
  preserve(buffers_current());
  fprintf(stderr, "We get signal %d\n", sig);
  exit(sig + 128);
}


x86 assembly (clang, -O0):
<sigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gui_term@plt>
mov    $0x0,%al
call   1070 <buffers_current@plt>
mov    %eax,%edi
call   1030 <preserve@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe7d(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<sigh>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <gui_term@plt>
xor    %eax,%eax
call   1070 <buffers_current@plt>
mov    %eax,%edi
call   1030 <preserve@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
sub    $0xffffff80,%ebx
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"We get signal %d\0A\00"
define void @sigh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gui_term()
%4 = call i32 (...) @buffers_current()
%5 = call i32 @preserve(i32 %4)
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 128
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"We get signal %d\0A\00"
define void @sigh(i32 %0) {
%2 = tail call i32 (...) @gui_term()
%3 = tail call i32 (...) @buffers_current()
%4 = tail call i32 @preserve(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = add nsw i32 %0, 128
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ executeApplescriptToGetString(char *, char *, char *);
int strlen(char *);
int getAlbumName(char *name) {
  executeApplescriptToGetString("iTunes", "album of current track as string",
                                name);
  return strlen(name);
}


x86 assembly (clang, -O0):
<getAlbumName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xec9(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1030 <executeApplescriptToGetString@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAlbumName>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %rbx,%rdx
call   1030 <executeApplescriptToGetString@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [33 x i8] c"album of current track as string\00"
define i32 @getAlbumName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @executeApplescriptToGetString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [33 x i8] c"album of current track as string\00"
define i32 @getAlbumName(i8* %0) {
%2 = tail call i32 @executeApplescriptToGetString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
unsigned zigzagenc31(int x) {
  x = (x << 2 | ((x >> 30) & 2)) ^ x >> 31;
  return x;
}


x86 assembly (clang, -O0):
<zigzagenc31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1e,%ecx
and    $0x2,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigzagenc31>:
mov    %edi,%eax
rol    $0x2,%eax
and    $0xfffffffe,%eax
sar    $0x1f,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @zigzagenc31(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 30
%7 = and i32 %6, 2
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 31
%11 = xor i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @zigzagenc31(i32 %0) {
%2 = shl i32 %0, 2
%3 = lshr i32 %0, 30
%4 = and i32 %3, 2
%5 = or i32 %4, %2
%6 = ashr i32 %0, 31
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
double atof(char const *);
double cst_atof(const char *str) { return atof(str); }


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

x86 assembly (clang, -O2):
<cst_atof>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @cst_atof(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
/* Variables and functions */
double log(double);
double rand0_1();
double rand_exp(double alpha) {
  double u;
  do {
    u = rand0_1();
  } while (u == 0.0);
  return -log(u) / alpha;
}


x86 assembly (clang, -O0):
<rand_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand0_1@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1156 <rand_exp+0x36>
jp     1156 <rand_exp+0x36>
jmp    112d <rand_exp+0xd>
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_exp>:
push   %rax
movsd  %xmm0,(%rsp)
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand0_1@plt>
ucomisd 0xed1(%rip),%xmm0
jne    1143 <rand_exp+0x23>
jnp    1130 <rand_exp+0x10>
call   1040 <log@plt>
xorpd  0xeb0(%rip),%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_exp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
br label %4
4: ; preds = %6, %1
%5 = call double (...) @rand0_1()
store double %5, double* %3
br label %6
6: ; preds = %4
%7 = load double, double* %3
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %4, label %9
9: ; preds = %6
%10 = load double, double* %3
%11 = call double @log(double %10)
%12 = fneg double %11
%13 = load double, double* %2
%14 = fdiv double %12, %13
ret double %14
}

LLVM IR (-O2):
define double @rand_exp(double %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call double (...) @rand0_1()
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call double @log(double %3)
%7 = fneg double %6
%8 = fdiv double %7, %0
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ SwapWord(char *, int);
int little2bigi(int num) {
  SwapWord((char *)&num, sizeof(num));
  return num;
}


x86 assembly (clang, -O0):
<little2bigi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <SwapWord@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little2bigi>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <SwapWord@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @little2bigi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @little2bigi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_log10();
scalar_t__ log10(double);
void test_log10(double d) {
  if (log10(d) != log10(d))
    link_failure_log10();
}


x86 assembly (clang, -O0):
<test_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_log10+0x3c>
mov    $0x0,%al
call   1040 <link_failure_log10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_log10>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <log10@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <log10@plt>
cmp    %rax,%rbx
jne    1149 <test_log10+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_log10@plt>

LLVM IR (-O0):
define void @test_log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @log10(double %3)
%5 = load double, double* %2
%6 = call i64 @log10(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_log10()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_log10(double %0) {
%2 = tail call i64 @log10(double %0)
%3 = tail call i64 @log10(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_log10()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vcpuinsRefresh();
void vcpuRefresh() { vcpuinsRefresh(); }


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

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

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

LLVM IR (-O2):
define void @vcpuRefresh() {
%1 = tail call i32 (...) @vcpuinsRefresh()
ret void
}
void foo(int x) {
  if (x == 1)
    return;
  x = 6;
  foo(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112a <foo+0x1a>
jmp    1139 <foo+0x29>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
jne    1110 <foo+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
jmp    1110 <foo+0x10>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
store i32 6, i32* %2
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %4, label %3
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
char showChar(int c) {
  if (c >= 32 && c <= 126)
    return (char)(c);
  else
    return '.';
}


x86 assembly (clang, -O0):
<showChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1126 <showChar+0x26>
cmpl   $0x7e,-0x8(%rbp)
jg     1126 <showChar+0x26>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
jmp    112a <showChar+0x2a>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<showChar>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%eax
mov    $0x2e,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @showChar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %13
12: ; preds = %6, %1
store i8 46, i8* %2
br label %13
13: ; preds = %12, %9
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @showChar(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = trunc i32 %0 to i8
%5 = select i1 %3, i8 %4, i8 46
ret i8 %5
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
void *hashMustFindVal(struct hash *, char *);
int ptToInt(void *);
int hashIntVal(struct hash *hash, char *name) {
  void *val = hashMustFindVal(hash, name);
  return ptToInt(val);
}


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

x86 assembly (clang, -O2):
<hashIntVal>:
push   %rax
call   1040 <hashMustFindVal@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <ptToInt@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define i32 @hashIntVal(%struct.hash* %0, i8* %1) {
%3 = alloca %struct.hash*
%4 = alloca i8*
%5 = alloca i8*
store %struct.hash* %0, %struct.hash** %3
store i8* %1, i8** %4
%6 = load %struct.hash*, %struct.hash** %3
%7 = load i8*, i8** %4
%8 = call i8* @hashMustFindVal(%struct.hash* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @ptToInt(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define i32 @hashIntVal(%struct.hash* %0, i8* %1) {
%3 = tail call i8* @hashMustFindVal(%struct.hash* %0, i8* %1)
%4 = tail call i32 @ptToInt(i8* %3)
ret i32 %4
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_CEC_VERSION;
void cec_msg_cec_version(struct cec_msg *msg, __u8 cec_version) {
  msg->len = 3;
  msg->msg[1] = CEC_MSG_CEC_VERSION;
  msg->msg[2] = cec_version;
}


x86 assembly (clang, -O0):
<cec_msg_cec_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    0x2ecc(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_cec_version>:
movl   $0x3,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
mov    %esi,0x8(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_CEC_VERSION = global i32 0
define void @cec_msg_cec_version(%struct.cec_msg* %0, i32 %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32 %1, i32* %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
store i32 3, i32* %6
%7 = load i32, i32* @CEC_MSG_CEC_VERSION
%8 = load %struct.cec_msg*, %struct.cec_msg** %3
%9 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %8, i32 0, i32 1
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %7, i32* %11
%12 = load i32, i32* %4
%13 = load %struct.cec_msg*, %struct.cec_msg** %3
%14 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %13, i32 0, i32 1
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_CEC_VERSION = global i32 0
define void @cec_msg_cec_version(%struct.cec_msg* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 3, i32* %3
%4 = load i32, i32* @CEC_MSG_CEC_VERSION
%5 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 %4, i32* %7
%8 = getelementptr inbounds i32, i32* %6, i64 2
store i32 %1, i32* %8
ret void
}
int((generic_notification_ind_transmit))(struct ss7 *ss7, struct isup_call *c,
                                         int messagetype, unsigned char *parm,
                                         int len) {
  return 0;
}


x86 assembly (clang, -O0):
<generic_notification_ind_transmit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @generic_notification_ind_transmit(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @generic_notification_ind_transmit(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
ret i32 0
}