xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ draw_paddles();
int /*<<< orphan*/ draw_string(int /*<<< orphan*/, scalar_t__, char *);
scalar_t__ screen_height();
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ wait_char();
int main() {
  setup_screen();
  draw_paddles();
  draw_string(0, screen_height() - 1, "Press any key to finish...");
  wait_char();
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <setup_screen@plt>
mov    $0x0,%al
call   1080 <draw_paddles@plt>
mov    $0x0,%al
call   1040 <screen_height@plt>
mov    %rax,%rsi
sub    $0x1,%rsi
xor    %edi,%edi
lea    0xe6c(%rip),%rdx
call   1070 <draw_string@plt>
mov    $0x0,%al
call   1050 <wait_char@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <setup_screen@plt>
xor    %eax,%eax
call   1080 <draw_paddles@plt>
xor    %eax,%eax
call   1040 <screen_height@plt>
lea    -0x1(%rax),%rsi
lea    0xe7f(%rip),%rdx
xor    %edi,%edi
call   1070 <draw_string@plt>
xor    %eax,%eax
call   1050 <wait_char@plt>
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Press any key to finish...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 (...) @draw_paddles()
%4 = call i64 (...) @screen_height()
%5 = sub nsw i64 %4, 1
%6 = call i32 @draw_string(i32 0, i64 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @wait_char()
%8 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Press any key to finish...\00"
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 (...) @draw_paddles()
%3 = tail call i64 (...) @screen_height()
%4 = add nsw i64 %3, -1
%5 = tail call i32 @draw_string(i32 0, i64 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @wait_char()
%7 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
unsigned long f7(unsigned long x, unsigned long y) { return (x << -(y & 63)); }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
and    $0x3f,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %rsi,%rcx
mov    %rdi,%rax
and    $0x3f,%cl
neg    %cl
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @f7(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = and i64 %6, 63
%8 = sub i64 0, %7
%9 = shl i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @f7(i64 %0, i64 %1) {
%3 = and i64 %1, 63
%4 = sub nsw i64 0, %3
%5 = shl nuw nsw i64 %0, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ put_str(char *);
int /*<<< orphan*/ putchp(int /*<<< orphan*/);
void uprint(const char *s) {
  if (s) {
    while (*s) {
      put_str("_\b");
      putchp(*s++);
    }
  }
}


x86 assembly (clang, -O0):
<uprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1176 <uprint+0x56>
jmp    113c <uprint+0x1c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1171 <uprint+0x51>
lea    0xeb0(%rip),%rdi
call   1040 <put_str@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchp@plt>
jmp    113c <uprint+0x1c>
jmp    1176 <uprint+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uprint>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <uprint+0x3a>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     115a <uprint+0x3a>
add    $0x1,%rbx
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <put_str@plt>
movsbl -0x1(%rbx),%edi
call   1030 <putchp@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <uprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"_\08\00"
define void @uprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %18
5: ; preds = %1
br label %6
6: ; preds = %10, %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = call i32 @put_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = call i32 @putchp(i32 %15)
br label %6
17: ; preds = %6
br label %18
18: ; preds = %17, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"_\08\00"
define void @uprint(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %0, %3 ]
%8 = tail call i32 @put_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = tail call i32 @putchp(i32 %11)
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HF_strstr(char const *, char const *, uintptr_t);
void __sanitizer_weak_hook_strstr(uintptr_t pc, const char *haystack,
                                  const char *needle,
                                  char *result __attribute__((unused))) {
  HF_strstr(haystack, needle, pc);
}


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

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

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

LLVM IR (-O2):
define void @__sanitizer_weak_hook_strstr(i64 %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @HF_strstr(i8* %1, i8* %2, i64 %0)
ret void
}
void ff_hevc_put_hevc_epel_h12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h12_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) { printf("This is the SIGUSR1 signal handler!\n"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"This is the SIGUSR1 signal handler!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"This is the SIGUSR1 signal handler!\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, double);
int /*<<< orphan*/ stderr;
void tprint(char *prefix, long start, long stop) {
  double usecs = (double)(stop - start);
  double secs = usecs / (double)1000000.0;
  fprintf(stderr, "%s%.4lf seconds\n", prefix, secs);
}


x86 assembly (clang, -O0):
<tprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
movsd  -0x28(%rbp),%xmm0
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tprint>:
sub    %rsi,%rdx
cvtsi2sd %rdx,%xmm0
divsd  0xee0(%rip),%xmm0
mov    %rdi,%rdx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s%.4lf seconds\0A\00"
define void @tprint(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = sub nsw i64 %9, %10
%12 = sitofp i64 %11 to double
store double %12, double* %7
%13 = load double, double* %7
%14 = fdiv double %13, 1.000000e+06
store double %14, double* %8
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %4
%17 = load double, double* %8
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %16, double %17)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s%.4lf seconds\0A\00"
define void @tprint(i8* %0, i64 %1, i64 %2) {
%4 = sub nsw i64 %2, %1
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 1.000000e+06
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ baz();
int /*<<< orphan*/ qux();
int main() {
  qux();
  bar();
  baz();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <qux@plt>
mov    $0x0,%al
call   1040 <bar@plt>
mov    $0x0,%al
call   1030 <baz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @qux()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @baz()
ret i32 0
}
/* Variables and functions */
scalar_t__ strtoul(unsigned char const *, unsigned char **, int);
long strtol(const unsigned char *__p, unsigned char **__ep, int b) {
  return (long)strtoul(__p, __ep, b);
}


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

x86 assembly (clang, -O2):
<strtol>:
jmp    1030 <strtoul@plt>

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

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
void *gnu_indirect_function() { return 0l; }


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

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

LLVM IR (-O0):
define i8* @gnu_indirect_function() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @gnu_indirect_function() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void or_eax_imm32(unsigned int imm32) {
  put8(0x0D);
  put32(imm32);
}


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

x86 assembly (clang, -O2):
<or_eax_imm32>:
push   %rbx
mov    %edi,%ebx
mov    $0xd,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @or_eax_imm32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 13)
%4 = load i32, i32* %2
%5 = call i32 @put32(i32 %4)
ret void
}

LLVM IR (-O2):
define void @or_eax_imm32(i32 %0) {
%2 = tail call i32 @put8(i32 13)
%3 = tail call i32 @put32(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("Running ps with system\n");
  system("ps -eaf");
  printf("Done.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <system@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Running ps with system\0A\00"
@.str.1 = [8 x i8] c"ps -eaf\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"ps -eaf\00"
@str = [23 x i8] c"Running ps with system\00"
@str.3 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ getinstruction(int *);
void *fetchvoid(void *void_pc) {
  return (void *)getinstruction((int *)void_pc);
}


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

x86 assembly (clang, -O2):
<fetchvoid>:
jmp    1030 <getinstruction@plt>

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

LLVM IR (-O2):
define i8* @fetchvoid(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @getinstruction(i32* %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
unsigned f_int_2(unsigned x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f_int_2(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int RTLD_GLOBAL;
int RTLD_NOW;
void *dlopen(char *, int);
void *dlsym(void *, char *);
int /*<<< orphan*/ printf(char *, void *);
int main(void) {
  void *handle = dlopen("003-f.so", RTLD_NOW | RTLD_GLOBAL);
  void *sym = dlsym(handle, "x");
  printf("%p\n", sym);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    0x2e99(%rip),%rax
or     (%rax),%esi
lea    0xea8(%rip),%rdi
call   1040 <dlopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <dlsym@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1040 <dlopen@plt>
lea    0xeb3(%rip),%rsi
mov    %rax,%rdi
call   1050 <dlsym@plt>
lea    0xea6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"003-f.so\00"
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
@.str.1 = [2 x i8] c"x\00"
@.str.2 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = load i32, i32* @RTLD_NOW
%5 = load i32, i32* @RTLD_GLOBAL
%6 = or i32 %4, %5
%7 = call i8* @dlopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i8* @dlsym(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"003-f.so\00"
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
@.str.1 = [2 x i8] c"x\00"
@.str.2 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = load i32, i32* @RTLD_NOW
%2 = load i32, i32* @RTLD_GLOBAL
%3 = or i32 %2, %1
%4 = tail call i8* @dlopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i8* @dlsym(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int PAPI_start(int);
void papif_start_(int *EventSet, int *check) { *check = PAPI_start(*EventSet); }


x86 assembly (clang, -O0):
<papif_start_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_start@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_start_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_start@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_start_(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_start(i32 %3)
store i32 %4, i32* %1
ret void
}
int cable_get_connect_type(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cable_get_connect_type() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1_enum();
int /*<<< orphan*/ f2_enum();
int /*<<< orphan*/ f3_enum();
void main() {
  f1_enum();
  f2_enum();
  f3_enum();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <f1_enum@plt>
mov    $0x0,%al
call   1050 <f2_enum@plt>
mov    $0x0,%al
call   1030 <f3_enum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f1_enum@plt>
xor    %eax,%eax
call   1050 <f2_enum@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <f3_enum@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @f1_enum()
%2 = call i32 (...) @f2_enum()
%3 = call i32 (...) @f3_enum()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @f1_enum()
%2 = tail call i32 (...) @f2_enum()
%3 = tail call i32 (...) @f3_enum()
ret void
}
int nid_cmp(const int *a, const int *b) { return *a - *b; }


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

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

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

LLVM IR (-O2):
define i32 @nid_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
void glBufferData(unsigned int target, int size, const void *data,
                  unsigned int usage) {}


x86 assembly (clang, -O0):
<glBufferData>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @glBufferData(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_port();
int main(void) { read_port(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read_port()
ret i32 0
}
/* Type definitions */
struct Context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Context *);
void context_free(struct Context *ctx) { free(ctx); }


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

x86 assembly (clang, -O2):
<context_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.Context = type { i32 }
define void @context_free(%struct.Context* nocapture %0) {
%2 = tail call i32 @free(%struct.Context* %0)
ret void
}
void omap_vrfb_release_ctx(struct vrfb *vrfb) {}


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

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

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

LLVM IR (-O2):
%struct.vrfb = type opaque
define void @omap_vrfb_release_ctx(%struct.vrfb* nocapture %0) {
ret void
}
int strlen1(char *string) {
  int tamanho = 0;
  while (*string) {
    *string++;
    tamanho++;
  }
  return tamanho;
}


x86 assembly (clang, -O0):
<strlen1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlen1+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen1+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen1>:
cmpb   $0x0,(%rdi)
je     111c <strlen1+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen1+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlLDODeepSleepGet(void) {
  return ((*((volatile unsigned long *)(0x400FE1BC))));
}


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

x86 assembly (clang, -O2):
<SysCtlLDODeepSleepGet>:
mov    0x400fe1bc,%rax
40
ret

LLVM IR (-O0):
define i64 @SysCtlLDODeepSleepGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782652 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @SysCtlLDODeepSleepGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782652 to i64*)
ret i64 %1
}
int getgdesc_(m)
int *m;
{ return ((int)getgdesc((long)*m)); }


x86 assembly (clang, -O0):
<getgdesc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    $0x0,%al
call   1030 <getgdesc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgdesc_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <getgdesc@plt>

LLVM IR (-O0):
define i32 @getgdesc_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = call i32 (i64, ...) bitcast (i32 (...)* @getgdesc to i32 (i64, ...)*)(i64 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @getgdesc_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @getgdesc to i32 (i64, ...)*)(i64 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Direct(int);
int /*<<< orphan*/ LSR8(int /*<<< orphan*/);
void Op46M1(void) { LSR8(Direct(3)); }


x86 assembly (clang, -O0):
<Op46M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
call   1040 <LSR8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op46M1>:
push   %rax
mov    $0x3,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <LSR8@plt>

LLVM IR (-O0):
define void @Op46M1() {
%1 = call i32 @Direct(i32 3)
%2 = call i32 @LSR8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op46M1() {
%1 = tail call i32 @Direct(i32 3)
%2 = tail call i32 @LSR8(i32 %1)
ret void
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int erase_block_82802ab(struct flashrom_flashctx *, unsigned int, unsigned int);
int stm50_erase_sector(struct flashrom_flashctx *, unsigned int);
int erase_sector_stm50(struct flashrom_flashctx *flash, unsigned int addr,
                       unsigned int len) {
  if (len == 4096)
    return stm50_erase_sector(flash, addr);
  else
    return erase_block_82802ab(flash, addr, len);
}


x86 assembly (clang, -O0):
<erase_sector_stm50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x1000,-0x18(%rbp)
jne    1153 <erase_sector_stm50+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <stm50_erase_sector@plt>
mov    %eax,-0x4(%rbp)
jmp    1165 <erase_sector_stm50+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <erase_block_82802ab@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_sector_stm50>:
cmp    $0x1000,%edx
jne    112d <erase_sector_stm50+0xd>
jmp    1040 <stm50_erase_sector@plt>
jmp    1030 <erase_block_82802ab@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @erase_sector_stm50(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.flashrom_flashctx*
%6 = alloca i32
%7 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 4096
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %5
%12 = load i32, i32* %6
%13 = call i32 @stm50_erase_sector(%struct.flashrom_flashctx* %11, i32 %12)
store i32 %13, i32* %4
br label %19
14: ; preds = %3
%15 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @erase_block_82802ab(%struct.flashrom_flashctx* %15, i32 %16, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %10
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @erase_sector_stm50(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 4096
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @stm50_erase_sector(%struct.flashrom_flashctx* %0, i32 %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @erase_block_82802ab(%struct.flashrom_flashctx* %0, i32 %1, i32 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ shape();
void hzrg(void) { shape(); }


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

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

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

LLVM IR (-O2):
define void @hzrg() {
%1 = tail call i32 (...) @shape()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(int, unsigned char);
void print_spew_hex8(unsigned char value) { __console_tx_hex8(8, value); }


x86 assembly (clang, -O0):
<print_spew_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x8,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spew_hex8>:
mov    %edi,%esi
mov    $0x8,%edi
jmp    1030 <__console_tx_hex8@plt>

LLVM IR (-O0):
define void @print_spew_hex8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @__console_tx_hex8(i32 8, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_spew_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i32 8, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, unsigned char *, int);
int I4(unsigned char *p) {
  int i;
  memcpy(&i, p, 4);
  return i;
}


x86 assembly (clang, -O0):
<I4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I4>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @I4(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ crypt(char *, char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
int main(int argc, const char *argv[]) {
  char key[8];
  char salt[2];
  read(0, key, 8);
  read(0, salt, 2);
  write(1, crypt(key, salt), 13);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rsi
xor    %edi,%edi
mov    $0x8,%edx
call   1050 <read@plt>
lea    -0x1a(%rbp),%rsi
xor    %edi,%edi
mov    $0x2,%edx
call   1050 <read@plt>
lea    -0x18(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
call   1040 <crypt@plt>
mov    %eax,%esi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0x10(%rsp),%r14
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x8,%edx
call   1050 <read@plt>
lea    0xe(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1050 <read@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <crypt@plt>
mov    $0x1,%edi
mov    %eax,%esi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
%7 = alloca [2 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%9 = call i32 @read(i32 0, i8* %8, i32 8)
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%11 = call i32 @read(i32 0, i8* %10, i32 2)
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%14 = call i32 @crypt(i8* %12, i8* %13)
%15 = call i32 @write(i32 1, i32 %14, i32 13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i8]
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%7 = call i32 @read(i32 0, i8* %5, i32 8)
%8 = call i32 @read(i32 0, i8* %6, i32 2)
%9 = call i32 @crypt(i8* %5, i8* %6)
%10 = call i32 @write(i32 1, i32 %9, i32 13)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_lock(pthread_mutex_t *p) { free(p); }


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

x86 assembly (clang, -O2):
<free_lock>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_lock(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int LZ4_compress_fast_extState(void *, char const *, char *, int, int, int);
int LZ4_compress_limitedOutput_withState(void *state, const char *src,
                                         char *dst, int srcSize, int dstSize) {
  return LZ4_compress_fast_extState(state, src, dst, srcSize, dstSize, 1);
}


x86 assembly (clang, -O0):
<LZ4_compress_limitedOutput_withState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <LZ4_compress_fast_extState@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress_limitedOutput_withState>:
mov    $0x1,%r9d
jmp    1030 <LZ4_compress_fast_extState@plt>

LLVM IR (-O0):
define i32 @LZ4_compress_limitedOutput_withState(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @LZ4_compress_fast_extState(i8* %11, i8* %12, i8* %13, i32 %14, i32 %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
define i32 @LZ4_compress_limitedOutput_withState(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @LZ4_compress_fast_extState(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 1)
ret i32 %6
}
void set_input_file(char *fname, unsigned int flength) {}


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

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

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

LLVM IR (-O2):
define void @set_input_file(i8* nocapture %0, i32 %1) {
ret void
}
vuser_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vuser_init() {
ret i32 0
}
unsigned char ReadEeprom(unsigned char radd) {
  unsigned char rm1;
  unsigned char *prom;
  prom = (unsigned char *)(0x4001 + radd);
  rm1 = *prom;
  return rm1;
}


x86 assembly (clang, -O0):
<ReadEeprom>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x4001,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadEeprom>:
mov    %edi,%eax
mov    0x4001(%rax),%al
ret

LLVM IR (-O0):
define zeroext i8 @ReadEeprom(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = add nsw i32 16385, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
store i8 %11, i8* %3
%12 = load i8, i8* %3
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @ReadEeprom(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = add nuw nsw i64 %2, 16385
%4 = inttoptr i64 %3 to i8*
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
int MemoryField_StringCompare(const char *s1, const char *s2) {
  if (s1 && s2) {
    return strcmp(s1, s2);
  }
  return (long)s1 - (long)s2;
}


x86 assembly (clang, -O0):
<MemoryField_StringCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <MemoryField_StringCompare+0x3b>
cmpq   $0x0,-0x18(%rbp)
je     114b <MemoryField_StringCompare+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1159 <MemoryField_StringCompare+0x49>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemoryField_StringCompare>:
test   %rdi,%rdi
je     111f <MemoryField_StringCompare+0xf>
test   %rsi,%rsi
je     111f <MemoryField_StringCompare+0xf>
jmp    1030 <strcmp@plt>
sub    %esi,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @MemoryField_StringCompare(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %13
8: ; preds = %2
%9 = ptrtoint i8* %0 to i64
%10 = ptrtoint i8* %1 to i64
%11 = sub nsw i64 %9, %10
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %8, %6
%14 = phi i32 [ %7, %6 ], [ %12, %8 ]
ret i32 %14
}
void avpicture_free() {}


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

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

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

LLVM IR (-O2):
define void @avpicture_free() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32_to_cpu(int /*<<< orphan*/ const);
uint32_t be32_to_cpup(const uint32_t *p) { return be32_to_cpu(*p); }


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

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

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

LLVM IR (-O2):
define i32 @be32_to_cpup(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @be32_to_cpu(i32 %2)
ret i32 %3
}
int base32_encode_length(int rawLength) {
  return ((rawLength * 8) / 5) + ((rawLength % 5) != 0) + 1;
}


x86 assembly (clang, -O0):
<base32_encode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base32_encode_length>:
lea    0x0(,%rdi,8),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
imul   $0xcccccccd,%edi,%ecx
add    $0x19999999,%ecx
cmp    $0x33333333,%ecx
sbb    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @base32_encode_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
%5 = sdiv i32 %4, 5
%6 = load i32, i32* %2
%7 = srem i32 %6, 5
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = add nsw i32 %5, %9
%11 = add nsw i32 %10, 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @base32_encode_length(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = sdiv i32 %2, 5
%4 = srem i32 %0, 5
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, 1
%8 = add nsw i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int do_chirp_acl_check(char const *, char const *, int, int /*<<< orphan*/);
int chirp_acl_check_link(const char *filename, const char *subject, int flags) {
  return do_chirp_acl_check(filename, subject, flags, 0);
}


x86 assembly (clang, -O0):
<chirp_acl_check_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <do_chirp_acl_check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_acl_check_link>:
xor    %ecx,%ecx
jmp    1030 <do_chirp_acl_check@plt>

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

LLVM IR (-O2):
define i32 @chirp_acl_check_link(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @do_chirp_acl_check(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct EmuSurface {
  int dummy;
};
struct EmuGlobal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lemu_core_video_callback(struct EmuGlobal *,
                                            struct EmuSurface *);
void lemu_video_callback(struct EmuGlobal *G, struct EmuSurface *S) {
  lemu_core_video_callback(G, S);
}


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

x86 assembly (clang, -O2):
<lemu_video_callback>:
jmp    1030 <lemu_core_video_callback@plt>

LLVM IR (-O0):
%struct.EmuGlobal = type { i32 }
%struct.EmuSurface = type { i32 }
define void @lemu_video_callback(%struct.EmuGlobal* %0, %struct.EmuSurface* %1) {
%3 = alloca %struct.EmuGlobal*
%4 = alloca %struct.EmuSurface*
store %struct.EmuGlobal* %0, %struct.EmuGlobal** %3
store %struct.EmuSurface* %1, %struct.EmuSurface** %4
%5 = load %struct.EmuGlobal*, %struct.EmuGlobal** %3
%6 = load %struct.EmuSurface*, %struct.EmuSurface** %4
%7 = call i32 @lemu_core_video_callback(%struct.EmuGlobal* %5, %struct.EmuSurface* %6)
ret void
}

LLVM IR (-O2):
%struct.EmuGlobal = type { i32 }
%struct.EmuSurface = type { i32 }
define void @lemu_video_callback(%struct.EmuGlobal* %0, %struct.EmuSurface* %1) {
%3 = tail call i32 @lemu_core_video_callback(%struct.EmuGlobal* %0, %struct.EmuSurface* %1)
ret void
}
int test3(int x) { return x / 10 != 2; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
add    $0xffffffe2,%edi
xor    %eax,%eax
cmp    $0xfffffff6,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp ne i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test3(i32 %0) {
%2 = add i32 %0, -30
%3 = icmp ult i32 %2, -10
%4 = zext i1 %3 to i32
ret i32 %4
}
void ff_hevc_put_hevc_bi_w_pel_pixels8_8_sse4() {}


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

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

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

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