xunge/DecIR huggingface dataset:
float max_ff(float a, float b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max_ff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max_ff+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max_ff+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_ff>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max_ff(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 ogt 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 @max_ff(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
int main() {
  printf("%d\n", EOF);
  putchar(EOF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%esi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EOF
%4 = call i32 @putchar(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EOF
%4 = tail call i32 @putchar(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getload_from_node();
int main() { getload_from_node(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @getload_from_node()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getload_from_node()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpgt_pd(__m128d __a, __m128d __b) {
  return _mm_cmpgt_pd(__a, __b);
}


x86 assembly (clang, -O0):
<test_mm_cmpgt_pd>:
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 <_mm_cmpgt_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmpgt_pd>:
jmp    1030 <_mm_cmpgt_pd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpgt_pd(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 @_mm_cmpgt_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpgt_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_pd(i32 %0, i32 %1)
ret i32 %3
}
void SHA224(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA224() {
ret void
}
char base64_chr_table(int index) {
  char table[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
                  'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
                  'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
                  'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                  's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',
                  '3', '4', '5', '6', '7', '8', '9', '+', '/'};
  return table[index];
}


x86 assembly (clang, -O0):
<base64_chr_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
movslq -0x4(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_chr_table>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.base64_chr_table.table = [64 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
define signext i8 @base64_chr_table(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = bitcast [64 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@__const.base64_chr_table.table = [64 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
define signext i8 @base64_chr_table(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [64 x i8], [64 x i8]* @__const.base64_chr_table.table, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
trmop(fc, arg) int fc, arg;
{}


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

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

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

LLVM IR (-O2):
define i32 @trmop(i32 %0, i32 %1) {
ret i32 undef
}
int test_imm_6Aint8_mem(signed char *val) {
  return ((*val) & (-0x6A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Aint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff96,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_6Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -106
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((always_)) void ds_switch_to(struct task_struct *prev,
                                           struct task_struct *next) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @ds_switch_to(%struct.task_struct* %0, %struct.task_struct* %1) {
%3 = alloca %struct.task_struct*
%4 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @ds_switch_to(%struct.task_struct* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ isConfigLine(char const *);
bool testConfigLine(void) {
  char const *line = "var = 10\n";
  if (isConfigLine(line)) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<testConfigLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isConfigLine@plt>
cmp    $0x0,%rax
je     1142 <testConfigLine+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <testConfigLine+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testConfigLine>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <isConfigLine@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"var = 10\0A\00"
define i32 @testConfigLine() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @isConfigLine(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [10 x i8] c"var = 10\0A\00"
define i32 @testConfigLine() {
%1 = tail call i64 @isConfigLine(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_inc_c(void) { op_write1(0x0c); }


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

x86 assembly (clang, -O2):
<op_enc_inc_c>:
mov    $0xc,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_inc_c() {
%1 = call i32 @op_write1(i32 12)
ret void
}

LLVM IR (-O2):
define void @op_enc_inc_c() {
%1 = tail call i32 @op_write1(i32 12)
ret void
}
/* Variables and functions */
scalar_t__ be_read16(unsigned char const *);
unsigned int me_read32(const unsigned char *p) {
  return ((unsigned)be_read16(p + 2) << 16) | ((unsigned)be_read16(p));
}


x86 assembly (clang, -O0):
<me_read32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <be_read16@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <be_read16@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<me_read32>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x2,%rdi
call   1030 <be_read16@plt>
mov    %rax,%rbx
shl    $0x10,%ebx
mov    %r14,%rdi
call   1030 <be_read16@plt>
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @me_read32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = call i64 @be_read16(i8* %4)
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 16
%8 = load i8*, i8** %2
%9 = call i64 @be_read16(i8* %8)
%10 = trunc i64 %9 to i32
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @me_read32(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = tail call i64 @be_read16(i8* %2)
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 16
%6 = tail call i64 @be_read16(i8* %0)
%7 = trunc i64 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
int mutex_msg() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mutex_msg() {
ret i32 0
}
f(unsigned i) {
  if (__builtin_expect(!!(i), 0))
    f(i - 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     1142 <f+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub i32 %12, 1
%14 = call i32 @f(i32 %13)
br label %15
15: ; preds = %11, %1
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ dcc_cleanup_tempfiles_inner(int);
void dcc_cleanup_tempfiles_from_signal_handler(void) {
  dcc_cleanup_tempfiles_inner(1);
}


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

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

LLVM IR (-O0):
define void @dcc_cleanup_tempfiles_from_signal_handler() {
%1 = call i32 @dcc_cleanup_tempfiles_inner(i32 1)
ret void
}

LLVM IR (-O2):
define void @dcc_cleanup_tempfiles_from_signal_handler() {
%1 = tail call i32 @dcc_cleanup_tempfiles_inner(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sohClockMs();
void DoClockMs() { sohClockMs(); }


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

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

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

LLVM IR (-O2):
define void @DoClockMs() {
%1 = tail call i32 (...) @sohClockMs()
ret void
}
int sucesso() {
  static unsigned long long int seed = 123456789;
  seed = (1103515245 * seed + 12345) % 2147483648;
  return seed >= 2147483648 / 2;
}


x86 assembly (clang, -O0):
<sucesso>:
push   %rbp
mov    %rsp,%rbp
imul   $0x41c64e6d,0x2f11(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
and    $0x7fffffff,%rax
mov    %rax,0x2efe(%rip)
cmpq   $0x40000000,0x2ef3(%rip)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sucesso>:
imul   $0x41c64e6d,0x2f16(%rip),%ecx
4e c6 41
add    $0x3039,%ecx
and    $0x7fffffff,%ecx
mov    %rcx,0x2f03(%rip)
xor    %eax,%eax
cmp    $0x40000000,%rcx
setae  %al
ret

LLVM IR (-O0):
@sucesso.seed = internal global i64 123456789
define i32 @sucesso() {
%1 = load i64, i64* @sucesso.seed
%2 = mul i64 1103515245, %1
%3 = add i64 %2, 12345
%4 = urem i64 %3, 2147483648
store i64 %4, i64* @sucesso.seed
%5 = load i64, i64* @sucesso.seed
%6 = icmp uge i64 %5, 1073741824
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@sucesso.seed = internal unnamed_addr global i64 123456789
define i32 @sucesso() {
%1 = load i64, i64* @sucesso.seed
%2 = mul i64 %1, 1103515245
%3 = add i64 %2, 12345
%4 = and i64 %3, 2147483647
store i64 %4, i64* @sucesso.seed
%5 = icmp ugt i64 %4, 1073741823
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main() {
  if (fork() == 0) {
    printf("a");
    exit(0);
  } else {
    printf("b");
    waitpid(-1, NULL, 0);
  }
  printf("c");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
jne    1173 <main+0x33>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <waitpid@plt>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
jne    1154 <main+0x14>
mov    $0x61,%edi
jmp    1171 <main+0x31>
mov    $0x62,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.2 = [2 x i8] c"c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @waitpid(i32 -1, i32* null, i32 0)
br label %10
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @putchar(i32 97)
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = tail call i32 @putchar(i32 98)
%8 = tail call i32 @waitpid(i32 -1, i32* null, i32 0)
%9 = tail call i32 @putchar(i32 99)
%10 = tail call i32 @exit(i32 0)
unreachable
}
double c_to_d(char c) { return (double)(c - '0'); }


x86 assembly (clang, -O0):
<c_to_d>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_to_d>:
add    $0xffffffd0,%edi
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @c_to_d(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @c_to_d(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_log_target_to_string() {
  printf("NOT IMPLEMENTED:"
         "pa_log_target_to_string"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_log_target_to_string\0A\00"
define i32 @pa_log_target_to_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_log_target_to_string\00"
define i32 @pa_log_target_to_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ malloc(int);
void leak_memory(void) {
  char *ptr1, *ptr2;
  ptr1 = (char *)malloc(32);
  ptr2 = (char *)malloc(1024);
  (void)ptr1;
  (void)ptr2;
  return;
}


x86 assembly (clang, -O0):
<leak_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leak_memory>:
push   %rax
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    $0x400,%edi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @leak_memory() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i64 @malloc(i32 32)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = call i64 @malloc(i32 1024)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %1
%8 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @leak_memory() {
%1 = tail call i64 @malloc(i32 32)
%2 = tail call i64 @malloc(i32 1024)
ret void
}
int copy_str(char *x, char *y) {
  int i = 0;
  while (1) {
    x[i] = y[i];
    if (y[i] == '\0')
      return i;
    i++;
  }
}


x86 assembly (clang, -O0):
<copy_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1143 <copy_str+0x43>
mov    -0x14(%rbp),%eax
pop    %rbp
ret
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy_str+0x13>

x86 assembly (clang, -O2):
<copy_str>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <copy_str+0x10>
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @copy_str(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
void *check_ptr_VSTREAM_CTLvoid(void *v) { return v; }


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

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

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

LLVM IR (-O2):
define i8* @check_ptr_VSTREAM_CTLvoid(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ st7036_cursor_blink(int);
int /*<<< orphan*/ st7036_cursor_on(int);
void lcd_cursor(int cursor_on, int cursor_blink) {
  if (cursor_on == 0)
    st7036_cursor_on(0);
  else
    st7036_cursor_on(1);
  if (cursor_blink == 0)
    st7036_cursor_blink(0);
  else
    st7036_cursor_blink(1);
}


x86 assembly (clang, -O0):
<lcd_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1144 <lcd_cursor+0x24>
xor    %edi,%edi
call   1030 <st7036_cursor_on@plt>
jmp    114e <lcd_cursor+0x2e>
mov    $0x1,%edi
call   1030 <st7036_cursor_on@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1164 <lcd_cursor+0x44>
xor    %edi,%edi
call   1040 <st7036_cursor_blink@plt>
jmp    116e <lcd_cursor+0x4e>
mov    $0x1,%edi
call   1040 <st7036_cursor_blink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_cursor>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    %eax,%edi
call   1030 <st7036_cursor_on@plt>
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
pop    %rbx
jmp    1040 <st7036_cursor_blink@plt>

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

LLVM IR (-O2):
define void @lcd_cursor(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @st7036_cursor_on(i32 %4)
%6 = icmp ne i32 %1, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @st7036_cursor_blink(i32 %7)
ret void
}
void svcpu_put(struct kvmppc_book3s_shadow_vcpu *svcpu) {}


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

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

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

LLVM IR (-O2):
%struct.kvmppc_book3s_shadow_vcpu = type opaque
define void @svcpu_put(%struct.kvmppc_book3s_shadow_vcpu* nocapture %0) {
ret void
}
__attribute__((always_)) unsigned short endian_fix16(unsigned short x) {
  return (x << 8) | (x >> 8);
}


x86 assembly (clang, -O0):
<endian_fix16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_fix16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @endian_fix16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @endian_fix16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int get_bssid(void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_bssid(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free2(void **);
void free2int(int **p) { free2((void **)p); }


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

x86 assembly (clang, -O2):
<free2int>:
jmp    1030 <free2@plt>

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

LLVM IR (-O2):
define void @free2int(i32** %0) {
%2 = bitcast i32** %0 to i8**
%3 = tail call i32 @free2(i8** %2)
ret void
}
int charmatches(int c, const char *charclass) {
  do {
    charclass++;
    if (c == *charclass)
      return 1;
  } while (*charclass != ']');
  return 0;
}


x86 assembly (clang, -O0):
<charmatches>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1135 <charmatches+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1151 <charmatches+0x51>
jmp    113a <charmatches+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5d,%eax
jne    110b <charmatches+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charmatches>:
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rsi),%eax
cmp    %edi,%eax
je     1122 <charmatches+0x22>
add    $0x1,%rsi
cmp    $0x5d,%al
jne    1110 <charmatches+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @XGetDefault() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ state;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
unsigned get_XKeyEvent_state(void *_p) {
  return (unsigned)((XKeyEvent *)_p)->state;
}


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

x86 assembly (clang, -O2):
<get_XKeyEvent_state>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XKeyEvent_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XKeyEvent_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void TMTimerSet(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerSet() {
ret void
}
void RTMpCpuIdToSetIndex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpCpuIdToSetIndex() {
ret void
}
/* Variables and functions */
char **split(char *, char *);
int main() {
  char *str = "Escuela Superior de Computo";
  char *sep = " ";
  char **S = split(str, sep);
  int i;
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Escuela Superior de Computo\00"
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i8** @split(i8* %6, i8* %7)
store i8** %8, i8*** %4
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Escuela Superior de Computo\00"
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = tail call i8** @split(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hook_char_replace(char *, size_t, char, char);
size_t strlen(char *);
void run_replaces(char *string) {
  size_t len = strlen(string);
  hook_char_replace(string, len, '\b', '\0');
}


x86 assembly (clang, -O0):
<run_replaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1040 <hook_char_replace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_replaces>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1040 <hook_char_replace@plt>

LLVM IR (-O0):
define void @run_replaces(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i32 @hook_char_replace(i8* %6, i64 %7, i8 signext 8, i8 signext 0)
ret void
}

LLVM IR (-O2):
define void @run_replaces(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 @hook_char_replace(i8* %0, i64 %2, i8 signext 8, i8 signext 0)
ret void
}
/* Type definitions */
struct tms {
  int /*<<< orphan*/ tms_cstime;
  int /*<<< orphan*/ tms_cutime;
  int /*<<< orphan*/ tms_stime;
  int /*<<< orphan*/ tms_utime;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
clock_t c_times_(clock_t *utime, clock_t *stime, clock_t *cutime,
                 clock_t *cstime) {
  struct tms buf;
  return times(&buf);
  *utime = buf.tms_utime;
  *stime = buf.tms_stime;
  *cutime = buf.tms_cutime;
  *cstime = buf.tms_cstime;
}


x86 assembly (clang, -O0):
<c_times_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <times@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_times_>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { i32, i32, i32, i32 }
define i32 @c_times_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca %struct.tms
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = call i32 @times(%struct.tms* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.tms = type { i32, i32, i32, i32 }
define i32 @c_times_(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = alloca %struct.tms
%6 = bitcast %struct.tms* %5 to i8*
%7 = call i32 @times(%struct.tms* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  int i = 0;
  do {
    printf("Hello World %d\n", i++);
  } while (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1126 <main+0x16>
jmp    114c <main+0x3c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xee4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %ebp,%esi
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"Hello World %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %7
7: ; preds = %3
br i1 true, label %3, label %8
8: ; preds = %7
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello World %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}
int GetNibbleFromSample(int samples) {
  int packets = samples / 14;
  int extraSamples = samples % 14;
  int extraNibbles = extraSamples == 0 ? 0 : extraSamples + 2;
  return 16 * packets + extraNibbles;
}


x86 assembly (clang, -O0):
<GetNibbleFromSample>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1137 <GetNibbleFromSample+0x37>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <GetNibbleFromSample+0x40>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNibbleFromSample>:
movslq %edi,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x3,%eax
add    %edx,%eax
mov    %eax,%edx
shl    $0x4,%edx
mov    %eax,%esi
sub    %edx,%esi
add    %eax,%esi
lea    (%rcx,%rsi,1),%eax
add    $0x2,%eax
add    %esi,%ecx
cmove  %ecx,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @GetNibbleFromSample(i32 %0) {
%2 = sdiv i32 %0, 14
%3 = srem i32 %0, 14
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %3, 2
%6 = select i1 %4, i32 0, i32 %5
%7 = shl nsw i32 %2, 4
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Variables and functions */
double strtod(char const *, char **);
int read_real(double *out, const char *in) {
  char *end;
  *out = strtod(in, &end);
  if (*end)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<read_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <read_real+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <read_real+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_real>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1030 <strtod@plt>
movsd  %xmm0,(%rbx)
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_real(double* %0, i8* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i8*
%6 = alloca i8*
store double* %0, double** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call double @strtod(i8* %7, i8** %6)
%9 = load double*, double** %4
store double %8, double* %9
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @read_real(double* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call double @strtod(i8* %1, i8** %3)
store double %5, double* %0
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_putnbr_base_l(int nbr, char *base, int l) {
  if (nbr <= -l) {
    my_putnbr_base_l(nbr / l, base, l);
  }
  my_putchar(base[-(nbr % l)]);
}


x86 assembly (clang, -O0):
<my_putnbr_base_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jg     1157 <my_putnbr_base_l+0x37>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <my_putnbr_base_l@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putnbr_base_l>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %edx,%eax
neg    %eax
cmp    %edi,%eax
jl     1146 <my_putnbr_base_l+0x26>
mov    %r14d,%eax
cltd
idiv   %ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <my_putnbr_base_l@plt>
mov    %r14d,%eax
cltd
idiv   %ebp
movslq %edx,%rax
sub    %rax,%rbx
movsbl (%rbx),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <my_putchar@plt>

LLVM IR (-O0):
define i32 @my_putnbr_base_l(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %7
%10 = sub nsw i32 0, %9
%11 = icmp sle i32 %8, %10
br i1 %11, label %12, label %19
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = sdiv i32 %13, %14
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = call i32 @my_putnbr_base_l(i32 %15, i8* %16, i32 %17)
br label %19
19: ; preds = %12, %3
%20 = load i8*, i8** %6
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = srem i32 %21, %22
%24 = sub nsw i32 0, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %20, i64 %25
%27 = load i8, i8* %26
%28 = call i32 @my_putchar(i8 signext %27)
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @my_putnbr_base_l(i32 %0, i8* nocapture %1, i32 %2) {
%4 = sub nsw i32 0, %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = sdiv i32 %0, %2
%8 = tail call i32 @my_putnbr_base_l(i32 %7, i8* %1, i32 %2)
br label %9
9: ; preds = %6, %3
%10 = srem i32 %0, %2
%11 = sub nsw i32 0, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = tail call i32 @my_putchar(i8 signext %14)
ret i32 undef
}
void context_cleanup(struct urf_context *ctx) {}


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

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

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

LLVM IR (-O2):
%struct.urf_context = type opaque
define void @context_cleanup(%struct.urf_context* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int n1 = 10;
  int n2 = 20;
  if (n1 == n2) {
    printf("VERDADERO\n");
  } else {
    printf("FALSO\n");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    114a <main+0x3a>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1156 <main+0x46>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"VERDADERO\0A\00"
@.str.1 = [7 x i8] c"FALSO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"FALSO\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *scan_keys();
unsigned long strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned long scan_unsigned(void) {
  char *text;
  register unsigned long result;
  text = scan_keys();
  result = strtoul(text, NULL, 0);
  return (result);
}


x86 assembly (clang, -O0):
<scan_unsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <scan_keys@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_unsigned>:
push   %rax
xor    %eax,%eax
call   1030 <scan_keys@plt>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <strtoul@plt>

LLVM IR (-O0):
define i64 @scan_unsigned() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i8* (...) @scan_keys()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strtoul(i8* %4, i32* null, i32 0)
store i64 %5, i64* %2
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @scan_unsigned() {
%1 = tail call i8* (...) @scan_keys()
%2 = tail call i64 @strtoul(i8* nocapture %1, i32* null, i32 0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ say_hello(char *);
void signal_handler(int signo) { say_hello("SIGALRM"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"SIGALRM\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @say_hello(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}