xunge/DecIR huggingface dataset:
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_116(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 116)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_ch_116>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x74,%eax
jne    1144 <fn_ch_116+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_ch_116+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ch_116>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x74,%ecx
jne    1133 <fn_ch_116+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_ch_116(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @next_utf8(i8* %5, i32* %4)
%7 = icmp eq i32 %6, 116
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn_ch_116(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 116
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xbe() {
  Assert_real((iscntrl(190) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              955, ("iscntrl should be 0 for 0xbe"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xbe>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbe,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3bb,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xbe>:
push   %rax
mov    $0xbe,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3bb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbe\00"
define void @t_iscntrl_0xbe() {
%1 = call i64 @iscntrl(i32 190)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbe\00"
define void @t_iscntrl_0xbe() {
%1 = tail call i64 @iscntrl(i32 190)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int main(const int argc, char *argv[argc - 1]) {
  const int arr1[] = {1, 2, 3, 4, 5};
  const int arr2[] = {1, 2, 3, 4, 5, 6};
  const int(*a)[5] = &arr1;
  const int(*b)[] = &arr2;
  const int(*c)[5] = &arr2;
  b = &arr1;
  a = &arr2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee2(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xee5(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.arr2 = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca [6 x i32]
%8 = alloca [5 x i32]*
%9 = alloca [0 x i32]*
%10 = alloca [5 x i32]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = zext i32 %12 to i64
%14 = bitcast [5 x i32]* %6 to i8*
%15 = bitcast [6 x i32]* %7 to i8*
store [5 x i32]* %6, [5 x i32]** %8
%16 = bitcast [6 x i32]* %7 to [0 x i32]*
store [0 x i32]* %16, [0 x i32]** %9
%17 = bitcast [6 x i32]* %7 to [5 x i32]*
store [5 x i32]* %17, [5 x i32]** %10
%18 = bitcast [5 x i32]* %6 to [0 x i32]*
store [0 x i32]* %18, [0 x i32]** %9
%19 = bitcast [6 x i32]* %7 to [5 x i32]*
store [5 x i32]* %19, [5 x i32]** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int funge_stack_pop(int /*<<< orphan*/, int *);
int funge_stack_push(int /*<<< orphan*/, int *);
int /*<<< orphan*/ funge_thread_stack();
int32_t funge_logical_not(int32_t funge_char __attribute__((unused))) {
  int32_t val;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &val);
  val = !val;
  rc = funge_stack_push(funge_thread_stack(), &val);
  return rc;
}


x86 assembly (clang, -O0):
<funge_logical_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1050 <funge_stack_pop@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1030 <funge_stack_push@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funge_logical_not>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
lea    0xc(%rsp),%rbx
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <funge_stack_pop@plt>
xor    %eax,%eax
cmpl   $0x0,0xc(%rsp)
sete   %al
mov    %eax,0xc(%rsp)
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <funge_stack_push@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @funge_logical_not(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @funge_thread_stack()
%6 = call i32 @funge_stack_pop(i32 %5, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
store i32 %10, i32* %3
%11 = call i32 (...) @funge_thread_stack()
%12 = call i32 @funge_stack_push(i32 %11, i32* %3)
store i32 %12, i32* %4
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @funge_logical_not(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (...) @funge_thread_stack()
%5 = call i32 @funge_stack_pop(i32 %4, i32* %2)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %2
%9 = call i32 (...) @funge_thread_stack()
%10 = call i32 @funge_stack_push(i32 %9, i32* %2)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo() { assert(1); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int atoi(char const *);
char *in_get_header_info_str(char const *, char const *);
int in_get_header_info_int(const char *header, const char *type) {
  const char *p = in_get_header_info_str(header, type);
  return (p != NULL) ? atoi(p) : -1;
}


x86 assembly (clang, -O0):
<in_get_header_info_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <in_get_header_info_str@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115d <in_get_header_info_int+0x3d>
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    116a <in_get_header_info_int+0x4a>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    116a <in_get_header_info_int+0x4a>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_get_header_info_int>:
push   %rax
call   1030 <in_get_header_info_str@plt>
test   %rax,%rax
je     1134 <in_get_header_info_int+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @in_get_header_info_int(i8* %0, i8* %1) {
%3 = tail call i8* @in_get_header_info_str(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
float sqrt(int);
float producer(int x, int y) { return sqrt(x * y); }


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

x86 assembly (clang, -O2):
<producer>:
imul   %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @producer(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 = mul nsw i32 %5, %6
%8 = call float @sqrt(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @producer(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call float @sqrt(i32 %3)
ret float %4
}
int test_imm_85int64_midword_reg(long long val) {
  return ((val >> 16) & (0x85 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_85int64_midword_reg>:
test   $0x850000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_85int64_midword_reg(i64 %0) {
%2 = and i64 %0, 8716288
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int syscall(int, int);
int close(int fd) { return syscall(32, fd); }


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

x86 assembly (clang, -O2):
<close>:
mov    %edi,%esi
mov    $0x20,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @syscall(i32 32, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *strdup(char *);
char *folder_get_unfulfilled_dictionary_key(char *folder_name) {
  char dictionary_key[128];
  sprintf(dictionary_key, "%s_%s", "uunfulfilled_lookup", folder_name);
  return strdup(dictionary_key);
}


x86 assembly (clang, -O0):
<folder_get_unfulfilled_dictionary_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1030 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<folder_get_unfulfilled_dictionary_key>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rsi
lea    0xecd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s_%s\00"
@.str.1 = [20 x i8] c"uunfulfilled_lookup\00"
define i8* @folder_get_unfulfilled_dictionary_key(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s_%s\00"
@.str.1 = [20 x i8] c"uunfulfilled_lookup\00"
define noalias i8* @folder_get_unfulfilled_dictionary_key(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
prefix() {}


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

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

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

LLVM IR (-O2):
define i32 @prefix() {
ret i32 undef
}
void smp_mb(void) { __asm __volatile("mfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @smp_mb() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int es_una_A(char letra) {
  int res = 0;
  if (letra == 'a')
    res = 1;
  return res;
}


x86 assembly (clang, -O0):
<es_una_A>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jne    1125 <es_una_A+0x25>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_una_A>:
xor    %eax,%eax
cmp    $0x61,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @es_una_A(i8 signext %0) {
%2 = icmp eq i8 %0, 97
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long long pw(int, int);
long long int iv(int n) { return pw(n, 1000000007 - 2); }


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

x86 assembly (clang, -O2):
<iv>:
mov    $0x3b9aca05,%esi
jmp    1030 <pw@plt>

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

LLVM IR (-O2):
define i64 @iv(i32 %0) {
%2 = tail call i64 @pw(i32 %0, i32 1000000005)
ret i64 %2
}
/* Variables and functions */
char *api_json_set(char const *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *api_json_seti(const char *s, const char *k, int a) {
  char str[64];
  sprintf(str, "%d", a);
  return api_json_set(s, k, str);
}


x86 assembly (clang, -O0):
<api_json_seti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xebf(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1040 <api_json_set@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_json_seti>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <api_json_set@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @api_json_seti(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [64 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%14 = call i8* @api_json_set(i8* %11, i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @api_json_seti(i8* %0, i8* %1, i32 %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = call i8* @api_json_set(i8* %0, i8* %1, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ c_hecmw2fstr_connect_conv(int, int *, int *, int *);
void HECMW2FSTR_CONNECT_CONV(int *n_elem, int elem_type[],
                             int elem_node_index[], int elem_node_item[]) {
  c_hecmw2fstr_connect_conv(*n_elem, elem_type, elem_node_index,
                            elem_node_item);
}


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

x86 assembly (clang, -O2):
<HECMW2FSTR_CONNECT_CONV>:
mov    (%rdi),%edi
jmp    1030 <c_hecmw2fstr_connect_conv@plt>

LLVM IR (-O0):
define void @HECMW2FSTR_CONNECT_CONV(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @c_hecmw2fstr_connect_conv(i32 %10, i32* %11, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @HECMW2FSTR_CONNECT_CONV(i32* nocapture %0, i32* %1, i32* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @c_hecmw2fstr_connect_conv(i32 %5, i32* %1, i32* %2, i32* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct rds_encoder {
  int dummy;
};

/* Variables and functions */
int uecp_get_di_dynpty(struct rds_encoder *enc, uint8_t dsn, uint8_t psn) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.rds_encoder = type { i32 }
define i32 @uecp_get_di_dynpty(%struct.rds_encoder* %0, i32 %1, i32 %2) {
%4 = alloca %struct.rds_encoder*
%5 = alloca i32
%6 = alloca i32
store %struct.rds_encoder* %0, %struct.rds_encoder** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.rds_encoder = type { i32 }
define i32 @uecp_get_di_dynpty(%struct.rds_encoder* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct __kernel_timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, struct __kernel_timespec *);
int sys_clock_gettime64(clockid_t id, struct __kernel_timespec *ts) {
  return syscall(403, id, ts);
}


x86 assembly (clang, -O0):
<sys_clock_gettime64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x193,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_clock_gettime64>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x193,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.__kernel_timespec = type { i32 }
define i32 @sys_clock_gettime64(i32 %0, %struct.__kernel_timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.__kernel_timespec*
store i32 %0, i32* %3
store %struct.__kernel_timespec* %1, %struct.__kernel_timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.__kernel_timespec*, %struct.__kernel_timespec** %4
%7 = call i32 @syscall(i32 403, i32 %5, %struct.__kernel_timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.__kernel_timespec = type { i32 }
define i32 @sys_clock_gettime64(i32 %0, %struct.__kernel_timespec* %1) {
%3 = tail call i32 @syscall(i32 403, i32 %0, %struct.__kernel_timespec* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_CLR_ADC4_PIN();
int /*<<< orphan*/ TOSH_MAKE_ADC4_INPUT();
int /*<<< orphan*/ TOSH_MAKE_ADC4_OUTPUT();
unsigned char TOSH_READ_ADC4_PIN();
int /*<<< orphan*/ TOSH_uwait(int);
unsigned char ds2770_init(void) {
  unsigned char presence;
  TOSH_MAKE_ADC4_OUTPUT();
  TOSH_CLR_ADC4_PIN();
  TOSH_uwait(300);
  TOSH_MAKE_ADC4_INPUT();
  TOSH_uwait(40);
  presence = TOSH_READ_ADC4_PIN();
  TOSH_uwait(250);
  return !presence;
}


x86 assembly (clang, -O0):
<ds2770_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <TOSH_MAKE_ADC4_OUTPUT@plt>
mov    $0x0,%al
call   1040 <TOSH_CLR_ADC4_PIN@plt>
mov    $0x12c,%edi
call   1070 <TOSH_uwait@plt>
mov    $0x0,%al
call   1050 <TOSH_MAKE_ADC4_INPUT@plt>
mov    $0x28,%edi
call   1070 <TOSH_uwait@plt>
mov    $0x0,%al
call   1030 <TOSH_READ_ADC4_PIN@plt>
mov    %al,-0x1(%rbp)
mov    $0xfa,%edi
call   1070 <TOSH_uwait@plt>
cmpb   $0x0,-0x1(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds2770_init>:
push   %rbx
xor    %eax,%eax
call   1060 <TOSH_MAKE_ADC4_OUTPUT@plt>
xor    %eax,%eax
call   1040 <TOSH_CLR_ADC4_PIN@plt>
mov    $0x12c,%edi
call   1070 <TOSH_uwait@plt>
xor    %eax,%eax
call   1050 <TOSH_MAKE_ADC4_INPUT@plt>
mov    $0x28,%edi
call   1070 <TOSH_uwait@plt>
xor    %eax,%eax
call   1030 <TOSH_READ_ADC4_PIN@plt>
mov    %eax,%ebx
mov    $0xfa,%edi
call   1070 <TOSH_uwait@plt>
test   %bl,%bl
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @ds2770_init() {
%1 = alloca i8
%2 = call i32 (...) @TOSH_MAKE_ADC4_OUTPUT()
%3 = call i32 (...) @TOSH_CLR_ADC4_PIN()
%4 = call i32 @TOSH_uwait(i32 300)
%5 = call i32 (...) @TOSH_MAKE_ADC4_INPUT()
%6 = call i32 @TOSH_uwait(i32 40)
%7 = call zeroext i8 (...) @TOSH_READ_ADC4_PIN()
store i8 %7, i8* %1
%8 = call i32 @TOSH_uwait(i32 250)
%9 = load i8, i8* %1
%10 = icmp ne i8 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @ds2770_init() {
%1 = tail call i32 (...) @TOSH_MAKE_ADC4_OUTPUT()
%2 = tail call i32 (...) @TOSH_CLR_ADC4_PIN()
%3 = tail call i32 @TOSH_uwait(i32 300)
%4 = tail call i32 (...) @TOSH_MAKE_ADC4_INPUT()
%5 = tail call i32 @TOSH_uwait(i32 40)
%6 = tail call zeroext i8 (...) @TOSH_READ_ADC4_PIN()
%7 = tail call i32 @TOSH_uwait(i32 250)
%8 = icmp eq i8 %6, 0
%9 = zext i1 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ yyparse();
main(int argc, char **argv) { yyparse(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @yyparse()
ret i32 0
}
int power_supply_is_system_supplied(void) { return -38; }


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

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

LLVM IR (-O0):
define i32 @power_supply_is_system_supplied() {
ret i32 -38
}

LLVM IR (-O2):
define i32 @power_supply_is_system_supplied() {
ret i32 -38
}
/* Variables and functions */
int /*<<< orphan*/ mergeSortInt(int *, int);
void SortInt(int x[], int xsize) { mergeSortInt(x, xsize); }


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

x86 assembly (clang, -O2):
<SortInt>:
jmp    1030 <mergeSortInt@plt>

LLVM IR (-O0):
define void @SortInt(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 @mergeSortInt(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @SortInt(i32* %0, i32 %1) {
%3 = tail call i32 @mergeSortInt(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int sscanf(char *, char *, int *, int *);
int main(void) {
  int first, second, num;
  num = sscanf("6", "%d %d", &first, &second);
  printf("%d %d\n", num, first);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec5(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <sscanf@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
call   1040 <sscanf@plt>
mov    (%rsp),%edx
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"6\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sscanf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ backward_char();
int /*<<< orphan*/ deactivate_mark();
int /*<<< orphan*/ delete_char();
int /*<<< orphan*/ minibuf_error(char *);
int backward_delete_char(void) {
  deactivate_mark();
  if (backward_char()) {
    delete_char();
    return 1;
  } else {
    minibuf_error("Beginning of buffer");
    return 0;
  }
}


x86 assembly (clang, -O0):
<backward_delete_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <deactivate_mark@plt>
mov    $0x0,%al
call   1040 <backward_char@plt>
cmp    $0x0,%rax
je     1173 <backward_delete_char+0x33>
mov    $0x0,%al
call   1060 <delete_char@plt>
movl   $0x1,-0x4(%rbp)
jmp    1186 <backward_delete_char+0x46>
lea    0xe86(%rip),%rdi
call   1030 <minibuf_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backward_delete_char>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <deactivate_mark@plt>
xor    %eax,%eax
call   1040 <backward_char@plt>
test   %rax,%rax
je     1164 <backward_delete_char+0x24>
xor    %eax,%eax
call   1060 <delete_char@plt>
mov    $0x1,%ebx
jmp    1170 <backward_delete_char+0x30>
lea    0xe95(%rip),%rdi
call   1030 <minibuf_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Beginning of buffer\00"
define i32 @backward_delete_char() {
%1 = tail call i32 (...) @deactivate_mark()
%2 = tail call i64 (...) @backward_char()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @delete_char()
br label %8
6: ; preds = %0
%7 = tail call i32 @minibuf_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %9
}
/* Variables and functions */
unsigned long AMCBase64RequiredEncodeBufferSize(unsigned long, long);
unsigned long AMCBase64ReqEncBuffSize(unsigned long inLen, long useRfc822) {
  return AMCBase64RequiredEncodeBufferSize(inLen, useRfc822);
}


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

x86 assembly (clang, -O2):
<AMCBase64ReqEncBuffSize>:
jmp    1030 <AMCBase64RequiredEncodeBufferSize@plt>

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

LLVM IR (-O2):
define i64 @AMCBase64ReqEncBuffSize(i64 %0, i64 %1) {
%3 = tail call i64 @AMCBase64RequiredEncodeBufferSize(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ lseek(int, unsigned long, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int /*<<< orphan*/);
ftruncate(int fd, unsigned long where) {
  lseek(fd, where, 0);
  write(fd, 0, 0);
}


x86 assembly (clang, -O0):
<ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <lseek@plt>
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftruncate>:
push   %rbx
mov    %edi,%ebx
xor    %edx,%edx
call   1040 <lseek@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @ftruncate(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
%6 = load i32, i32* %4
%7 = load i64, i64* %5
%8 = call i32 @lseek(i32 %6, i64 %7, i32 0)
%9 = load i32, i32* %4
%10 = call i32 @write(i32 %9, i32 0, i32 0)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @ftruncate(i32 %0, i64 %1) {
%3 = tail call i32 @lseek(i32 %0, i64 %1, i32 0)
%4 = tail call i32 @write(i32 %0, i32 0, i32 0)
ret i32 undef
}
int f(int a) { return -(-a / 10); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = sdiv i32 %4, 10
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = sdiv i32 %0, 10
ret i32 %2
}
/* Variables and functions */
double drand48();
char adnsintetico_rand() {
  double r = drand48();
  if (r < 0.25)
    return 'A';
  else if (r < 0.5)
    return 'T';
  else if (r < 0.75)
    return 'G';
  else
    return 'C';
}


x86 assembly (clang, -O0):
<adnsintetico_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <drand48@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1140 <adnsintetico_rand+0x30>
movb   $0x41,-0x1(%rbp)
jmp    117c <adnsintetico_rand+0x6c>
movsd  0xec0(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115c <adnsintetico_rand+0x4c>
movb   $0x54,-0x1(%rbp)
jmp    117c <adnsintetico_rand+0x6c>
movsd  0xeac(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1178 <adnsintetico_rand+0x68>
movb   $0x47,-0x1(%rbp)
jmp    117c <adnsintetico_rand+0x6c>
movb   $0x43,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adnsintetico_rand>:
push   %rax
xor    %eax,%eax
call   1030 <drand48@plt>
mov    $0x41,%al
movsd  0xede(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     114c <adnsintetico_rand+0x3c>
mov    $0x54,%al
movsd  0xed6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     114c <adnsintetico_rand+0x3c>
movsd  0xed0(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
shl    $0x2,%al
or     $0x43,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @adnsintetico_rand() {
%1 = alloca i8
%2 = alloca double
%3 = call double (...) @drand48()
store double %3, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 2.500000e-01
br i1 %5, label %6, label %7
6: ; preds = %0
store i8 65, i8* %1
br label %16
7: ; preds = %0
%8 = load double, double* %2
%9 = fcmp olt double %8, 5.000000e-01
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 84, i8* %1
br label %16
11: ; preds = %7
%12 = load double, double* %2
%13 = fcmp olt double %12, 7.500000e-01
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 71, i8* %1
br label %16
15: ; preds = %11
store i8 67, i8* %1
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i8, i8* %1
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @adnsintetico_rand() {
%1 = tail call double (...) @drand48()
%2 = fcmp olt double %1, 2.500000e-01
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = fcmp olt double %1, 5.000000e-01
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp olt double %1, 7.500000e-01
%7 = select i1 %6, i8 71, i8 67
br label %8
8: ; preds = %5, %3, %0
%9 = phi i8 [ 65, %0 ], [ 84, %3 ], [ %7, %5 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helloCPU(void) { printf("[cpu]> Hello world! (normal)\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"[cpu]> Hello world! (normal)\0A\00"
define void @helloCPU() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"[cpu]> Hello world! (normal)\00"
define void @helloCPU() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) int call_me(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @call_me(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int, ...);
int main(void) {
  int result3;
  int result5;
  result3 = sum(3, 1, 2, 3);
  result5 = sum(5, 1, 2, 3, 4, 5);
  printf("result3 = %d\n", result3);
  printf("result5 = %d\n", result5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
mov    $0x0,%al
call   1040 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <sum@plt>
mov    %eax,%ebx
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
xor    %eax,%eax
call   1040 <sum@plt>
mov    %eax,%ebp
lea    0xe90(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"result3 = %d\0A\00"
@.str.1 = [14 x i8] c"result5 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i32, i32, i32, i32, ...) @sum(i32 3, i32 1, i32 2, i32 3)
store i32 %4, i32* %2
%5 = call i32 (i32, i32, i32, i32, ...) @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"result3 = %d\0A\00"
@.str.1 = [14 x i8] c"result5 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, i32, i32, ...) @sum(i32 3, i32 1, i32 2, i32 3)
%2 = tail call i32 (i32, i32, i32, i32, ...) @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
void rop3_167_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | T;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_167_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_167_1_1>:
or     %edx,%esi
mov    (%rdi),%al
and    %sil,%al
mov    %eax,%ecx
xor    %dl,%cl
or     %sil,%cl
not    %cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_167_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = load i8*, i8** %4
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = load i8, i8* %6
%54 = zext i8 %53 to i32
%55 = and i32 %52, %54
%56 = or i32 %49, %55
%57 = trunc i32 %56 to i8
%58 = load i8*, i8** %4
store i8 %57, i8* %58
ret void
}

LLVM IR (-O2):
define void @rop3_167_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
%8 = or i8 %7, %4
%9 = xor i8 %8, -1
%10 = or i8 %6, %9
store i8 %10, i8* %0
ret void
}
char *hash_plugin_summary(void) {
  return ("sha256unix \tSHA256(Unix) plugin (shadow files)");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"sha256unix \09SHA256(Unix) plugin (shadow files)\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"sha256unix \09SHA256(Unix) plugin (shadow files)\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
float testsf(float *p) {
  if (*p > 1.1234f)
    return 2.1234f;
  else
    return 3.1234f;
}


x86 assembly (clang, -O0):
<testsf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  0xee8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1133 <testsf+0x33>
movss  0xedf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1140 <testsf+0x40>
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<testsf>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss 0xef3(%rip),%xmm0
seta   %al
lea    0xeed(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @testsf(float* %0) {
%2 = alloca float
%3 = alloca float*
store float* %0, float** %3
%4 = load float*, float** %3
%5 = load float, float* %4
%6 = fcmp ogt float %5, 0x3FF1F97240000000
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0x4000FCB920000000, float* %2
br label %9
8: ; preds = %1
store float 0x4008FCB920000000, float* %2
br label %9
9: ; preds = %8, %7
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
define float @testsf(float* nocapture %0) {
%2 = load float, float* %0
%3 = fcmp ogt float %2, 0x3FF1F97240000000
%4 = select i1 %3, float 0x4000FCB920000000, float 0x4008FCB920000000
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char **argv, int exit_code) {
  printf("Usage  : %s <listen port> "
         "[buffer size (KB, default: 400] "
         "[send_count (default: 0)]\n",
         argv[0]);
  printf("Example: %s 9000 200 100\n", argv[0]);
  exit(exit_code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
lea    0xf14(%rip),%rdi
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [85 x i8] c"Usage : %s <listen port> [buffer size (KB, default: 400] [send_count (default: 0)]\0A\00"
@.str.1 = [26 x i8] c"Example: %s 9000 200 100\0A\00"
define void @usage(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 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i32, i32* %4
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [85 x i8] c"Usage : %s <listen port> [buffer size (KB, default: 400] [send_count (default: 0)]\0A\00"
@.str.1 = [26 x i8] c"Example: %s 9000 200 100\0A\00"
define void @usage(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 %1)
unreachable
}