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

/* Variables and functions */
int /*<<< orphan*/ zmem(int /*<<< orphan*/);
uint8_t read8(uint32_t address) { return zmem(address); }


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

x86 assembly (clang, -O2):
<read8>:
jmp    1030 <zmem@plt>

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

LLVM IR (-O2):
define i32 @read8(i32 %0) {
%2 = tail call i32 @zmem(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *rl_get_filename_with_suffix(char const *, char *);
char *get_wal_filename(const char *filename) {
  return rl_get_filename_with_suffix(filename, ".wal");
}


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

x86 assembly (clang, -O2):
<get_wal_filename>:
lea    0xee9(%rip),%rsi
jmp    1030 <rl_get_filename_with_suffix@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".wal\00"
define i8* @get_wal_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @rl_get_filename_with_suffix(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [5 x i8] c".wal\00"
define i8* @get_wal_filename(i8* %0) {
%2 = tail call i8* @rl_get_filename_with_suffix(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ StateMachineTypeC();
void core_state_machine(void) { StateMachineTypeC(); }


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

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

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

LLVM IR (-O2):
define void @core_state_machine() {
%1 = tail call i32 (...) @StateMachineTypeC()
ret void
}
int test_imm_EFint64_highword_reg(long long val) {
  return ((val >> 32) & (0xEF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EFint64_highword_reg>:
movabs $0xef00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EFint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 239
%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_EFint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1026497183744
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(int, int);
int main(void) { printf("%d\n", rightrot(3, 1)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

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


x86 assembly (clang, -O0):
<rul__emit_page_break>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rul___emit_verify_newline@plt>
lea    0xebe(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    $0x0,%al
call   1050 <rul___emit_newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__emit_page_break>:
push   %rax
xor    %eax,%eax
call   1040 <rul___emit_verify_newline@plt>
lea    0xec1(%rip),%rdi
call   1030 <rul___emit_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rul___emit_newline@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0C\00"
define void @rul__emit_page_break() {
%1 = call i32 (...) @rul___emit_verify_newline()
%2 = call i32 @rul___emit_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @rul___emit_newline()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0C\00"
define void @rul__emit_page_break() {
%1 = tail call i32 (...) @rul___emit_verify_newline()
%2 = tail call i32 @rul___emit_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @rul___emit_newline()
ret void
}
/* Variables and functions */
void stub1(long long, short);
void testClosureLLSrV(void (*closure)(long long, short), long long a1,
                      short a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureLLSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <testClosureLLSrV+0x30>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movswl -0x12(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLSrV>:
test   %rdi,%rdi
je     1112 <testClosureLLSrV+0x12>
mov    %rdi,%rax
movswl %dx,%ecx
mov    %rsi,%rdi
mov    %ecx,%esi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureLLSrV(void (i64, i16)* %0, i64 %1, i16 signext %2) {
%4 = alloca void (i64, i16)*
%5 = alloca i64
%6 = alloca i16
store void (i64, i16)* %0, void (i64, i16)** %4
store i64 %1, i64* %5
store i16 %2, i16* %6
%7 = load void (i64, i16)*, void (i64, i16)** %4
%8 = icmp ne void (i64, i16)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (i64, i16)*, void (i64, i16)** %4
%11 = load i64, i64* %5
%12 = load i16, i16* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureLLSrV(void (i64, i16)* %0, i64 %1, i16 signext %2) {
%4 = icmp eq void (i64, i16)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i64 %1, i16 signext %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *form_getvar(char const *);
char *strdup(char const *);
char *form_get(const char *name) {
  const char *val = form_getvar(name);
  if (!val)
    return NULL;
  return strdup(val);
}


x86 assembly (clang, -O0):
<form_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <form_getvar@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <form_get+0x31>
movq   $0x0,-0x8(%rbp)
jmp    115e <form_get+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_get>:
push   %rax
call   1030 <form_getvar@plt>
test   %rax,%rax
je     1134 <form_get+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @form_get(i8* %0) {
%2 = tail call i8* @form_getvar(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @strdup(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ _websocket_free(int);
int std_close(int);
int close(int sockfd) {
  _websocket_free(sockfd);
  return std_close(sockfd);
}


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

x86 assembly (clang, -O2):
<close>:
push   %rbx
mov    %edi,%ebx
call   1030 <_websocket_free@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <std_close@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 @_websocket_free(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @std_close(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @_websocket_free(i32 %0)
%3 = tail call i32 @std_close(i32 %0)
ret i32 %3
}
/* Variables and functions */
char *list_prepend(char *, scalar_t__);
char const *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char const *push_filename(char **list, char const *filename) {
  char *p;
  p = list_prepend(*list, strlen(filename) + 1);
  if (!p) {
    return NULL;
  }
  *list = p;
  return strcpy(p, filename);
}


x86 assembly (clang, -O0):
<push_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1050 <list_prepend@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1180 <push_filename+0x50>
movq   $0x0,-0x8(%rbp)
jmp    119c <push_filename+0x6c>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_filename>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
call   1050 <list_prepend@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1168 <push_filename+0x38>
mov    %rbx,(%r15)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @push_filename(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @list_prepend(i8* %3, i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
store i8* %6, i8** %0
%9 = tail call i8* @strcpy(i8* %6, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %2, %8
ret i8* %6
}
int snd_seq_get_bit(int nr, void *array) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @snd_seq_get_bit(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strend(char *, char *);
int main(void) {
  char str1[6] = "hello";
  char str2[4] = "lo";
  printf("strend result = \'%d\'\n", strend(str1, str2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xed3(%rip),%eax
mov    %eax,-0xe(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1040 <strend@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6568,0x10(%rsp)
6c
movl   $0x6f6c,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <strend@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str1 = [6 x i8] c"hello\00"
@__const.main.str2 = [4 x i8] c"lo\00\00"
@.str = [22 x i8] c"strend result = '%d'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @strend(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [6 x i8] c"hello\00"
@.str = [22 x i8] c"strend result = '%d'\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 28524, i32* %2
%5 = call i32 @strend(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ isalnum(char);
int inword(char c) {
  if (isalnum(c)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<inword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     113d <inword+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <inword+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inword>:
push   %rax
call   1030 <isalnum@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @inword(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *filename) {
  struct stat buf;
  return (stat(filename, &buf) == 0);
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
double foo(double x, double y) {
  volatile int i = 0;
  return i != 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
je     1130 <foo+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    113a <foo+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     1112 <foo+0x12>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
store volatile i32 0, i32* %5
%6 = load volatile i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, double %1, double %0
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ pin_Direction(int);
int /*<<< orphan*/ pin_Value(int, int);
void motor_direction_left(int dl) {
  pin_Direction(44);
  pin_Value(44, dl);
}


x86 assembly (clang, -O0):
<motor_direction_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2c,%edi
call   1030 <pin_Direction@plt>
mov    -0x4(%rbp),%esi
mov    $0x2c,%edi
call   1040 <pin_Value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motor_direction_left>:
push   %rbx
mov    %edi,%ebx
mov    $0x2c,%edi
call   1030 <pin_Direction@plt>
mov    $0x2c,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <pin_Value@plt>

LLVM IR (-O0):
define void @motor_direction_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pin_Direction(i32 44)
%4 = load i32, i32* %2
%5 = call i32 @pin_Value(i32 44, i32 %4)
ret void
}

LLVM IR (-O2):
define void @motor_direction_left(i32 %0) {
%2 = tail call i32 @pin_Direction(i32 44)
%3 = tail call i32 @pin_Value(i32 44, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void shutdown_windows() {
  ;
  endwin();
  { return; };
}


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

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

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

LLVM IR (-O2):
define void @shutdown_windows() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t pack_b16(unsigned int b16) { return (uint64_t)b16 << 32; }


x86 assembly (clang, -O0):
<pack_b16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pack_b16(i32 %0) {
ret i32 poison
}
int main() {
  char s = 1;
  int v[1000];
  int f1(char *);
  if (f1(&s) != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfb0,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <f1@plt>
cmp    $0x2,%eax
je     1144 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <main+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x1,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <f1@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [1000 x i32]
store i32 0, i32* %1
store i8 1, i8* %2
%4 = call i32 @f1(i8* %2)
%5 = icmp ne i32 %4, 2
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):
define i32 @main() {
%1 = alloca i8
store i8 1, i8* %1
%2 = call i32 @f1(i8* %1)
%3 = icmp ne i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *__tsan_default_options() { return "allocator_may_return_null=1"; }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"allocator_may_return_null=1\00"
define i8* @__tsan_default_options() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [28 x i8] c"allocator_may_return_null=1\00"
define i8* @__tsan_default_options() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}
void XtGrabPointer() {}


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

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

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

LLVM IR (-O2):
define void @XtGrabPointer() {
ret void
}
void ARGB1555ToARGBRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGB1555ToARGBRow_SSE2() {
ret void
}
__attribute__((no, noclone)) int f3(void *a, int *b) {
  asm volatile("" : : "r"(a), "r"(b) : "memory");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @f3(i8* %0, i32* %1) {
tail call void asm sideeffect "", "r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32* %1)
ret i32 0
}
/* Type definitions */
struct eb_root {
  int dummy;
};
struct eb64_node {
  int dummy;
};

/* Variables and functions */
struct eb64_node *__eb64i_insert(struct eb_root *, struct eb64_node *);
struct eb64_node *eb64i_insert(struct eb_root *root, struct eb64_node *new) {
  return __eb64i_insert(root, new);
}


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

x86 assembly (clang, -O2):
<eb64i_insert>:
jmp    1030 <__eb64i_insert@plt>

LLVM IR (-O0):
%struct.eb_root = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.eb64_node* @eb64i_insert(%struct.eb_root* %0, %struct.eb64_node* %1) {
%3 = alloca %struct.eb_root*
%4 = alloca %struct.eb64_node*
store %struct.eb_root* %0, %struct.eb_root** %3
store %struct.eb64_node* %1, %struct.eb64_node** %4
%5 = load %struct.eb_root*, %struct.eb_root** %3
%6 = load %struct.eb64_node*, %struct.eb64_node** %4
%7 = call %struct.eb64_node* @__eb64i_insert(%struct.eb_root* %5, %struct.eb64_node* %6)
ret %struct.eb64_node* %7
}

LLVM IR (-O2):
%struct.eb_root = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.eb64_node* @eb64i_insert(%struct.eb_root* %0, %struct.eb64_node* %1) {
%3 = tail call %struct.eb64_node* @__eb64i_insert(%struct.eb_root* %0, %struct.eb64_node* %1)
ret %struct.eb64_node* %3
}
/* Variables and functions */
unsigned islower(char c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <islower+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @islower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float __rmod(float, float);
float intr_wrap_388(float p1, float p2) { return __rmod(p1, p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_388>:
jmp    1030 <__rmod@plt>

LLVM IR (-O0):
define float @intr_wrap_388(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 = call float @__rmod(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @intr_wrap_388(float %0, float %1) {
%3 = tail call float @__rmod(float %0, float %1)
ret float %3
}
unsigned geom_imin2d(const double v[2]) { return (v[0] < v[1]) ? 0 : 1; }


x86 assembly (clang, -O0):
<geom_imin2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    $0x1,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_imin2d>:
movsd  0x8(%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @geom_imin2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = fcmp olt double %5, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @geom_imin2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fcmp uge double %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int console_test(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @console_test() {
ret i32 1
}

LLVM IR (-O2):
define i32 @console_test() {
ret i32 1
}
/* Variables and functions */
char const *file_generic(char *);
const char *file_info(void) { return file_generic("info"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"info\00"
define i8* @file_info() {
%1 = call i8* @file_generic(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"info\00"
define i8* @file_info() {
%1 = tail call i8* @file_generic(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char const *pubnub_version(void) { return "2.7"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"2.7\00"
define i8* @pubnub_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"2.7\00"
define i8* @pubnub_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort(int *, int);
int /*<<< orphan*/ printIntArray(int *, int);
int main(int argc, char **argv) {
  int array[] = {23, 54, 6, 12, 76, 3, 5, 8};
  insertion_sort(array, 8);
  printIntArray(array, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1040 <insertion_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <printIntArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <insertion_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printIntArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [8 x i32] [i32 23, i32 54, i32 6, i32 12, i32 76, i32 3, i32 5, i32 8]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [8 x i32]* %6 to i8*
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%9 = call i32 @insertion_sort(i32* %8, i32 8)
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%11 = call i32 @printIntArray(i32* %10, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [8 x i32] [i32 23, i32 54, i32 6, i32 12, i32 76, i32 3, i32 5, i32 8]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @insertion_sort(i32* %5, i32 8)
%7 = call i32 @printIntArray(i32* %5, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  scanf("%d", &num);
  if (num % 2 == 0)
    printf("%d eh par", num);
  else
    printf("%d eh impar", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <main+0x47>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    1176 <main+0x56>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   $0x1,%sil
lea    0xec2(%rip),%rax
lea    0xec5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d eh par\00"
@.str.2 = [12 x i8] c"%d eh impar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* %7, i32 %4)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void TimerClockSourceSet(uint32_t ui32Base, uint32_t ui32Source) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) = ui32Source;
}


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

x86 assembly (clang, -O2):
<TimerClockSourceSet>:
mov    %rsi,0xfc8(%rdi)
ret

LLVM IR (-O0):
define void @TimerClockSourceSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerClockSourceSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 4040
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_atime;
};

/* Variables and functions */
time_t posix_stat_st_atime(const struct stat *st) { return st->st_atime; }


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_atime(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_atime(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct charArray {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ charArrayClean(struct charArray *);
void charstringClean(struct charArray *s) { charArrayClean(s); }


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

x86 assembly (clang, -O2):
<charstringClean>:
jmp    1030 <charArrayClean@plt>

LLVM IR (-O0):
%struct.charArray = type { i32 }
define void @charstringClean(%struct.charArray* %0) {
%2 = alloca %struct.charArray*
store %struct.charArray* %0, %struct.charArray** %2
%3 = load %struct.charArray*, %struct.charArray** %2
%4 = call i32 @charArrayClean(%struct.charArray* %3)
ret void
}

LLVM IR (-O2):
%struct.charArray = type { i32 }
define void @charstringClean(%struct.charArray* %0) {
%2 = tail call i32 @charArrayClean(%struct.charArray* %0)
ret void
}
int LIT1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @LIT1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int main() {
  chdir("/mnt/user/code/CreateDistanceSensor/target/classes");
  system("/mnt/user/jvm/java Main");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <chdir@plt>
lea    0xefc(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [51 x i8] c"/mnt/user/code/CreateDistanceSensor/target/classes\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"/mnt/user/code/CreateDistanceSensor/target/classes\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void mic_free(double *data, size_t nelem, int device, int offload) {
#pragma offload_transfer target(mic                                            \
                                : device)                                      \
    nocopy(data                                                                \
           : length(nelem) alloc_if(0) free_if(1)) if (offload)
}


x86 assembly (clang, -O0):
<mic_free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mic_free(double* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @mic_free(double* nocapture %0, i64 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
long keyctl(int, int);
long keyctl_set_reqkey_keyring(int reqkey_defl) {
  return keyctl(14, reqkey_defl);
}


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

x86 assembly (clang, -O2):
<keyctl_set_reqkey_keyring>:
mov    %edi,%esi
mov    $0xe,%edi
jmp    1030 <keyctl@plt>

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

LLVM IR (-O2):
define i64 @keyctl_set_reqkey_keyring(i32 %0) {
%2 = tail call i64 @keyctl(i32 14, i32 %0)
ret i64 %2
}
void ast_register_file_version(const char *file, const char *version) {}


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

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

LLVM IR (-O0):
define void @ast_register_file_version(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @ast_register_file_version(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int msm_fsusb_resume_phy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_fsusb_resume_phy() {
ret i32 0
}
int test_imm_23uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x23 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_23uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 35
%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_23uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 35
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int f35(unsigned int x, int y __attribute__((unused))) {
  return (x >> 1) | (x << ((-1) & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f35>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f35(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 = lshr i32 %5, 1
%7 = load i32, i32* %3
%8 = shl i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f35(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
void foobar(void) {
  int x;
  (*(void (*)(void)) & x)();
}


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foobar>:
push   %rax
lea    0x4(%rsp),%rax
call   *%rax
pop    %rax
ret

LLVM IR (-O0):
define void @foobar() {
%1 = alloca i32
%2 = bitcast i32* %1 to void ()*
ret void
}

LLVM IR (-O2):
define void @foobar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = bitcast i32* %1 to void ()*
ret void
}
int comp(const void *n1, const void *n2) { return *(int *)n1 - *(int *)n2; }


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

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

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void driveReverse(int speed) {}


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

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

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

LLVM IR (-O2):
define void @driveReverse(i32 %0) {
ret void
}
/* Variables and functions */
double fabs(double);
double ddiff(double a, double b) { return fabs(a - b); }


x86 assembly (clang, -O0):
<ddiff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddiff>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ddiff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
ret double %8
}

LLVM IR (-O2):
define double @ddiff(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
ret double %4
}
int tilt_get_button(int *b, int *s) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tilt_get_button(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}