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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  FILE *fp1;
  fp1 = fopen("foo.txt", "w+");
  fprintf(fp1, "hello world");
  fclose(fp1);
  printf("hello world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeaa(%rip),%r14
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"foo.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"foo.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int gethostname(char *, size_t);
int octave_gethostname_wrapper(char *nm, size_t len) {
  return gethostname(nm, len);
}


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

x86 assembly (clang, -O2):
<octave_gethostname_wrapper>:
jmp    1030 <gethostname@plt>

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

LLVM IR (-O2):
define i32 @octave_gethostname_wrapper(i8* %0, i64 %1) {
%3 = tail call i32 @gethostname(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ markstack_cur_unmark();
void test_markstack_1() {
  ;
  markstack_cur_unmark();
  { return; };
}


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

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

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

LLVM IR (-O2):
define void @test_markstack_1() {
%1 = tail call i32 (...) @markstack_cur_unmark()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char nome[11];
  printf("\n Entre com um nome:\n");
  scanf("%s", nome);
  printf("\n Boa Noite %s !!!", nome);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xf(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xf(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
lea    0x5(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0A Entre com um nome:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"\0A Boa Noite %s !!!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"\0A Boa Noite %s !!!\00"
@str = [21 x i8] c"\0A Entre com um nome:\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x9d() {
  Assert_real((isalpha(157) == 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_isalpha.c",
              790, ("isalpha should be 0 for 0x9d"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x9d>:
push   %rax
mov    $0x9d,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x316,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x9d\00"
define void @t_isalpha_0x9d() {
%1 = call i64 @isalpha(i32 157)
%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 790, i8* getelementptr inbounds ([29 x i8], [29 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x9d\00"
define void @t_isalpha_0x9d() {
%1 = tail call i64 @isalpha(i32 157)
%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 790, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct util_dirp {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void do_closedir(struct util_dirp *dp) {
  DIR *rdp = (DIR *)dp;
  closedir(rdp);
}


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

x86 assembly (clang, -O2):
<do_closedir>:
jmp    1030 <closedir@plt>

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

LLVM IR (-O2):
%struct.util_dirp = type { i32 }
define void @do_closedir(%struct.util_dirp* nocapture %0) {
%2 = getelementptr %struct.util_dirp, %struct.util_dirp* %0, i64 0, i32 0
%3 = tail call i32 @closedir(i32* %2)
ret void
}
double getBW_nooverlap(double eff) {
  if (eff == 0)
    return 0;
  double intercept = 137.113;
  double W = 65.348;
  return intercept + W * eff;
}


x86 assembly (clang, -O0):
<getBW_nooverlap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112e <getBW_nooverlap+0x2e>
jp     112e <getBW_nooverlap+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1164 <getBW_nooverlap+0x64>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBW_nooverlap>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
xorpd  %xmm2,%xmm2
cmpeqsd %xmm2,%xmm0
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @getBW_nooverlap(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store double 0.000000e+00, double* %2
br label %14
9: ; preds = %1
store double 1.371130e+02, double* %4
store double 6.534800e+01, double* %5
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double %10)
store double %13, double* %2
br label %14
14: ; preds = %9, %8
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @getBW_nooverlap(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = tail call double @llvm.fmuladd.f64(double %0, double 6.534800e+01, double 1.371130e+02)
%4 = select i1 %2, double 0.000000e+00, double %3
ret double %4
}
/* Variables and functions */
int icbrt_with_guess(int, int);
int icbrt_with_bits(int a, int bits) {
  return icbrt_with_guess(a, a >> 2 * bits / 3);
}


x86 assembly (clang, -O0):
<icbrt_with_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
sar    %cl,%esi
call   1030 <icbrt_with_guess@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icbrt_with_bits>:
add    %esi,%esi
movslq %esi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
add    %eax,%ecx
mov    %edi,%esi
sar    %cl,%esi
jmp    1030 <icbrt_with_guess@plt>

LLVM IR (-O0):
define i32 @icbrt_with_bits(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* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 2, %7
%9 = sdiv i32 %8, 3
%10 = ashr i32 %6, %9
%11 = call i32 @icbrt_with_guess(i32 %5, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @icbrt_with_bits(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = sdiv i32 %3, 3
%5 = ashr i32 %0, %4
%6 = tail call i32 @icbrt_with_guess(i32 %0, i32 %5)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *mstrcpy(const char *str) {
  char *strbuf = (char *)malloc(sizeof(char) * (strlen(str) + 1));
  strcpy(strbuf, str);
  return strbuf;
}


x86 assembly (clang, -O0):
<mstrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mstrcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @mstrcpy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void f_error(char *filename, char *msg) {
  printf("File error in %s: %s\n", filename, msg);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"File error in %s: %s\0A\00"
define void @f_error(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 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"File error in %s: %s\0A\00"
define void @f_error(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ init_game();
int /*<<< orphan*/ init_ncurses();
int /*<<< orphan*/ main_loop();
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char **argv) {
  parse_args(argc, argv);
  init_ncurses();
  init_game();
  main_loop();
  endwin();
  return EXIT_SUCCESS;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_args@plt>
mov    $0x0,%al
call   1030 <init_ncurses@plt>
mov    $0x0,%al
call   1050 <init_game@plt>
mov    $0x0,%al
call   1070 <main_loop@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <parse_args@plt>
xor    %eax,%eax
call   1030 <init_ncurses@plt>
xor    %eax,%eax
call   1050 <init_game@plt>
xor    %eax,%eax
call   1070 <main_loop@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args(i32 %6, i8** %7)
%9 = call i32 (...) @init_ncurses()
%10 = call i32 (...) @init_game()
%11 = call i32 (...) @main_loop()
%12 = call i32 (...) @endwin()
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @init_ncurses()
%5 = tail call i32 (...) @init_game()
%6 = tail call i32 (...) @main_loop()
%7 = tail call i32 (...) @endwin()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ SetCurrentStatus(int /*<<< orphan*/, char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void catchSIGINT(int signo) {
  char *message = "terminated by signal 2\n";
  write(STDOUT_FILENO, message, 23);
  SetCurrentStatus(SIGINT, message);
}


x86 assembly (clang, -O0):
<catchSIGINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    $0x17,%edx
call   1030 <write@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1040 <SetCurrentStatus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catchSIGINT>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rbx
mov    %rbx,%rsi
mov    $0x17,%edx
call   1030 <write@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <SetCurrentStatus@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"terminated by signal 2\0A\00"
@STDOUT_FILENO = global i32 0
@SIGINT = global i32 0
define void @catchSIGINT(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i8*, i8** %3
%6 = call i32 @write(i32 %4, i8* %5, i32 23)
%7 = load i32, i32* @SIGINT
%8 = load i8*, i8** %3
%9 = call i32 @SetCurrentStatus(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"terminated by signal 2\0A\00"
@STDOUT_FILENO = global i32 0
@SIGINT = global i32 0
define void @catchSIGINT(i32 %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
%4 = load i32, i32* @SIGINT
%5 = tail call i32 @SetCurrentStatus(i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t bitReverse(uint8_t bIn) {
  uint8_t bOut = 0;
  for (int ii = 0; ii < 8; ++ii) {
    bOut = (bOut << 1) | (bIn & 1);
    bIn >>= 1;
  }
  return bOut;
}


x86 assembly (clang, -O0):
<bitReverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1147 <bitReverse+0x47>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <bitReverse+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitReverse>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @bitReverse(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 = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = shl i32 %9, 1
%11 = load i32, i32* %2
%12 = and i32 %11, 1
%13 = or i32 %10, %12
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = ashr i32 %14, 1
store i32 %15, i32* %2
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @bitReverse(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ double_list();
int /*<<< orphan*/ loop_list();
int /*<<< orphan*/ sequential_list();
int /*<<< orphan*/ single_list();
int /*<<< orphan*/ static_list();
int main(int argc, char *argv[]) {
  sequential_list();
  single_list();
  loop_list();
  static_list();
  double_list();
  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 <sequential_list@plt>
mov    $0x0,%al
call   1070 <single_list@plt>
mov    $0x0,%al
call   1040 <loop_list@plt>
mov    $0x0,%al
call   1060 <static_list@plt>
mov    $0x0,%al
call   1050 <double_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sequential_list@plt>
xor    %eax,%eax
call   1070 <single_list@plt>
xor    %eax,%eax
call   1040 <loop_list@plt>
xor    %eax,%eax
call   1060 <static_list@plt>
xor    %eax,%eax
call   1050 <double_list@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 (...) @sequential_list()
%7 = call i32 (...) @single_list()
%8 = call i32 (...) @loop_list()
%9 = call i32 (...) @static_list()
%10 = call i32 (...) @double_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sequential_list()
%4 = tail call i32 (...) @single_list()
%5 = tail call i32 (...) @loop_list()
%6 = tail call i32 (...) @static_list()
%7 = tail call i32 (...) @double_list()
ret i32 0
}
int ipm_get_virtmem(double *bytes) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ipm_get_virtmem(double* nocapture readnone %0) {
ret i32 0
}
int jac_chain_nm6_free(void *mem) {
  (void)mem;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @jac_chain_nm6_free(i8* nocapture readnone %0) {
ret i32 0
}
void setup_wifi(char *ssid, char *pass) {}


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

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

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

LLVM IR (-O2):
define void @setup_wifi(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int LireNombre(unsigned char *mem, int taille, int *valeur) { char hex[100]; }


x86 assembly (clang, -O0):
<LireNombre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @LireNombre(i8* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca [100 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @LireNombre(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 undef
}
void doet_iets_geheims(void) { return; }


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

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

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

LLVM IR (-O2):
define void @doet_iets_geheims() {
ret void
}
/* Variables and functions */
int ENOSYS;
int errno;
int openat(const int dirfd, const char *const pathname, const int flags, ...) {
  (void)dirfd, (void)pathname, (void)flags;
  return errno = ENOSYS, -1;
}


x86 assembly (clang, -O0):
<openat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<openat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @openat(i32 %0, i8* %1, i32 %2, ...) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* @ENOSYS
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @openat(i32 %0, i8* nocapture readnone %1, i32 %2, ...) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
void gtk_drag_dest_add_text_targets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_dest_add_text_targets() {
ret void
}
int f(unsigned int m, unsigned int n) {
  return (m * n == 0) ? m + n + 1 : f(m - 1, f(m, n - 1));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    113f <f+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <f+0x53>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <f@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %esi,%eax
mov    %esi,%ecx
imul   %edi,%ecx
test   %ecx,%ecx
je     113a <f+0x2a>
nopl   0x0(%rax)
lea    -0x1(%rdi),%ebx
add    $0xffffffff,%eax
mov    %eax,%esi
call   1030 <f@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %ebx,%edi
test   %ecx,%ecx
jne    1120 <f+0x10>
jmp    113c <f+0x2c>
mov    %edi,%ebx
add    %ebx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(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 = mul i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add i32 %10, %11
%13 = add i32 %12, 1
br label %22
14: ; preds = %2
%15 = load i32, i32* %3
%16 = sub i32 %15, 1
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = sub i32 %18, 1
%20 = call i32 @f(i32 %17, i32 %19)
%21 = call i32 @f(i32 %16, i32 %20)
br label %22
22: ; preds = %14, %9
%23 = phi i32 [ %13, %9 ], [ %21, %14 ]
ret i32 %23
}

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rsp_exception(int);
int check_for_exception_vector(uint32_t ppc) {
  switch (ppc) {
  case 0x0200:
  case 0x0600:
  case 0x0700:
  case 0x0e00:
    if (0)
      printf("PPC at exception address\n");
    rsp_exception(ppc);
    return 1;
  default:
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_for_exception_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x200,%eax
je     116a <check_for_exception_vector+0x5a>
jmp    1131 <check_for_exception_vector+0x21>
mov    -0xc(%rbp),%eax
sub    $0x600,%eax
je     116a <check_for_exception_vector+0x5a>
jmp    1144 <check_for_exception_vector+0x34>
mov    -0xc(%rbp),%eax
sub    $0x700,%eax
je     116a <check_for_exception_vector+0x5a>
jmp    1157 <check_for_exception_vector+0x47>
mov    -0xc(%rbp),%eax
sub    $0xe00,%eax
jne    117e <check_for_exception_vector+0x6e>
jmp    116a <check_for_exception_vector+0x5a>
mov    -0x8(%rbp),%edi
call   1030 <rsp_exception@plt>
movl   $0x1,-0x4(%rbp)
jmp    1185 <check_for_exception_vector+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_exception_vector>:
xor    %eax,%eax
cmp    $0x6ff,%edi
jg     112b <check_for_exception_vector+0x1b>
cmp    $0x200,%edi
je     113b <check_for_exception_vector+0x2b>
cmp    $0x600,%edi
je     113b <check_for_exception_vector+0x2b>
ret
cmp    $0xe00,%edi
je     113b <check_for_exception_vector+0x2b>
cmp    $0x700,%edi
jne    112a <check_for_exception_vector+0x1a>
push   %rax
call   1030 <rsp_exception@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @check_for_exception_vector(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 512, label %5
i32 1536, label %5
i32 1792, label %5
i32 3584, label %5
]
5: ; preds = %1, %1, %1, %1
%6 = load i32, i32* %3
%7 = call i32 @rsp_exception(i32 %6)
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @check_for_exception_vector(i32 %0) {
switch i32 %0, label %4 [
i32 512, label %2
i32 1536, label %2
i32 1792, label %2
i32 3584, label %2
]
2: ; preds = %1, %1, %1, %1
%3 = tail call i32 @rsp_exception(i32 %0)
br label %4
4: ; preds = %1, %2
%5 = phi i32 [ 1, %2 ], [ 0, %1 ]
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeLCD(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000066, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeLCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x66,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeLCD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x66,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeLCD(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 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 102, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeLCD(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 102, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ haoni(int, char, char, char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  printf("Please enter the amount of disks:\n");
  scanf("%d", &n);
  haoni(n, 'x', 'y', 'z');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    $0x78,%esi
mov    $0x79,%edx
mov    $0x7a,%ecx
call   1030 <haoni@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x78,%esi
mov    $0x79,%edx
mov    $0x7a,%ecx
call   1030 <haoni@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Please enter the amount of disks:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @haoni(i32 %4, i8 signext 120, i8 signext 121, i8 signext 122)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [34 x i8] c"Please enter the amount of disks:\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @haoni(i32 %5, i8 signext 120, i8 signext 121, i8 signext 122)
ret void
}
/* Type definitions */
struct hash_table {
  int dummy;
};

/* Variables and functions */
void **hash_findi(struct hash_table *, char const *, int /*<<< orphan*/ *);
void *hash_findix(struct hash_table *hash, const char *str) {
  void **p;
  p = hash_findi(hash, str, NULL);
  return p ? *p : NULL;
}


x86 assembly (clang, -O0):
<hash_findix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <hash_findi@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1150 <hash_findix+0x40>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    115b <hash_findix+0x4b>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    115b <hash_findix+0x4b>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_findix>:
push   %rbx
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <hash_findi@plt>
test   %rax,%rax
je     1122 <hash_findix+0x12>
mov    (%rax),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hash_table = type { i32 }
define i8* @hash_findix(%struct.hash_table* %0, i8* %1) {
%3 = alloca %struct.hash_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.hash_table* %0, %struct.hash_table** %3
store i8* %1, i8** %4
%6 = load %struct.hash_table*, %struct.hash_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @hash_findi(%struct.hash_table* %6, i8* %7, i32* null)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %11
%16 = phi i8* [ %13, %11 ], [ null, %14 ]
ret i8* %16
}

LLVM IR (-O2):
%struct.hash_table = type { i32 }
define i8* @hash_findix(%struct.hash_table* %0, i8* %1) {
%3 = tail call i8** @hash_findi(%struct.hash_table* %0, i8* %1, i32* null)
%4 = icmp eq i8** %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
int stringLength(char *String) {
  int Length = 0;
  for (; *String; ++String, ++Length) {
  }
  return Length;
}


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

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

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(unsigned char);
void SendStrings(unsigned char *str) {
  while (*str) {
    SendChar((*str) & 0xFF);
    str++;
  }
}


x86 assembly (clang, -O0):
<SendStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <SendStrings+0x3e>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
movzbl %al,%edi
call   1030 <SendChar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <SendStrings+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendStrings>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <SendStrings+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <SendChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <SendStrings+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @SendStrings(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = call i32 @SendChar(i8 zeroext %12)
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @SendStrings(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 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @SendChar(i8 zeroext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int unlink(char const *);
int wbt_delete_file(const char *name) { return unlink(name); }


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

x86 assembly (clang, -O2):
<wbt_delete_file>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @wbt_delete_file(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
int f1(int x) {
  switch (x) {
  case 0:
    return 3;
  case 1:
    return 4;
  default:
    return 6;
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     112b <f1+0x2b>
jmp    111a <f1+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1137 <f1+0x37>
jmp    1143 <f1+0x43>
movl   $0x3,-0x4(%rbp)
jmp    114a <f1+0x4a>
movl   $0x4,-0x4(%rbp)
jmp    114a <f1+0x4a>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
lea    (%rax,%rax,1),%ecx
add    $0x4,%ecx
test   %edi,%edi
mov    $0x3,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i32 3, i32* %2
br label %8
6: ; preds = %1
store i32 4, i32* %2
br label %8
7: ; preds = %1
store i32 6, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 4, i32 6
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 3, i32 %3
ret i32 %5
}
void dlmstp_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @dlmstp_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_x();
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ led_on();
void blink_green(void) {
  for (;;) {
    led_off();
    delay_x();
    led_on();
    delay_x();
  }
}


x86 assembly (clang, -O0):
<blink_green>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <blink_green+0x9>
mov    $0x0,%al
call   1040 <led_off@plt>
mov    $0x0,%al
call   1030 <delay_x@plt>
mov    $0x0,%al
call   1050 <led_on@plt>
mov    $0x0,%al
call   1030 <delay_x@plt>
jmp    1139 <blink_green+0x9>

x86 assembly (clang, -O2):
<blink_green>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <led_off@plt>
xor    %eax,%eax
call   1030 <delay_x@plt>
xor    %eax,%eax
call   1050 <led_on@plt>
xor    %eax,%eax
call   1030 <delay_x@plt>
jmp    1140 <blink_green+0x10>

LLVM IR (-O0):
define void @blink_green() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @led_off()
%3 = call i32 (...) @delay_x()
%4 = call i32 (...) @led_on()
%5 = call i32 (...) @delay_x()
br label %1
}

LLVM IR (-O2):
define void @blink_green() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @led_off()
%3 = tail call i32 (...) @delay_x()
%4 = tail call i32 (...) @led_on()
%5 = tail call i32 (...) @delay_x()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  long tid;
  tid = (long)threadid;
  printf("Soy el hilo #%ld!\n", tid);
  pthread_exit(NULL);
}


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

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Soy el hilo #%ld!\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [19 x i8] c"Soy el hilo #%ld!\0A\00"
define noalias i8* @PrintHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
scalar_t__ isdigit(char);
int isxdigit(char c) {
  return isdigit(c) || ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F'));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117d <isxdigit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1158 <isxdigit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    117d <isxdigit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1177 <isxdigit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xdf,%bl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %24, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 102
br i1 %13, label %24, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 70
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br label %24
24: ; preds = %22, %10, %1
%25 = phi i1 [ true, %10 ], [ true, %1 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @isxdigit(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}