xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ eapol_sm_step(void *);
void eapol_sm_step_timeout(void *eloop_ctx, void *timeout_ctx) {
  eapol_sm_step(timeout_ctx);
}


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

x86 assembly (clang, -O2):
<eapol_sm_step_timeout>:
mov    %rsi,%rdi
jmp    1030 <eapol_sm_step@plt>

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

LLVM IR (-O2):
define void @eapol_sm_step_timeout(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @eapol_sm_step(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_xstrdup() {
  printf("NOT IMPLEMENTED:"
         "pa_xstrdup"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"NOT IMPLEMENTED:pa_xstrdup\00"
define i32 @pa_xstrdup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ puts(char *);
int sprintf(char *, char *, int, char *);
int main() {
  char str[80];
  memset(str, 'a', 20);
  int length = sprintf(&str[10], "asdfasdf %d %s\n", 43, "asdfasdfvyx");
  puts(str);
  return length;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x61,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
add    $0xa,%rdi
lea    0xe9f(%rip),%rsi
mov    $0x2b,%edx
lea    0xea3(%rip),%rcx
call   1050 <sprintf@plt>
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x64(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x58,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    0xa(%rsp),%rdi
lea    0xea9(%rip),%rsi
lea    0xeb2(%rip),%rcx
mov    $0x2b,%edx
call   1050 <sprintf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"asdfasdf %d %s\0A\00"
@.str.1 = [12 x i8] c"asdfasdfvyx\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i8 signext 97, i32 20)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 10
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %3
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"asdfasdf %d %s\0A\00"
@.str.1 = [12 x i8] c"asdfasdfvyx\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 97, i32 20)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 10
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void assert_malloc(void *ptr) {
  if (ptr == NULL)
    perror("ERROR: assert_malloc");
}


x86 assembly (clang, -O0):
<assert_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <assert_malloc+0x23>
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_malloc>:
test   %rdi,%rdi
je     1116 <assert_malloc+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <perror@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"ERROR: assert_malloc\00"
define void @assert_malloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"ERROR: assert_malloc\00"
define void @assert_malloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t log_sense_subpage_code(uint8_t *data) { return data[1]; }


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

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

LLVM IR (-O0):
define i32 @log_sense_subpage_code(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @log_sense_subpage_code(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int atoi(char const *);
int str2int(__const char *str) { return atoi(str); }


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

x86 assembly (clang, -O2):
<str2int>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @str2int(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
int fun1272() { return 1272; }


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

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

LLVM IR (-O0):
define i32 @fun1272() {
ret i32 1272
}

LLVM IR (-O2):
define i32 @fun1272() {
ret i32 1272
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int tracker_cmd(int, char *, int /*<<< orphan*/ *);
void tracker_dump(char *host) {
  int sfd = tracker_cmd(3, host, NULL);
  close(sfd);
}


x86 assembly (clang, -O0):
<tracker_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <tracker_cmd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracker_dump>:
push   %rax
mov    %rdi,%rsi
mov    $0x3,%edi
xor    %edx,%edx
call   1030 <tracker_cmd@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @tracker_dump(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @tracker_cmd(i32 3, i8* %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @close(i32 %6)
ret void
}

LLVM IR (-O2):
define void @tracker_dump(i8* %0) {
%2 = tail call i32 @tracker_cmd(i32 3, i8* %0, i32* null)
%3 = tail call i32 @close(i32 %2)
ret void
}
/* Type definitions */
typedef unsigned long long uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
void volatile_clear_bit_u64(uint64_t *mask, uint8_t bit) {
  *((volatile uint64_t *)mask) &= ~(1ULL << bit);
}


x86 assembly (clang, -O0):
<volatile_clear_bit_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_clear_bit_u64>:
mov    %rsi,%rcx
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
and    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_clear_bit_u64(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 = shl i64 1, %5
%7 = xor i64 %6, -1
%8 = load i64*, i64** %3
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %7
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @volatile_clear_bit_u64(i64* %0, i64 %1) {
%3 = shl nuw i64 1, %1
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* %0
%6 = and i64 %5, %4
store volatile i64 %6, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setgroupent(int /*<<< orphan*/);
void setgrent(void) { (void)setgroupent(0); }


x86 assembly (clang, -O0):
<setgrent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <setgroupent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setgrent>:
xor    %edi,%edi
jmp    1030 <setgroupent@plt>

LLVM IR (-O0):
define void @setgrent() {
%1 = call i32 @setgroupent(i32 0)
ret void
}

LLVM IR (-O2):
define void @setgrent() {
%1 = tail call i32 @setgroupent(i32 0)
ret void
}
/* Variables and functions */
int intel_ich_gpio_set(int, int);
int intel_ich_gpio18_raise(void) { return intel_ich_gpio_set(18, 1); }


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

x86 assembly (clang, -O2):
<intel_ich_gpio18_raise>:
mov    $0x12,%edi
mov    $0x1,%esi
jmp    1030 <intel_ich_gpio_set@plt>

LLVM IR (-O0):
define i32 @intel_ich_gpio18_raise() {
%1 = call i32 @intel_ich_gpio_set(i32 18, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intel_ich_gpio18_raise() {
%1 = tail call i32 @intel_ich_gpio_set(i32 18, i32 1)
ret i32 %1
}
void PlatformFactory(void) { return; }


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

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

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

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

/* Variables and functions */
void volatile_fetch_sub_u8(uint8_t *dest, uint8_t val) {
  *((volatile uint8_t *)dest) -= val;
}


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

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

LLVM IR (-O0):
define void @volatile_fetch_sub_u8(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 = load volatile i64, i64* %6
%8 = sub nsw i64 %7, %5
store volatile i64 %8, i64* %6
ret void
}

LLVM IR (-O2):
define void @volatile_fetch_sub_u8(i64* %0, i64 %1) {
%3 = load volatile i64, i64* %0
%4 = sub nsw i64 %3, %1
store volatile i64 %4, i64* %0
ret void
}
/* Variables and functions */
char *getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void cmd_pwd(int argc, char **argv) {
  char buffer[1024];
  printf("%s\n", getcwd(buffer, 1024));
}


x86 assembly (clang, -O0):
<cmd_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
mov    %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_pwd>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x408,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @cmd_pwd(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i8* @getcwd(i8* %4, i32 1024)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, World!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ COND_PL();
int /*<<< orphan*/ EA_AY_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_spl_8_pi(void) {
  m68ki_write_8(EA_AY_PI_8(), COND_PL() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_spl_8_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_PL@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_spl_8_pi>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_PL@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_spl_8_pi() {
%1 = call i32 (...) @EA_AY_PI_8()
%2 = call i64 (...) @COND_PL()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_spl_8_pi() {
%1 = tail call i32 (...) @EA_AY_PI_8()
%2 = tail call i64 (...) @COND_PL()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int x;
  foo(&x);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @foo(i32* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @foo(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main(void) {
  printf("%d %d\n", 5, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5, i32 0)
ret i32 0
}
void break5() {}


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

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

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

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

/* Variables and functions */
uint32_t get_cr3() {
  uint32_t v;
  asm volatile("mov %%"
               "cr3"
               ", %0"
               : "=r"(v));
  return v;
}


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

x86 assembly (clang, -O2):
<get_cr3>:
mov    %cr3,%rax
ret

LLVM IR (-O0):
define i8* @get_cr3() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @get_cr3() {
%1 = tail call i8* asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprime(int *v, int tam) {
  int i;
  for (i = 0; i < tam; i++) {
    printf(" %d", v[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<imprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <imprime+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprime+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <imprime+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <imprime+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @imprime(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
void Jump(char *label) {
  Inst_Printf("lda", "$3,%s", label);
  Inst_Printf("jmp", "$31,($3),%s", label);
}


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

x86 assembly (clang, -O2):
<Jump>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    %rbx,%rdx
call   1030 <Inst_Printf@plt>
lea    0xed9(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"lda\00"
@.str.1 = [6 x i8] c"$3,%s\00"
@.str.2 = [4 x i8] c"jmp\00"
@.str.3 = [12 x i8] c"$31,($3),%s\00"
define void @Jump(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"lda\00"
@.str.1 = [6 x i8] c"$3,%s\00"
@.str.2 = [4 x i8] c"jmp\00"
@.str.3 = [12 x i8] c"$31,($3),%s\00"
define void @Jump(i8* %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}
void g_key_file_remove_comment() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_remove_comment() {
ret void
}
int rec(int x) {
  if (x <= 0) {
    return x;
  } else if (x % 2 == 0) {
    return rec(x / 2);
  } else {
    int store = rec(++x);
    return store + rec(--x);
  }
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1130 <rec+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118d <rec+0x7d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115e <rec+0x4e>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <rec@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <rec+0x7d>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x8(%rbp)
call   1030 <rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x8(%rbp)
call   1030 <rec@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
test   %edi,%edi
jg     1130 <rec+0x20>
jmp    1142 <rec+0x32>
lea    0x1(%rbx),%edi
call   1030 <rec@plt>
add    %eax,%ebp
nopw   0x0(%rax,%rax,1)
test   $0x1,%bl
jne    111d <rec+0xd>
mov    %ebx,%eax
shr    %eax
cmp    $0x2,%ebx
mov    %eax,%ebx
jae    1130 <rec+0x20>
mov    %eax,%ebx
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rec(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %7, %13 ], [ %0, %1 ]
%5 = phi i32 [ %16, %13 ], [ 0, %1 ]
br label %6
6: ; preds = %3, %10
%7 = phi i32 [ %4, %3 ], [ %11, %10 ]
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = lshr i32 %7, 1
%12 = icmp ult i32 %7, 2
br i1 %12, label %17, label %6
13: ; preds = %6
%14 = add nuw nsw i32 %7, 1
%15 = tail call i32 @rec(i32 %14)
%16 = add nsw i32 %15, %5
br label %3
17: ; preds = %10, %1
%18 = phi i32 [ 0, %1 ], [ %5, %10 ]
%19 = phi i32 [ %0, %1 ], [ %11, %10 ]
%20 = add nsw i32 %19, %18
ret i32 %20
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int little_endianess() {
  volatile uint32_t i = 0x01234567;
  return (*((uint8_t *)(&i))) == 0x67;
}


x86 assembly (clang, -O0):
<little_endianess>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1234567,-0x4(%rbp)
cmpl   $0x67,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<little_endianess>:
movl   $0x1234567,-0x4(%rsp)
01
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @little_endianess() {
%1 = alloca i32
store volatile i32 19088743, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 103
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @little_endianess() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 19088743, i32* %1
ret i32 0
}
int accesstest() { int access = 0; }


x86 assembly (clang, -O0):
<accesstest>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @accesstest() {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, scalar_t__, scalar_t__);
int expect_vao(off_t expected, off_t ret) {
  printf("\tVAO Expected %ld, Got %ld\n", expected, ret);
  fflush(NULL);
  if (ret == expected) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<expect_vao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1167 <expect_vao+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <expect_vao+0x4e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_vao>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
xor    %eax,%eax
cmp    %rbx,%r14
setne  %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\09VAO Expected %ld, Got %ld\0A\00"
define i32 @expect_vao(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %7)
%9 = call i32 @fflush(i32* null)
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [28 x i8] c"\09VAO Expected %ld, Got %ld\0A\00"
define i32 @expect_vao(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%4 = tail call i32 @fflush(i32* null)
%5 = icmp ne i64 %1, %0
%6 = sext i1 %5 to i32
ret i32 %6
}
void foo316(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo316(i32 %0) {
ret void
}
/* Variables and functions */
int redislite_page_string_incr_by_key_string(void *, char *, size_t, int,
                                             long long *);
int redislite_page_string_decr_key_string(void *_cs, char *key_name,
                                          size_t key_length,
                                          long long *new_value) {
  return redislite_page_string_incr_by_key_string(_cs, key_name, key_length, -1,
                                                  new_value);
}


x86 assembly (clang, -O0):
<redislite_page_string_decr_key_string>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    $0xffffffff,%ecx
call   1030 <redislite_page_string_incr_by_key_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redislite_page_string_decr_key_string>:
mov    %rcx,%r8
mov    $0xffffffff,%ecx
jmp    1030 <redislite_page_string_incr_by_key_string@plt>

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

LLVM IR (-O2):
define i32 @redislite_page_string_decr_key_string(i8* %0, i8* %1, i64 %2, i64* %3) {
%5 = tail call i32 @redislite_page_string_incr_by_key_string(i8* %0, i8* %1, i64 %2, i32 -1, i64* %3)
ret i32 %5
}
int test_imm_8Fint32_reg(int val) { return ((val) & (0x8F << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_8Fint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Fint32_reg>:
test   $0x8f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Fint32_reg(i32 %0) {
%2 = and i32 %0, 143
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _cc3_delay_sccb();
void _cc3_set_cam_ddr_sccb_idle(void) {
  (*(volatile unsigned long *)((0xE0028008))) = 0x003EBDC9;
  _cc3_delay_sccb();
}


x86 assembly (clang, -O0):
<_cc3_set_cam_ddr_sccb_idle>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028008,%eax
movq   $0x3ebdc9,(%rax)
mov    $0x0,%al
call   1030 <_cc3_delay_sccb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_set_cam_ddr_sccb_idle>:
mov    $0xe0028008,%eax
movq   $0x3ebdc9,(%rax)
xor    %eax,%eax
jmp    1030 <_cc3_delay_sccb@plt>

LLVM IR (-O0):
define void @_cc3_set_cam_ddr_sccb_idle() {
store volatile i64 4111817, i64* inttoptr (i64 3758260232 to i64*)
%1 = call i32 (...) @_cc3_delay_sccb()
ret void
}

LLVM IR (-O2):
define void @_cc3_set_cam_ddr_sccb_idle() {
store volatile i64 4111817, i64* inttoptr (i64 3758260232 to i64*)
%1 = tail call i32 (...) @_cc3_delay_sccb()
ret void
}
/* Type definitions */
struct usd_qp_impl {
  int dummy;
};
struct usd_qp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ usd_vnic_disable_qp(struct usd_qp_impl *);
int usd_disable_qp(struct usd_qp *uqp) {
  struct usd_qp_impl *qp;
  qp = ((struct usd_qp_impl *)(uqp));
  usd_vnic_disable_qp(qp);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.usd_qp = type { i32 }
%struct.usd_qp_impl = type { i32 }
define i32 @usd_disable_qp(%struct.usd_qp* %0) {
%2 = alloca %struct.usd_qp*
%3 = alloca %struct.usd_qp_impl*
store %struct.usd_qp* %0, %struct.usd_qp** %2
%4 = load %struct.usd_qp*, %struct.usd_qp** %2
%5 = bitcast %struct.usd_qp* %4 to %struct.usd_qp_impl*
store %struct.usd_qp_impl* %5, %struct.usd_qp_impl** %3
%6 = load %struct.usd_qp_impl*, %struct.usd_qp_impl** %3
%7 = call i32 @usd_vnic_disable_qp(%struct.usd_qp_impl* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.usd_qp = type { i32 }
%struct.usd_qp_impl = type { i32 }
define i32 @usd_disable_qp(%struct.usd_qp* %0) {
%2 = bitcast %struct.usd_qp* %0 to %struct.usd_qp_impl*
%3 = tail call i32 @usd_vnic_disable_qp(%struct.usd_qp_impl* %2)
ret i32 0
}
void kvm_pmu_cpuid_update(struct kvm_vcpu *vcpu) {}


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

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

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

LLVM IR (-O2):
%struct.kvm_vcpu = type opaque
define void @kvm_pmu_cpuid_update(%struct.kvm_vcpu* nocapture %0) {
ret void
}
/* Variables and functions */
double abs(double);
double UC_11_5_4(double M_1_v_s_d, double M_1_v_sym_u_d) {
  return (abs(M_1_v_s_d) / M_1_v_sym_u_d);
}


x86 assembly (clang, -O0):
<UC_11_5_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
divsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UC_11_5_4>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <abs@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @UC_11_5_4(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 = call double @abs(double %5)
%7 = load double, double* %4
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @UC_11_5_4(double %0, double %1) {
%3 = tail call double @abs(double %0)
%4 = fdiv double %3, %1
ret double %4
}
int wrdlen(char *ch2) {
  int len;
  len = 0;
  while (*ch2 != '\n' && *ch2 != '\0' && *ch2 != ' ' && *ch2 != '\t') {
    len++;
    ch2++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<wrdlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     115e <wrdlen+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     115e <wrdlen+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     115e <wrdlen+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116e <wrdlen+0x6e>
jmp    1188 <wrdlen+0x88>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <wrdlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrdlen>:
xor    %eax,%eax
movabs $0x100000601,%rcx
jmp    1114 <wrdlen+0x14>
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x20,%rdx
ja     1110 <wrdlen+0x10>
bt     %rdx,%rcx
jae    1110 <wrdlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @wrdlen(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = phi i32 [ 0, %1 ], [ %7, %6 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 10, label %9
i8 0, label %9
i8 32, label %9
i8 9, label %9
]
6: ; preds = %2
%7 = add nuw nsw i32 %4, 1
%8 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
9: ; preds = %2, %2, %2, %2
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
scalar_t__ clock();
void delay(int seconds) {
  clock_t start = clock();
  clock_t lay = (clock_t)seconds * CLOCKS_PER_SEC;
  while ((clock() - start) < lay)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    0x2eb7(%rip),%rcx
imul   (%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1153 <delay+0x43>
jmp    1139 <delay+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
movslq %ebp,%rbp
mov    0x2ebf(%rip),%rax
imul   (%rax),%rbp
nopl   (%rax)
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
cmp    %rbp,%rax
jl     1130 <delay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = call i64 (...) @clock()
store i64 %5, i64* %3
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = load i64, i64* @CLOCKS_PER_SEC
%9 = mul nsw i64 %7, %8
store i64 %9, i64* %4
br label %10
10: ; preds = %16, %1
%11 = call i64 (...) @clock()
%12 = load i64, i64* %3
%13 = sub nsw i64 %11, %12
%14 = load i64, i64* %4
%15 = icmp slt i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %10
br label %10
17: ; preds = %10
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define void @delay(i32 %0) {
%2 = tail call i64 (...) @clock()
%3 = sext i32 %0 to i64
%4 = load i64, i64* @CLOCKS_PER_SEC
%5 = mul nsw i64 %4, %3
br label %6
6: ; preds = %6, %1
%7 = tail call i64 (...) @clock()
%8 = sub nsw i64 %7, %2
%9 = icmp slt i64 %8, %5
br i1 %9, label %6, label %10
10: ; preds = %6
ret void
}
int((user_service_info_transmit))(struct ss7 *ss7, struct isup_call *c,
                                  int messagetype, unsigned char *parm,
                                  int len) {
  parm[0] = 0x90;
  parm[1] = 0x90;
  parm[2] = 0xa2;
  return 3;
}


x86 assembly (clang, -O0):
<user_service_info_transmit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x90,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x90,0x1(%rax)
mov    -0x20(%rbp),%rax
movb   $0xa2,0x2(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_service_info_transmit>:
movw   $0x9090,(%rcx)
movb   $0xa2,0x2(%rcx)
mov    $0x3,%eax
ret

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @user_service_info_transmit(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %9
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 -112, i8* %12
%13 = load i8*, i8** %9
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 -112, i8* %14
%15 = load i8*, i8** %9
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 -94, i8* %16
ret i32 3
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @user_service_info_transmit(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture writeonly %3, i32 %4) {
store i8 -112, i8* %3
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 -112, i8* %6
%7 = getelementptr inbounds i8, i8* %3, i64 2
store i8 -94, i8* %7
ret i32 3
}
void foo114() {}


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

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

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

LLVM IR (-O2):
define void @foo114() {
ret void
}
int test_imm_00uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 0
%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_00uint64_highword_reg(i64 %0) {
ret i32 -40
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("shawn 1.0\nhttp://dev.spline.de/shawn\n(c) 2011 Dirk Braun "
         "[http://www.26thmeussoc.com]\n");
}


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

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

LLVM IR (-O0):
@.str = [87 x i8] c"shawn 1.0\0Ahttp://dev.spline.de/shawn\0A(c) 2011 Dirk Braun [http://www.26thmeussoc.com]\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [86 x i8] c"shawn 1.0\0Ahttp://dev.spline.de/shawn\0A(c) 2011 Dirk Braun [http://www.26thmeussoc.com]\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
ret void
}
double bez_val(double t, double *c) {
  return (((c[3] * t + c[2]) * t + c[1]) * t + c[0]);
}


x86 assembly (clang, -O0):
<bez_val>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x8(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bez_val>:
movsd  0x18(%rdi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rdi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @bez_val(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 3
%7 = load double, double* %6
%8 = load double, double* %3
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %3
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = call double @llvm.fmuladd.f64(double %12, double %13, double %16)
%18 = load double, double* %3
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = call double @llvm.fmuladd.f64(double %17, double %18, double %21)
ret double %22
}

LLVM IR (-O2):
define double @bez_val(double %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 3
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %1, i64 2
%6 = load double, double* %5
%7 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %6)
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %9)
%11 = load double, double* %1
%12 = tail call double @llvm.fmuladd.f64(double %10, double %0, double %11)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bad(int /*<<< orphan*/, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  if (sizeof(long) != 4)
    exit(0);
  if (bad(0, 0xdeadbeef) == 0xdeadbeef)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}