xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ add_output(char *);
int /*<<< orphan*/ get_board_as_string(char *);
void gtp_showboard(int gtp_argc, char gtp_argv[][20]) {
  char board_output[4096];
  get_board_as_string(board_output);
  add_output(board_output);
  return;
}


x86 assembly (clang, -O0):
<gtp_showboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
call   1030 <get_board_as_string@plt>
lea    -0x1010(%rbp),%rdi
call   1040 <add_output@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtp_showboard>:
push   %rbx
sub    $0x1000,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <get_board_as_string@plt>
mov    %rbx,%rdi
call   1040 <add_output@plt>
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @gtp_showboard(i32 %0, [20 x i8]* %1) {
%3 = alloca i32
%4 = alloca [20 x i8]*
%5 = alloca [4096 x i8]
store i32 %0, i32* %3
store [20 x i8]* %1, [20 x i8]** %4
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%7 = call i32 @get_board_as_string(i8* %6)
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%9 = call i32 @add_output(i8* %8)
ret void
}

LLVM IR (-O2):
define void @gtp_showboard(i32 %0, [20 x i8]* nocapture readnone %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @get_board_as_string(i8* %4)
%6 = call i32 @add_output(i8* %4)
ret void
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t bitfn_swap32(uint32_t a) {
  __asm__("bswap %0" : "=r"(a) : "0"(a));
  return a;
}


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

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

LLVM IR (-O0):
define i8* @bitfn_swap32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @bitfn_swap32(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void RTRandAdvCreateSystemFaster(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandAdvCreateSystemFaster() {
ret void
}
unsigned long long unsignedlonglong_ignoring_unsignedint(unsigned long long x,
                                                         unsigned int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_unsignedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void *umm_malloc(size_t);
void *umm_calloc(size_t num, size_t item_size) {
  void *ret;
  ret = umm_malloc((size_t)(item_size * num));
  if (ret)
    bzero(ret, (size_t)(item_size * num));
  return ret;
}


x86 assembly (clang, -O0):
<umm_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x8(%rbp),%rdi
call   1030 <umm_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115f <umm_calloc+0x3f>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x8(%rbp),%rsi
call   1040 <bzero@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umm_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <umm_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1146 <umm_calloc+0x26>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <bzero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @umm_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = mul i64 %6, %7
%9 = call i8* @umm_malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = mul i64 %14, %15
%17 = call i32 @bzero(i8* %13, i64 %16)
br label %18
18: ; preds = %12, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @umm_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @umm_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @bzero(i8* %4, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
double tan(double);
double cbuiltin_tan(double x) { return tan(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_tan>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @cbuiltin_tan(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
/* Variables and functions */
void *malloc(int /*<<< orphan*/);
int main() {
  void *x = malloc(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENGINE_load_dynamic();
int /*<<< orphan*/ ENGINE_load_padlock();
int /*<<< orphan*/ ENGINE_load_rsax();
int /*<<< orphan*/ ENGINE_register_all_complete();
int /*<<< orphan*/ OPENSSL_cpuid_setup();
void ENGINE_load_builtin_engines(void) {
  OPENSSL_cpuid_setup();
  ENGINE_load_rsax();
  ENGINE_load_dynamic();
  ENGINE_load_padlock();
  ENGINE_register_all_complete();
}


x86 assembly (clang, -O0):
<ENGINE_load_builtin_engines>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OPENSSL_cpuid_setup@plt>
mov    $0x0,%al
call   1050 <ENGINE_load_rsax@plt>
mov    $0x0,%al
call   1070 <ENGINE_load_dynamic@plt>
mov    $0x0,%al
call   1030 <ENGINE_load_padlock@plt>
mov    $0x0,%al
call   1060 <ENGINE_register_all_complete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENGINE_load_builtin_engines>:
push   %rax
xor    %eax,%eax
call   1040 <OPENSSL_cpuid_setup@plt>
xor    %eax,%eax
call   1050 <ENGINE_load_rsax@plt>
xor    %eax,%eax
call   1070 <ENGINE_load_dynamic@plt>
xor    %eax,%eax
call   1030 <ENGINE_load_padlock@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <ENGINE_register_all_complete@plt>

LLVM IR (-O0):
define void @ENGINE_load_builtin_engines() {
%1 = call i32 (...) @OPENSSL_cpuid_setup()
%2 = call i32 (...) @ENGINE_load_rsax()
%3 = call i32 (...) @ENGINE_load_dynamic()
%4 = call i32 (...) @ENGINE_load_padlock()
%5 = call i32 (...) @ENGINE_register_all_complete()
ret void
}

LLVM IR (-O2):
define void @ENGINE_load_builtin_engines() {
%1 = tail call i32 (...) @OPENSSL_cpuid_setup()
%2 = tail call i32 (...) @ENGINE_load_rsax()
%3 = tail call i32 (...) @ENGINE_load_dynamic()
%4 = tail call i32 (...) @ENGINE_load_padlock()
%5 = tail call i32 (...) @ENGINE_register_all_complete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_1246() {
  Assert_real((isqrt(1246) == 35),
              "/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/stdlib/isqrt.c",
              1290, ("Integer square root of 1246 should be 35"));
}


x86 assembly (clang, -O0):
<t_sqrt_1246>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4de,%edi
call   1030 <isqrt@plt>
cmp    $0x23,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x50a,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_1246>:
push   %rax
mov    $0x4de,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x23,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x50a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 1246 should be 35\00"
define void @t_sqrt_1246() {
%1 = call i32 @isqrt(i32 1246)
%2 = icmp eq i32 %1, 35
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1290, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 1246 should be 35\00"
define void @t_sqrt_1246() {
%1 = tail call i32 @isqrt(i32 1246)
%2 = icmp eq i32 %1, 35
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1290, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *x = (char *)malloc(10);
  free(x);
  return x[5];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
movsbl 0x5(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
%4 = getelementptr inbounds i8, i8* %2, i64 5
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
void RGB24ToJ420() {}


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

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

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

LLVM IR (-O2):
define void @RGB24ToJ420() {
ret void
}
int test_imm_CCint64_highword_reg(long long val) {
  return ((val >> 32) & (0xCC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CCint64_highword_reg(i64 %0) {
%2 = and i64 %0, 876173328384
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_word(int, int, int);
void write_quad(int fd, uint32_t pos, uint32_t value) {
  write_word(fd, pos, value);
  write_word(fd, pos + 2, value >> 16);
}


x86 assembly (clang, -O0):
<write_quad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <write_word@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0xc(%rbp),%edx
sar    $0x10,%edx
call   1030 <write_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_quad>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
call   1030 <write_word@plt>
add    $0x2,%ebp
sar    $0x10,%ebx
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write_word@plt>

LLVM IR (-O0):
define void @write_quad(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @write_word(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 2
%14 = load i32, i32* %6
%15 = ashr i32 %14, 16
%16 = call i32 @write_word(i32 %11, i32 %13, i32 %15)
ret void
}

LLVM IR (-O2):
define void @write_quad(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @write_word(i32 %0, i32 %1, i32 %2)
%5 = add nsw i32 %1, 2
%6 = ashr i32 %2, 16
%7 = tail call i32 @write_word(i32 %0, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(__attribute((unused)) int signal) {
  printf("\tInterrupt signal received, nothing to be done\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 = [48 x i8] c"\09Interrupt signal received, nothing to be done\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"\09Interrupt signal received, nothing to be done\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
int ti_log10_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_log10_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sighup_rehash(void) { syslog(LOG_INFO, "Got SIGHUP, rehashing...\n"); }


x86 assembly (clang, -O0):
<sighup_rehash>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <syslog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup_rehash>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"Got SIGHUP, rehashing...\0A\00"
define void @sighup_rehash() {
%1 = load i32, i32* @LOG_INFO
%2 = call i32 @syslog(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"Got SIGHUP, rehashing...\0A\00"
define void @sighup_rehash() {
%1 = load i32, i32* @LOG_INFO
%2 = tail call i32 @syslog(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct btree_t {
  int dummy;
};
struct btree_node_t {
  int dummy;
};

/* Variables and functions */
int btree_insert(struct btree_t *, struct btree_node_t *, void const *, int);
int btree_ins_left(struct btree_t *tree, struct btree_node_t *node,
                   const void *key) {
  return btree_insert(tree, node, key, 1);
}


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

x86 assembly (clang, -O2):
<btree_ins_left>:
mov    $0x1,%ecx
jmp    1030 <btree_insert@plt>

LLVM IR (-O0):
%struct.btree_t = type { i32 }
%struct.btree_node_t = type { i32 }
define i32 @btree_ins_left(%struct.btree_t* %0, %struct.btree_node_t* %1, i8* %2) {
%4 = alloca %struct.btree_t*
%5 = alloca %struct.btree_node_t*
%6 = alloca i8*
store %struct.btree_t* %0, %struct.btree_t** %4
store %struct.btree_node_t* %1, %struct.btree_node_t** %5
store i8* %2, i8** %6
%7 = load %struct.btree_t*, %struct.btree_t** %4
%8 = load %struct.btree_node_t*, %struct.btree_node_t** %5
%9 = load i8*, i8** %6
%10 = call i32 @btree_insert(%struct.btree_t* %7, %struct.btree_node_t* %8, i8* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.btree_t = type { i32 }
%struct.btree_node_t = type { i32 }
define i32 @btree_ins_left(%struct.btree_t* %0, %struct.btree_node_t* %1, i8* %2) {
%4 = tail call i32 @btree_insert(%struct.btree_t* %0, %struct.btree_node_t* %1, i8* %2, i32 1)
ret i32 %4
}
void swap_init(int s) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
int /*<<< orphan*/ stat_make_dir(struct stat *);
void stat_default_dir(struct stat *st) {
  memset(st, 0, sizeof(struct stat));
  stat_make_dir(st);
}


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

x86 assembly (clang, -O2):
<stat_default_dir>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <stat_make_dir@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @stat_default_dir(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = call i32 @memset(%struct.stat* %3, i32 0, i32 4)
%5 = load %struct.stat*, %struct.stat** %2
%6 = call i32 @stat_make_dir(%struct.stat* %5)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @stat_default_dir(%struct.stat* %0) {
%2 = tail call i32 @memset(%struct.stat* %0, i32 0, i32 4)
%3 = tail call i32 @stat_make_dir(%struct.stat* %0)
ret void
}
int main() {
  int i = 0;
  while (i < 100) {
    if (i % 2 == 0) {
      i += 1;
    } else if (i % 3 == 0) {
      i += 2;
    } else {
      i += 3;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1173 <main+0x73>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113e <main+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116e <main+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1160 <main+0x60>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <main+0x69>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    116e <main+0x6e>
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_enomem();
void *malloc(size_t);
void *tr_malloc(size_t size) {
  void *mem = malloc(size);
  if (!mem)
    log_enomem();
  return mem;
}


x86 assembly (clang, -O0):
<tr_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <tr_malloc+0x2b>
mov    $0x0,%al
call   1040 <log_enomem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <tr_malloc+0x15>
xor    %eax,%eax
call   1040 <log_enomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @tr_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @log_enomem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ static_assert(int);
void main(int n) {
  int i = 0, j = 0;
  while (i < 3) {
    i++;
    j++;
  }
  static_assert(j == 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <main+0x19>
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <static_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <static_assert@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 3
%16 = zext i1 %15 to i32
%17 = call i32 @static_assert(i32 %16)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @static_assert(i32 1)
ret void
}
unsigned xrop3_142_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk2 = S ^ D;
  stk3 = T ^ D;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_142_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_142_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %ecx
and    %eax,%ecx
movzbl %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_142_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = xor i32 %23, %24
store i32 %25, i32* %9
%26 = load i32, i32* %7
%27 = load i32, i32* %5
%28 = xor i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = and i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = load i32, i32* %6
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_142_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = and i32 %4, 255
%9 = xor i32 %8, 255
%10 = and i32 %9, %7
%11 = or i32 %10, %3
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
char char_n(FILE *fp, int n, char *buf) {
  fgets(buf, 10000, fp);
  return buf[n];
}


x86 assembly (clang, -O0):
<char_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x2710,%esi
call   1030 <fgets@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_n>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rdx
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1030 <fgets@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,1),%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @char_n(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32*, i32** %4
%9 = call i32 @fgets(i8* %7, i32 10000, i32* %8)
%10 = load i8*, i8** %6
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @char_n(i32* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 @fgets(i8* %2, i32 10000, i32* %0)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __up(struct semaphore *);
void up(struct semaphore *sem) { __up(sem); }


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

x86 assembly (clang, -O2):
<up>:
jmp    1030 <__up@plt>

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

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define void @up(%struct.semaphore* %0) {
%2 = tail call i32 @__up(%struct.semaphore* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid_count(unsigned int, unsigned int, unsigned int,
                                 unsigned int, unsigned int, unsigned int);
int get_cpuid_count(unsigned int leaf, unsigned int subleaf, unsigned int *eax,
                    unsigned int *ebx, unsigned int *ecx, unsigned int *edx) {
  int cpuInfo[4];
  __cpuid_count(leaf, subleaf, *eax, *ebx, *ecx, *edx);
  return 1;
}


x86 assembly (clang, -O0):
<get_cpuid_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    (%rax),%r8d
mov    -0x28(%rbp),%rax
mov    (%rax),%r9d
call   1030 <__cpuid_count@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpuid_count>:
push   %rax
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
call   1030 <__cpuid_count@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_cpuid_count(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca [4 x i32]
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = load i32*, i32** %11
%21 = load i32, i32* %20
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = call i32 @__cpuid_count(i32 %14, i32 %15, i32 %17, i32 %19, i32 %21, i32 %23)
ret i32 1
}

LLVM IR (-O2):
define i32 @get_cpuid_count(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = tail call i32 @__cpuid_count(i32 %0, i32 %1, i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void uv50() {
  printf("\nLowering CPU VDD Voltage by 50mV\n");
  char buf[256];
  sprintf(
      buf, "/system/bin/sh -c %s",
      "'echo -50000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'");
  system(buf);
}


x86 assembly (clang, -O0):
<uv50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xece(%rip),%rsi
lea    0xedc(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv50>:
push   %rbx
sub    $0x100,%rsp
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0ALowering CPU VDD Voltage by 50mV\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo -50000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
define void @uv50() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo -50000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
@str = [34 x i8] c"\0ALowering CPU VDD Voltage by 50mV\00"
define void @uv50() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
int c028(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c028() {
ret i32 0
}
/* Variables and functions */
int float_interval(double, double);
int main() {
  float x, y;
  int N = 1000;
  float k;
  while (1) {
    N = float_interval(-0.1, 0.1);
    x = 0.68 * (x - y) + N;
    y = 2 * 0.68 * y + x;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x10(%rbp)
movsd  0xee2(%rip),%xmm0
movsd  0xee2(%rip),%xmm1
call   1030 <float_interval@plt>
mov    %eax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xeaa(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x38(%rbp)
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x28(%rbp)
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <float_interval@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
store i32 1000, i32* %4
br label %6
6: ; preds = %0, %6
%7 = call i32 @float_interval(double -1.000000e-01, double 1.000000e-01)
store i32 %7, i32* %4
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fsub float %8, %9
%11 = fpext float %10 to double
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = call double @llvm.fmuladd.f64(double 6.800000e-01, double %11, double %13)
%15 = fptrunc double %14 to float
store float %15, float* %2
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = call double @llvm.fmuladd.f64(double 1.360000e+00, double %17, double %19)
%21 = fptrunc double %20 to float
store float %21, float* %3
br label %6
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @float_interval(double -1.000000e-01, double 1.000000e-01)
br label %1
}
/* Variables and functions */
size_t os_strlen(const char *s) {
  const char *p = s;
  while (*p) {
    p++;
  }
  return p - s;
}


x86 assembly (clang, -O0):
<os_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <os_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <os_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <os_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @os_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int isLess(int a, int b) { return a > b ? 1 : 0; }


x86 assembly (clang, -O0):
<isLess>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLess>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @isLess(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* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @isLess(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *td_zlib_version(void) { return "none"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i8* @td_zlib_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t s1(uint64_t w) {
  return (((w) >> (19)) | ((w) << (64 - (19)))) ^
         (((w) >> (61)) | ((w) << (64 - (61)))) ^ (w >> 6);
}


x86 assembly (clang, -O0):
<s1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x13,%eax
mov    -0x4(%rbp),%edx
mov    $0x2d,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x3d,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x6,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @s1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 19
%5 = load i32, i32* %2
%6 = shl i32 %5, 45
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 61
%10 = load i32, i32* %2
%11 = shl i32 %10, 3
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 6
%16 = xor i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @s1(i32 %0) {
ret i32 poison
}
int ft_isprint(int c) {
  if (c >= 040 && c <= 0176)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1127 <ft_isprint+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <ft_isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double abs2(double, double);
double abs(double a, double b) { return abs2(a, b); }


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

x86 assembly (clang, -O2):
<abs>:
jmp    1030 <abs2@plt>

LLVM IR (-O0):
define double @abs(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @abs2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @abs(double %0, double %1) {
%3 = tail call double @abs2(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int a;
  for (a = 0; a < argc; a++) {
    printf("Argument %d is %s.\n", a, argv[a]);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Argument %d is %s.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void say(char *str) {
  write(1, str, strlen(str));
  fflush(stdout);
}


x86 assembly (clang, -O0):
<say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @say(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @say(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
void RTAvllU32Get(void) {}


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

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

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

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