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

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_imult(uint8_t r0, uint8_t r1, uint8_t r2) {
  return _bytecode_write(24, 0, 0, r0, r1, r2);
}


x86 assembly (clang, -O0):
<bytecode_imult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    $0x18,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_imult>:
mov    %edx,%r9d
mov    %esi,%r8d
mov    %edi,%ecx
mov    $0x18,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <_bytecode_write@plt>

LLVM IR (-O0):
define i32 @bytecode_imult(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @_bytecode_write(i32 24, i32 0, i32 0, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @bytecode_imult(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_bytecode_write(i32 24, i32 0, i32 0, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void getTime(char *buffer) {
  time_t t = time(NULL);
  strftime(buffer, 80, "%a, %d %b %Y %X GMT", gmtime(&t));
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x50,%esi
lea    0xe95(%rip),%rdx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <gmtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%a, %d %b %Y %X GMT\00"
define void @getTime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @gmtime(i32* %3)
%7 = call i32 @strftime(i8* %5, i32 80, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%a, %d %b %Y %X GMT\00"
define void @getTime(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call i32 @gmtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 80, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
main() {
  enum { None, Indent_on, Indent_off } com;
  struct foobar {
    int ch;
    char f;
  } xyz;
}


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

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

LLVM IR (-O0):
%struct.foobar = type { i32, i8 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.foobar
ret i32 0
}

LLVM IR (-O2):
%struct.foobar = type { i32, i8 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_w32(int);
void emit_fmstat(void) {
  assem_debug("fmstat");
  output_w32(0xeef1fa10);
}


x86 assembly (clang, -O0):
<emit_fmstat>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeef1fa10,%edi
call   1040 <output_w32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fmstat>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeef1fa10,%edi
pop    %rax
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"fmstat\00"
define void @emit_fmstat() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_w32(i32 -286131696)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"fmstat\00"
define void @emit_fmstat() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_w32(i32 -286131696)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int /*<<< orphan*/ aesni_encrypt(void *, void *, int /*<<< orphan*/ *);
void do_aes(AES_KEY *k, void *in, void *out) { aesni_encrypt(in, out, k); }


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

x86 assembly (clang, -O2):
<do_aes>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <aesni_encrypt@plt>

LLVM IR (-O0):
define void @do_aes(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = load i32*, i32** %4
%10 = call i32 @aesni_encrypt(i8* %7, i8* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @do_aes(i32* %0, i8* %1, i8* %2) {
%4 = tail call i32 @aesni_encrypt(i8* %1, i8* %2, i32* %0)
ret void
}
/* Variables and functions */
int pop();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void code_if_end() {
  char label[256];
  int index = pop();
  sprintf(label, ".L%d", index);
  printf("%s:\n", label);
}


x86 assembly (clang, -O0):
<code_if_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,-0x104(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x104(%rbp),%edx
lea    0xea4(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_if_end>:
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1040 <pop@plt>
lea    0xeba(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c".L%d\00"
@.str.1 = [5 x i8] c"%s:\0A\00"
define void @code_if_end() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @pop()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
int ffi_test_52(int x, float y, int z) { return (int)(x + y + z + 1); }


x86 assembly (clang, -O0):
<ffi_test_52>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xed6(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffi_test_52>:
cvtsi2ss %edi,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
addss  %xmm1,%xmm0
addss  0xee5(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @ffi_test_52(i32 %0, float %1, i32 %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
store i32 %0, i32* %4
store float %1, float* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load float, float* %5
%10 = fadd float %8, %9
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to float
%13 = fadd float %10, %12
%14 = fadd float %13, 1.000000e+00
%15 = fptosi float %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @ffi_test_52(i32 %0, float %1, i32 %2) {
%4 = sitofp i32 %0 to float
%5 = fadd float %4, %1
%6 = sitofp i32 %2 to float
%7 = fadd float %5, %6
%8 = fadd float %7, 1.000000e+00
%9 = fptosi float %8 to i32
ret i32 %9
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
struct termios serial_set_raw(int tty) {
  struct termios ret;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @serial_set_raw(i32 %0) {
ret i32 undef
}
void av_fifo_space() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_space() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, size_t);
void uninitvar_getcwd(void) {
  char *buf;
  size_t size;
  (void)getcwd(buf, size);
}


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

x86 assembly (clang, -O2):
<uninitvar_getcwd>:
jmp    1030 <getcwd@plt>

LLVM IR (-O0):
define void @uninitvar_getcwd() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i8*, i8** %1
%4 = load i64, i64* %2
%5 = call i32 @getcwd(i8* %3, i64 %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_getcwd() {
%1 = tail call i32 @getcwd(i8* undef, i64 undef)
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ setenv(char *, char *, int);
void changeDirectory(void) {
  setenv("OLDPWD", getenv("PWD"), 1);
  printf("Current directory: %s\n", getenv("PWD"));
}


x86 assembly (clang, -O0):
<changeDirectory>:
push   %rbp
mov    %rsp,%rbp
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeb6(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xea8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeDirectory>:
push   %rbx
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
call   1030 <getenv@plt>
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %rbx,%rdi
call   1030 <getenv@plt>
lea    0xea4(%rip),%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"OLDPWD\00"
@.str.1 = [4 x i8] c"PWD\00"
@.str.2 = [23 x i8] c"Current directory: %s\0A\00"
define void @changeDirectory() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @setenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 1)
%3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"OLDPWD\00"
@.str.1 = [4 x i8] c"PWD\00"
@.str.2 = [23 x i8] c"Current directory: %s\0A\00"
define void @changeDirectory() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @setenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 1)
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void setargv_version() {
  puts("@"
       "(#)"
       "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/setargv.c"
       " "
       "Sat Jan 22 08:19:10 2022"
       " compiled: "
       "Mar 15 2022"
       " "
       "22:53:26");
}


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

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

LLVM IR (-O0):
@.str = [196 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/setargv.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:53:26\00"
define void @setargv_version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [196 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/setargv.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:53:26\00"
define void @setargv_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  int x = 0;
  return (x = 1) + (x = 2);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("java GameMain");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"java GameMain\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(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"java GameMain\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int check_password(const char *user, const char *password) {
  return (user[0] && password[0]);
}


x86 assembly (clang, -O0):
<check_password>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1131 <check_password+0x31>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_password>:
cmpb   $0x0,(%rdi)
je     110e <check_password+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rsi)
setne  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @check_password(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @check_password(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp ne i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
void mdp4_lcdc_free_base_pipe(struct msm_fb_data_type *mfd) {}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_lcdc_free_base_pipe(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a(void) { printf("hlll\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"hlll\0A\00"
define void @a() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"hlll\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_exit(int /*<<< orphan*/);
int /*<<< orphan*/ configure2();
main() {
  configure2();
  __builtin_exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @configure2()
%2 = tail call i32 @__builtin_exit(i32 0)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool QEIErrorGet(uint32_t ui32Base) {
  ;
  return (((*((volatile uint32_t *)(ui32Base + 0x00000004))) & 0x00000001)
              ? true
              : false);
}


x86 assembly (clang, -O0):
<QEIErrorGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%edx
and    $0x1,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIErrorGet>:
movslq %edi,%rax
mov    0x4(%rax),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @QEIErrorGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @QEIErrorGet(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}
void *genlist_default_copy_data_func(const void *data) { return (void *)data; }


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

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

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

LLVM IR (-O2):
define i8* @genlist_default_copy_data_func(i8* readnone returned %0) {
ret i8* %0
}
OP(fd, ff) {
  illegal_1();
  op_ff();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ff@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_ff@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_ff()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ff()
ret i32 undef
}
void redraw(void) {}


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

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

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

LLVM IR (-O2):
define void @redraw() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ resetHardA7GSMModule();
void startRecoveryForA7SendDataFailed(int n) { resetHardA7GSMModule(); }


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

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

LLVM IR (-O0):
define void @startRecoveryForA7SendDataFailed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @resetHardA7GSMModule()
ret void
}

LLVM IR (-O2):
define void @startRecoveryForA7SendDataFailed(i32 %0) {
%2 = tail call i32 (...) @resetHardA7GSMModule()
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void aeGetTime(long *seconds, long *milliseconds) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  *seconds = tv.tv_sec;
  *milliseconds = tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<aeGetTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeGetTime>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
mov    %rax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define void @aeGetTime(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca %struct.timeval
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @aeGetTime(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
store i64 %11, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPSSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GPSSettingsRequestUpdate() { UAVObjRequestUpdate(GPSSettingsHandle()); }


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

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

LLVM IR (-O0):
define void @GPSSettingsRequestUpdate() {
%1 = call i32 (...) @GPSSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSSettingsRequestUpdate() {
%1 = tail call i32 (...) @GPSSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
unsigned long long _bzhi_u64(unsigned long long, int);
unsigned long long f26(unsigned long long x) { return _bzhi_u64(x, 63); }


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

x86 assembly (clang, -O2):
<f26>:
mov    $0x3f,%esi
jmp    1030 <_bzhi_u64@plt>

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

LLVM IR (-O2):
define i64 @f26(i64 %0) {
%2 = tail call i64 @_bzhi_u64(i64 %0, i32 63)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ set(int);
int /*<<< orphan*/ wait_for(int);
void *thread_func(void *x) {
  set(1);
  wait_for(2);
  return x;
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <set@plt>
mov    $0x2,%edi
call   1030 <wait_for@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <set@plt>
mov    $0x2,%edi
call   1030 <wait_for@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @set(i32 1)
%4 = call i32 @wait_for(i32 2)
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @thread_func(i8* readnone returned %0) {
%2 = tail call i32 @set(i32 1)
%3 = tail call i32 @wait_for(i32 2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int main(void) {
  int i;
  for (i = 0; i < 10; i++) {
    malloc(10 * 1024 * 1024);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
mov    $0xa00000,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @malloc(i32 10485760)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc(i32 10485760)
%2 = tail call i32 @malloc(i32 10485760)
%3 = tail call i32 @malloc(i32 10485760)
%4 = tail call i32 @malloc(i32 10485760)
%5 = tail call i32 @malloc(i32 10485760)
%6 = tail call i32 @malloc(i32 10485760)
%7 = tail call i32 @malloc(i32 10485760)
%8 = tail call i32 @malloc(i32 10485760)
%9 = tail call i32 @malloc(i32 10485760)
%10 = tail call i32 @malloc(i32 10485760)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_write_dobldobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(551, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_dobldobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x227,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_dobldobl_Laurent_system>:
mov    $0x227,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_write_dobldobl_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 551, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_write_dobldobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 551, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
void wear_stone_gun(struct battle_char *bc) { add_status(bc, 9); }


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

x86 assembly (clang, -O2):
<wear_stone_gun>:
mov    $0x9,%esi
jmp    1030 <add_status@plt>

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

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @wear_stone_gun(%struct.battle_char* %0) {
%2 = tail call i32 @add_status(%struct.battle_char* %0, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  double a[1047685];
  a[0] = 1.0;
  printf("Here\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7fe430,%rsp
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x7fe430(%rbp)
ff
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7fe430,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Here\0A\00"
define i32 @main() {
%1 = alloca [1047685 x double]
%2 = getelementptr inbounds [1047685 x double], [1047685 x double]* %1, i64 0, i64 0
store double 1.000000e+00, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"Here\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ USBDEVFS_SETCONFIGURATION;
int doioctl(int /*<<< orphan*/, int *, char *);
int set_config(int iCfg) {
  return doioctl(USBDEVFS_SETCONFIGURATION, &iCfg, "set_config");
}


x86 assembly (clang, -O0):
<set_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <doioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_config>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rdx
lea    0x4(%rsp),%rsi
call   1030 <doioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@USBDEVFS_SETCONFIGURATION = global i32 0
@.str = [11 x i8] c"set_config\00"
define i32 @set_config(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @USBDEVFS_SETCONFIGURATION
%4 = call i32 @doioctl(i32 %3, i32* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@USBDEVFS_SETCONFIGURATION = global i32 0
@.str = [11 x i8] c"set_config\00"
define i32 @set_config(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @USBDEVFS_SETCONFIGURATION
%4 = call i32 @doioctl(i32 %3, i32* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_legacy_options(int /*<<< orphan*/ (*)(int));
int /*<<< orphan*/ remember_arg_option(int);
void check_arg_option(int i) {
  if (i >= 0) {
    remember_arg_option(i);
    check_legacy_options(remember_arg_option);
  }
}


x86 assembly (clang, -O0):
<check_arg_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1139 <check_arg_option+0x29>
mov    -0x4(%rbp),%edi
call   1040 <remember_arg_option@plt>
mov    0x2eac(%rip),%rdi
call   1030 <check_legacy_options@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_arg_option>:
test   %edi,%edi
js     1127 <check_arg_option+0x17>
push   %rax
call   1040 <remember_arg_option@plt>
mov    0x2ebf(%rip),%rdi
pop    %rax
jmp    1030 <check_legacy_options@plt>
ret

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

LLVM IR (-O2):
define void @check_arg_option(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @remember_arg_option(i32 %0)
%5 = tail call i32 @check_legacy_options(i32 (i32)* @remember_arg_option)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_newslibdir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_newslibdir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_newslibdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_newslibdir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *e) {
  printf("Usage %s [-s <System.map>] -b <vmlinux> -c <certfile>\n", e);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Usage %s [-s <System.map>] -b <vmlinux> -c <certfile>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Usage %s [-s <System.map>] -b <vmlinux> -c <certfile>\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int parse_int_file(int /*<<< orphan*/, char *, int);
int get_cpufreq_base_freq(int cpu) {
  return parse_int_file(
      0, "/sys/devices/system/cpu/cpu%d/cpufreq/base_frequency", cpu);
}


x86 assembly (clang, -O0):
<get_cpufreq_base_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %edi,%edi
lea    0xed9(%rip),%rsi
call   1030 <parse_int_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpufreq_base_freq>:
mov    %edi,%edx
lea    0xee7(%rip),%rsi
xor    %edi,%edi
jmp    1030 <parse_int_file@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"/sys/devices/system/cpu/cpu%d/cpufreq/base_frequency\00"
define i32 @get_cpufreq_base_freq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @parse_int_file(i32 0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [53 x i8] c"/sys/devices/system/cpu/cpu%d/cpufreq/base_frequency\00"
define i32 @get_cpufreq_base_freq(i32 %0) {
%2 = tail call i32 @parse_int_file(i32 0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t __le_u64(const void *p) { return *((uint64_t *)(p)); }


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

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

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

LLVM IR (-O2):
define i32 @__le_u64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct _cffi_parse_info_s {
  int dummy;
};

/* Variables and functions */
int parse_c_type_from(struct _cffi_parse_info_s *, size_t *, char const *);
int parse_c_type(struct _cffi_parse_info_s *info, const char *input) {
  size_t output_index = 0;
  return parse_c_type_from(info, &output_index, input);
}


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

x86 assembly (clang, -O2):
<parse_c_type>:
push   %rax
mov    %rsi,%rdx
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <parse_c_type_from@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct._cffi_parse_info_s = type { i32 }
define i32 @parse_c_type(%struct._cffi_parse_info_s* %0, i8* %1) {
%3 = alloca %struct._cffi_parse_info_s*
%4 = alloca i8*
%5 = alloca i64
store %struct._cffi_parse_info_s* %0, %struct._cffi_parse_info_s** %3
store i8* %1, i8** %4
store i64 0, i64* %5
%6 = load %struct._cffi_parse_info_s*, %struct._cffi_parse_info_s** %3
%7 = load i8*, i8** %4
%8 = call i32 @parse_c_type_from(%struct._cffi_parse_info_s* %6, i64* %5, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct._cffi_parse_info_s = type { i32 }
define i32 @parse_c_type(%struct._cffi_parse_info_s* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 @parse_c_type_from(%struct._cffi_parse_info_s* %0, i64* %3, i8* %1)
ret i32 %5
}
void v_intrev(int *vec, int n) {
  int t;
  while (--n > 0) {
    t = vec[n];
    vec[n--] = vec[0];
    *vec++ = t;
  }
}


x86 assembly (clang, -O0):
<v_intrev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    115f <v_intrev+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%esi
add    $0xffffffff,%esi
mov    %esi,-0xc(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    110b <v_intrev+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_intrev>:
cmp    $0x2,%esi
jl     1128 <v_intrev+0x28>
lea    -0x1(%rsi),%eax
lea    (%rdi,%rax,4),%rax
add    $0x2,%esi
nop
mov    (%rax),%ecx
mov    (%rdi),%edx
mov    %edx,(%rax)
mov    %ecx,(%rdi)
add    $0x4,%rdi
add    $0xfffffffffffffffc,%rax
add    $0xfffffffe,%esi
cmp    $0x3,%esi
ja     1110 <v_intrev+0x10>
ret

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

LLVM IR (-O2):
define void @v_intrev(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i32* [ %13, %4 ], [ %0, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %5
%12 = add nsw i32 %6, -2
store i32 %11, i32* %9
%13 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %10, i32* %5
%14 = icmp ugt i32 %6, 3
br i1 %14, label %4, label %15
15: ; preds = %4, %2
ret void
}
void Put_image(unsigned short a, short x, short y) {}


x86 assembly (clang, -O0):
<Put_image>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Put_image(i16 zeroext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
define void @Put_image(i16 zeroext %0, i16 signext %1, i16 signext %2) {
ret void
}
int do_575() { return 575; }


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

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

LLVM IR (-O0):
define i32 @do_575() {
ret i32 575
}

LLVM IR (-O2):
define i32 @do_575() {
ret i32 575
}
void MPURegionDisable(unsigned long ulRegion) {
  ;
  (*((volatile unsigned long *)(0xE000ED98))) = ulRegion;
  (*((volatile unsigned long *)(0xE000EDA0))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<MPURegionDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xe000ed98,%eax
mov    %rcx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0xe000eda0,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionDisable>:
mov    $0xe000eda0,%eax
mov    %rdi,-0x8(%rax)
andq   $0xfffffffffffffffe,(%rax)
ret

LLVM IR (-O0):
define void @MPURegionDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 3758157208 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%5 = and i64 %4, -2
store volatile i64 %5, i64* inttoptr (i64 3758157216 to i64*)
ret void
}

LLVM IR (-O2):
define void @MPURegionDisable(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 3758157208 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%3 = and i64 %2, -2
store volatile i64 %3, i64* inttoptr (i64 3758157216 to i64*)
ret void
}
/* Variables and functions */
int tolower(char);
int getArgsPerElement(char cmd) {
  switch (tolower(cmd)) {
  case 'v':
  case 'h':
    return 1;
  case 'm':
  case 'l':
  case 't':
    return 2;
  case 'q':
  case 's':
    return 4;
  case 'c':
    return 6;
  case 'a':
    return 7;
  }
  return 0;
}


x86 assembly (clang, -O0):
<getArgsPerElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <tolower@plt>
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1189 <getArgsPerElement+0x79>
mov    -0x10(%rbp),%rax
lea    0xebc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1190 <getArgsPerElement+0x80>
movl   $0x2,-0x4(%rbp)
jmp    1190 <getArgsPerElement+0x80>
movl   $0x4,-0x4(%rbp)
jmp    1190 <getArgsPerElement+0x80>
movl   $0x6,-0x4(%rbp)
jmp    1190 <getArgsPerElement+0x80>
movl   $0x7,-0x4(%rbp)
jmp    1190 <getArgsPerElement+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArgsPerElement>:
push   %rax
call   1030 <tolower@plt>
add    $0xffffff9f,%eax
xor    %ecx,%ecx
cmp    $0x15,%eax
ja     112c <getArgsPerElement+0x1c>
cltq
lea    0xed7(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getArgsPerElement(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32 @tolower(i8 signext %4)
switch i32 %5, label %11 [
i32 118, label %6
i32 104, label %6
i32 109, label %7
i32 108, label %7
i32 116, label %7
i32 113, label %8
i32 115, label %8
i32 99, label %9
i32 97, label %10
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %12
7: ; preds = %1, %1, %1
store i32 2, i32* %2
br label %12
8: ; preds = %1, %1
store i32 4, i32* %2
br label %12
9: ; preds = %1
store i32 6, i32* %2
br label %12
10: ; preds = %1
store i32 7, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.getArgsPerElement = [22 x i32] [i32 7, i32 0, i32 6, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 2, i32 2, i32 0, i32 0, i32 0, i32 4, i32 0, i32 4, i32 2, i32 0, i32 1]
define i32 @getArgsPerElement(i8 signext %0) {
%2 = tail call i32 @tolower(i8 signext %0)
%3 = add i32 %2, -97
%4 = icmp ult i32 %3, 22
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [22 x i32], [22 x i32]* @switch.table.getArgsPerElement, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}