xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ perf_config_bool_or_int(char const *, char const *, int *);
int perf_config_bool(const char *name, const char *value) {
  int discard;
  return !!perf_config_bool_or_int(name, value, &discard);
}


x86 assembly (clang, -O0):
<perf_config_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <perf_config_bool_or_int@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_config_bool>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <perf_config_bool_or_int@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @perf_config_bool(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @perf_config_bool_or_int(i8* %6, i8* %7, i32* %5)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @perf_config_bool(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @perf_config_bool_or_int(i8* %0, i8* %1, i32* %3)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void do_free(void *ptr) {
  if (ptr != NULL)
    free(ptr);
}


x86 assembly (clang, -O0):
<do_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <do_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_free>:
test   %rdi,%rdi
je     111a <do_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @do_free(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @do_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sumFibUnevenUntil(int);
int main() {
  printf("%lu", sumFibUnevenUntil(4000000));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define i32 @main() {
%1 = tail call i32 @sumFibUnevenUntil(i32 4000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
double f4_sum_int(int v) { return ((double)(v)); }


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

x86 assembly (clang, -O2):
<f4_sum_int>:
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @f4_sum_int(i32 %0) {
%2 = sitofp i32 %0 to double
ret double %2
}
int gfx_set_tv_enable(int enable) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @gfx_set_tv_enable(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_tabs();
int main(void) {
  gen_tabs();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gen_tabs()
ret i32 0
}
/* Variables and functions */
void *_alloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *_allocz(size_t size) {
  void *ptr = _alloc(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<_allocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_allocz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_allocz(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @_alloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @_allocz(i64 %0) {
%2 = tail call i8* @_alloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Mem_free(void *addr) {
  ;
  free(addr);
}


x86 assembly (clang, -O0):
<Mem_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):
<Mem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void omap_control_usb_phy_power(struct device *dev, int on) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @omap_control_usb_phy_power(%struct.device* %0, i32 %1) {
%3 = alloca %struct.device*
%4 = alloca i32
store %struct.device* %0, %struct.device** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @omap_control_usb_phy_power(%struct.device* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof_unlocked(int /*<<< orphan*/ *);
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
int feof(FILE *file) {
  flockfile(file);
  int result = feof_unlocked(file);
  funlockfile(file);
  return result;
}


x86 assembly (clang, -O0):
<feof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x8(%rbp),%rdi
call   1050 <feof_unlocked@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feof>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <flockfile@plt>
mov    %rbx,%rdi
call   1050 <feof_unlocked@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @feof(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @flockfile(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @feof_unlocked(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @funlockfile(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @feof(i32* %0) {
%2 = tail call i32 @flockfile(i32* %0)
%3 = tail call i32 @feof_unlocked(i32* %0)
%4 = tail call i32 @funlockfile(i32* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LibraryCall();
int main(int argc, char **argv) {
  LibraryCall();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @LibraryCall()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Util_runtime_error(char error_text[]) {
  fprintf(stderr,
          "\x1b[31m"
          "Runtime-error: %s\n"
          "\x1b[0m",
          error_text);
  exit(1);
}


x86 assembly (clang, -O0):
<Util_runtime_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Util_runtime_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"\1B[31mRuntime-error: %s\0A\1B[0m\00"
define void @Util_runtime_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"\1B[31mRuntime-error: %s\0A\1B[0m\00"
define void @Util_runtime_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ leftRot(unsigned char *);
void leftRotKeys(unsigned char left[], unsigned char right[]) {
  leftRot(left);
  leftRot(right);
}


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

x86 assembly (clang, -O2):
<leftRotKeys>:
push   %rbx
mov    %rsi,%rbx
call   1030 <leftRot@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <leftRot@plt>

LLVM IR (-O0):
define void @leftRotKeys(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 = call i32 @leftRot(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @leftRot(i8* %7)
ret void
}

LLVM IR (-O2):
define void @leftRotKeys(i8* %0, i8* %1) {
%3 = tail call i32 @leftRot(i8* %0)
%4 = tail call i32 @leftRot(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/);
void thread_yield() { __syscall(12, (0), (0), (0), (0), (0), (0), (0), (0)); }


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

x86 assembly (clang, -O2):
<thread_yield>:
push   %rax
sub    $0x8,%rsp
mov    $0xc,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
call   1030 <__syscall@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @thread_yield() {
%1 = call i32 @__syscall(i32 12, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @thread_yield() {
%1 = tail call i32 @__syscall(i32 12, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t c_func_3_() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @c_func_3_() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x4c() {
  Assert_real((isdigit(76) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              385, ("isdigit should be 0 for L"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for L\00"
define void @t_isdigit_0x4c() {
%1 = tail call i64 @isdigit(i32 76)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cmp(const void *arg1, const void *arg2) {
  return (*(int *)arg2) - (*(int *)arg1);
}


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

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

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int test_imm_A9int8_reg(signed char val) {
  return ((val) & (-0xA9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A9int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff57,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A9int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -169
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void manos_timer_watcher_destroy(void *watcher) { free(watcher); }


x86 assembly (clang, -O0):
<manos_timer_watcher_destroy>:
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):
<manos_timer_watcher_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @manos_timer_watcher_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void ap91_pci_setup_wmac_led_pin(int pin) {}


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

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

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

LLVM IR (-O2):
define void @ap91_pci_setup_wmac_led_pin(i32 %0) {
ret void
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void entryAction(void *stateData, struct event *event) {
  const char *stateName = (const char *)stateData;
  printf("Entering %s\n", stateName);
}


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

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

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

LLVM IR (-O2):
%struct.event = type { i32 }
@.str = [13 x i8] c"Entering %s\0A\00"
define void @entryAction(i8* %0, %struct.event* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int bbm_data(void *, unsigned short, unsigned short, unsigned char *,
             unsigned int);
int bbm_com_data(void *handle, unsigned short devid, unsigned short addr,
                 unsigned char *data, unsigned int size) {
  int res;
  res = bbm_data(handle, devid, addr, data, size);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0xc(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
movzwl %dx,%esi
movzwl %ax,%edx
call   1030 <bbm_data@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_data>:
jmp    1030 <bbm_data@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_data(i8* %0, i16 zeroext %1, i16 zeroext %2, i8* %3, i32 %4) {
%6 = tail call i32 @bbm_data(i8* %0, i16 zeroext %1, i16 zeroext %2, i8* %3, i32 %4)
ret i32 %6
}
unsigned int strlenn(char *str) {
  unsigned int lenght = 0;
  char *tmp;
  tmp = str;
  for (lenght = 0; *tmp != '\0'; tmp++)
    lenght++;
  return lenght;
}


x86 assembly (clang, -O0):
<strlenn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <strlenn+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <strlenn+0x1e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlenn(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 i8* [ %8, %4 ], [ %0, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add i32 %6, 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
size_t strlen(char const *);
size_t xstrlen(const char *string) { return (strlen(string)); }


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

x86 assembly (clang, -O2):
<xstrlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @xstrlen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
int benchmarkIterationsCount() { return 10; }


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

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

LLVM IR (-O0):
define i32 @benchmarkIterationsCount() {
ret i32 10
}

LLVM IR (-O2):
define i32 @benchmarkIterationsCount() {
ret i32 10
}
/* Type definitions */
struct qnode {
  int dummy;
};

/* Variables and functions */
int is_empty(struct qnode **front_ref) { return (*front_ref == NULL) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
%struct.qnode = type { i32 }
define i32 @is_empty(%struct.qnode** nocapture %0) {
%2 = load %struct.qnode*, %struct.qnode** %0
%3 = icmp eq %struct.qnode* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void f2(void) {
#pragma omp ordered simd
  ;
}


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

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

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

LLVM IR (-O2):
define void @f2() {
ret void
}
struct Cyc_AP_T *Cyc_mulmod(struct Cyc_AP_T *x, struct Cyc_AP_T *y,
                            struct Cyc_AP_T *p) {
  struct Cyc_AP_T *z;
  struct Cyc_AP_T *xy = ({ Cyc_AP_mul(x, y); });
  z = ({ Cyc_AP_mod(xy, p); });
  return z;
}


x86 assembly (clang, -O0):
<Cyc_mulmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <Cyc_AP_mul@plt>
mov    %eax,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <Cyc_AP_mod@plt>
mov    %eax,-0x30(%rbp)
movslq -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_mulmod>:
push   %rbx
mov    %rdx,%rbx
xor    %eax,%eax
call   1030 <Cyc_AP_mul@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <Cyc_AP_mod@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.Cyc_AP_T = type opaque
define %struct.Cyc_AP_T* @Cyc_mulmod(%struct.Cyc_AP_T* %0, %struct.Cyc_AP_T* %1, %struct.Cyc_AP_T* %2) {
%4 = alloca %struct.Cyc_AP_T*
%5 = alloca %struct.Cyc_AP_T*
%6 = alloca %struct.Cyc_AP_T*
%7 = alloca %struct.Cyc_AP_T*
%8 = alloca %struct.Cyc_AP_T*
%9 = alloca i32
%10 = alloca i32
store %struct.Cyc_AP_T* %0, %struct.Cyc_AP_T** %4
store %struct.Cyc_AP_T* %1, %struct.Cyc_AP_T** %5
store %struct.Cyc_AP_T* %2, %struct.Cyc_AP_T** %6
%11 = load %struct.Cyc_AP_T*, %struct.Cyc_AP_T** %4
%12 = load %struct.Cyc_AP_T*, %struct.Cyc_AP_T** %5
%13 = call i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...) bitcast (i32 (...)* @Cyc_AP_mul to i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...)*)(%struct.Cyc_AP_T* %11, %struct.Cyc_AP_T* %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to %struct.Cyc_AP_T*
store %struct.Cyc_AP_T* %16, %struct.Cyc_AP_T** %8
%17 = load %struct.Cyc_AP_T*, %struct.Cyc_AP_T** %8
%18 = load %struct.Cyc_AP_T*, %struct.Cyc_AP_T** %6
%19 = call i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...) bitcast (i32 (...)* @Cyc_AP_mod to i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...)*)(%struct.Cyc_AP_T* %17, %struct.Cyc_AP_T* %18)
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to %struct.Cyc_AP_T*
store %struct.Cyc_AP_T* %22, %struct.Cyc_AP_T** %7
%23 = load %struct.Cyc_AP_T*, %struct.Cyc_AP_T** %7
ret %struct.Cyc_AP_T* %23
}

LLVM IR (-O2):
%struct.Cyc_AP_T = type opaque
define %struct.Cyc_AP_T* @Cyc_mulmod(%struct.Cyc_AP_T* %0, %struct.Cyc_AP_T* %1, %struct.Cyc_AP_T* %2) {
%4 = tail call i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...) bitcast (i32 (...)* @Cyc_AP_mul to i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...)*)(%struct.Cyc_AP_T* %0, %struct.Cyc_AP_T* %1)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.Cyc_AP_T*
%7 = tail call i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...) bitcast (i32 (...)* @Cyc_AP_mod to i32 (%struct.Cyc_AP_T*, %struct.Cyc_AP_T*, ...)*)(%struct.Cyc_AP_T* %6, %struct.Cyc_AP_T* %2)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to %struct.Cyc_AP_T*
ret %struct.Cyc_AP_T* %9
}
/* Variables and functions */
long pow(long, int);
long square_of_sum(int n) {
  long sum = 0;
  for (int i = 0; i <= n; ++i)
    sum += i;
  return pow(sum, 2);
}


x86 assembly (clang, -O0):
<square_of_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1150 <square_of_sum+0x40>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <square_of_sum+0x1a>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_of_sum>:
mov    %edi,%eax
lea    -0x1(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
add    %rax,%rcx
xor    %eax,%eax
test   %edi,%edi
cmovns %rcx,%rax
mov    %rax,%rdi
mov    $0x2,%esi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i64 @square_of_sum(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 %0, i32* %2
store i64 0, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = load i64, i64* %3
%13 = add nsw i64 %12, %11
store i64 %13, i64* %3
br label %14
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load i64, i64* %3
%19 = call i64 @pow(i64 %18, i32 2)
ret i64 %19
}

LLVM IR (-O2):
define i64 @square_of_sum(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = zext i32 %0 to i64
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i64
%6 = mul nuw nsw i64 %3, %5
%7 = lshr i64 %6, 1
%8 = zext i32 %0 to i64
%9 = add nuw nsw i64 %7, %8
%10 = select i1 %2, i64 0, i64 %9
%11 = tail call i64 @pow(i64 %10, i32 2)
ret i64 %11
}
void INT_Excep_RIIC0_ICRXI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC0_ICRXI0() {
ret void
}
void Com_Printf(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @Com_Printf(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ salt;

/* Variables and functions */
int /*<<< orphan*/ generate_random_salt(char *, int);
char *int_to_base64(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *make_ext_salt(int rounds) {
  static char salt[10];
  snprintf(salt, sizeof(salt), "_%s", int_to_base64(rounds));
  generate_random_salt(&salt[5], 4);
  salt[9] = '\0';
  return salt;
}


x86 assembly (clang, -O0):
<make_ext_salt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <int_to_base64@plt>
mov    %rax,%rcx
lea    0x2eec(%rip),%rdi
mov    $0xa,%esi
lea    0xea7(%rip),%rdx
call   1040 <snprintf@plt>
lea    0x2ed4(%rip),%rdi
add    $0x5,%rdi
mov    $0x4,%esi
call   1030 <generate_random_salt@plt>
movb   $0x0,0x2ec8(%rip)
lea    0x2eb8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ext_salt>:
push   %rbx
call   1050 <int_to_base64@plt>
lea    0x2efc(%rip),%rbx
lea    0xebc(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %rax,%rcx
call   1040 <snprintf@plt>
lea    0x2ee3(%rip),%rdi
mov    $0x4,%esi
call   1030 <generate_random_salt@plt>
movb   $0x0,0x2ed6(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@make_ext_salt.salt = internal global [10 x i8] zeroinitializer
@.str = [4 x i8] c"_%s\00"
define i8* @make_ext_salt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @int_to_base64(i32 %3)
%5 = call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @generate_random_salt(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 5), i32 4)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 9)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 0)
}

LLVM IR (-O2):
@make_ext_salt.salt = internal global [10 x i8] zeroinitializer
@.str = [4 x i8] c"_%s\00"
define i8* @make_ext_salt(i32 %0) {
%2 = tail call i8* @int_to_base64(i32 %0)
%3 = tail call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @generate_random_salt(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 5), i32 4)
store i8 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 9)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt.salt, i64 0, i64 0)
}
void SleepMs(int sleepMs) {}


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

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

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

LLVM IR (-O2):
define void @SleepMs(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ u;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
__attribute__((always_)) uint32_t string_as_uint32(const char *s) {
  uint32_t u;
  memcpy(&u, s, sizeof(u));
  return u;
}


x86 assembly (clang, -O0):
<string_as_uint32>:
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):
<string_as_uint32>:
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 @string_as_uint32(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 @string_as_uint32(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 system(char const *);
int run_cmd(const char *cmd) { return system(cmd); }


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

x86 assembly (clang, -O2):
<run_cmd>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @run_cmd(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
int f(int *i) {
  int *p = i;
  if (p)
    return *p;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1129 <f+0x29>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <f+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %rdi,%rdi
je     1108 <f+0x8>
mov    (%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* %0
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void vset(float *v, float x, float y, float z) {
  v[(signed long int)0] = x;
  v[(signed long int)1] = y;
  v[(signed long int)2] = z;
}


x86 assembly (clang, -O0):
<vset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vset>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vset(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float, float* %7
%13 = load float*, float** %5
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float, float* %8
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 2
store float %15, float* %17
ret void
}

LLVM IR (-O2):
define void @vset(float* nocapture writeonly %0, float %1, float %2, float %3) {
store float %1, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %5
%6 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int shuzi = 3, jiage = 30;
  printf("please input a num of your tickets:");
  scanf("%d %d", &shuzi, &jiage);
  printf("ticket %d\n", shuzi * jiage);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
movl   $0x1e,(%rsp)
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"please input a num of your tickets:\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [11 x i8] c"ticket %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 30, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"please input a num of your tickets:\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [11 x i8] c"ticket %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 30, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
void RTTestFailedV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestFailedV() {
ret void
}
int filenchk_(int *nchar, char filen[]) {
  int i;
  for (i = 0; i < *nchar; i = i + 1) {
    if (filen[i] == ' ')
      filen[i] = 0;
  }
  return (0);
}


x86 assembly (clang, -O0):
<filenchk_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1156 <filenchk_+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1143 <filenchk_+0x43>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1148 <filenchk_+0x48>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <filenchk_+0x13>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filenchk_>:
mov    (%rdi),%eax
test   %eax,%eax
jle    112a <filenchk_+0x2a>
xor    %ecx,%ecx
jmp    111c <filenchk_+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
movslq %eax,%rdx
cmp    %rdx,%rcx
jge    112a <filenchk_+0x2a>
cmpb   $0x20,(%rsi,%rcx,1)
jne    1110 <filenchk_+0x10>
movb   $0x0,(%rsi,%rcx,1)
mov    (%rdi),%eax
jmp    1110 <filenchk_+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @filenchk_(i32* nocapture %0, i8* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %2, %13
%6 = phi i32 [ %14, %13 ], [ %3, %2 ]
%7 = phi i64 [ %15, %13 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
br i1 %10, label %11, label %13
11: ; preds = %5
store i8 0, i8* %8
%12 = load i32, i32* %0
br label %13
13: ; preds = %5, %11
%14 = phi i32 [ %6, %5 ], [ %12, %11 ]
%15 = add nuw nsw i64 %7, 1
%16 = sext i32 %14 to i64
%17 = icmp slt i64 %15, %16
br i1 %17, label %5, label %18
18: ; preds = %13, %2
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_uid;
  int /*<<< orphan*/ st_gid;
};

/* Variables and functions */
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
int /*<<< orphan*/ setgroups(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
void set_privilege(char *path) {
  struct stat result;
  if (stat(path, &result) != 0) {
    return;
  }
  setgid(result.st_gid);
  setgroups(1, &(result.st_gid));
  setuid(result.st_uid);
  return;
}


x86 assembly (clang, -O0):
<set_privilege>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     1168 <set_privilege+0x28>
jmp    118a <set_privilege+0x4a>
mov    -0xc(%rbp),%edi
call   1050 <setgid@plt>
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0x1,%edi
call   1030 <setgroups@plt>
mov    -0x10(%rbp),%edi
call   1060 <setuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_privilege>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1178 <set_privilege+0x38>
lea    0xc(%rsp),%rbx
mov    0xc(%rsp),%edi
call   1050 <setgid@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <setgroups@plt>
mov    0x8(%rsp),%edi
call   1060 <setuid@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
define void @set_privilege(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %17
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 @setgid(i32 %10)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%13 = call i32 @setgroups(i32 1, i32* %12)
%14 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%15 = load i32, i32* %14
%16 = call i32 @setuid(i32 %15)
br label %17
17: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define void @set_privilege(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 1
%8 = load i32, i32* %7
%9 = call i32 @setgid(i32 %8)
%10 = call i32 @setgroups(i32 1, i32* %7)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @setuid(i32 %12)
br label %14
14: ; preds = %1, %6
ret void
}