xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(int);
int main(int argc, char **argv) {
  char t = **argv;
  void *p = malloc(16);
  ((char *)p)[15] = t;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
%10 = call i8* @malloc(i32 16)
store i8* %10, i8** %6
%11 = load i8, i8* %5
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 15
store i8 %11, i8* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
jump(label) int label;
{
  ot("JMP ");
  printlabel(label);
  nl();
}


x86 assembly (clang, -O0):
<jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <printlabel@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <ot@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <printlabel@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"JMP \00"
define i32 @jump(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (...) @nl()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"JMP \00"
define i32 @jump(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ screenwidth();
void basScreenWidth() { pushNumber(screenwidth()); }


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

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

LLVM IR (-O0):
define void @basScreenWidth() {
%1 = call i32 (...) @screenwidth()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basScreenWidth() {
%1 = tail call i32 (...) @screenwidth()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core6_print(char *, char const *);
void U_EMRPOLYBEZIER16_print(const char *contents) {
  core6_print("U_EMRPOLYBEZIER16", contents);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"U_EMRPOLYBEZIER16\00"
define void @U_EMRPOLYBEZIER16_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core6_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"U_EMRPOLYBEZIER16\00"
define void @U_EMRPOLYBEZIER16_print(i8* %0) {
%2 = tail call i32 @core6_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmm(int);
int foo(int x, int y) {
  mmm(y);
  if (x != 0)
    x++;
  return 5 / x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <mmm@plt>
cmpl   $0x0,-0x4(%rbp)
je     1139 <foo+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x5,%eax
cltd
idivl  -0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <mmm@plt>
add    $0x1,%ebx
mov    $0x5,%eax
xor    %edx,%edx
idiv   %ebx
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @mmm(i32 %1)
%4 = add nsw i32 %0, 1
%5 = sdiv i32 5, %4
ret i32 %5
}
void ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {}


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

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

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

LLVM IR (-O2):
%struct.ath5k_softc = type opaque
%struct.ath5k_hw = type opaque
define void @ath5k_debug_printrxbuffs(%struct.ath5k_softc* nocapture %0, %struct.ath5k_hw* nocapture %1) {
ret void
}
/* Variables and functions */
int f_d();
int f_c() {
  int ret, x = f_d();
  for (int i = 0; i < x; ++i)
    ret += i * i;
  return ret;
}


x86 assembly (clang, -O0):
<f_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f_d@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1150 <f_c+0x40>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <f_c+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f_c() {
%1 = tail call i32 (...) @f_d()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
void ft_putcolor(char *str, char *color) {
  ft_putstr(color);
  ft_putstr(str);
  ft_putstr("\033[0;m");
}


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

x86 assembly (clang, -O2):
<ft_putcolor>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <ft_putstr@plt>
mov    %rbx,%rdi
call   1030 <ft_putstr@plt>
lea    0xed5(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[0;m\00"
define void @ft_putcolor(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @ft_putstr(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @ft_putstr(i8* %7)
%9 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[0;m\00"
define void @ft_putcolor(i8* %0, i8* %1) {
%3 = tail call i32 @ft_putstr(i8* %1)
%4 = tail call i32 @ft_putstr(i8* %0)
%5 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int lg(int n, int base) {
  int i;
  for (i = 0; n > 0; i++)
    n /= base;
  return i;
}


x86 assembly (clang, -O0):
<lg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1135 <lg+0x35>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <lg+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lg>:
test   %edi,%edi
jle    111d <lg+0x1d>
mov    %edi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cltd
idiv   %esi
add    $0x1,%ecx
test   %eax,%eax
jg     1110 <lg+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lg(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = sdiv i32 %6, %1
%8 = add nuw nsw i32 %5, 1
%9 = icmp sgt i32 %7, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
char *concat_all(int, char const *, char const *);
char *concat(const char *str1, const char *str2) {
  return concat_all(2, str1, str2);
}


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

x86 assembly (clang, -O2):
<concat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <concat_all@plt>

LLVM IR (-O0):
define i8* @concat(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 i8* @concat_all(i32 2, i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i8* @concat_all(i32 2, i8* %0, i8* %1)
ret i8* %3
}
int driveBR(int forwardPower, int turnPower) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @driveBR(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void quit() { exit(1); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @quit() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void a_crash() { *(volatile char *)0 = 0; }


x86 assembly (clang, -O0):
<a_crash>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_crash>:
movb   $0x0,0x0
ret

LLVM IR (-O0):
define void @a_crash() {
store volatile i8 0, i8* null
ret void
}

LLVM IR (-O2):
define void @a_crash() {
store volatile i8 0, i8* null
ret void
}
/* Type definitions */
typedef size_t off_t;

/* Variables and functions */
off_t NumeroElementiFSA(char **array) {
  register off_t i = 0;
  while (array[i] != NULL)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<NumeroElementiFSA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <NumeroElementiFSA+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <NumeroElementiFSA+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @NumeroElementiFSA(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
void SysCtlLDOConfigSet(unsigned long ulConfig) {
  {
    if (!((ulConfig == 0x00000001) || (ulConfig == 0x00000000))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c",
          1064);
    }
  };
  (*((volatile unsigned long *)(0x400FE160))) = ulConfig;
}


x86 assembly (clang, -O0):
<SysCtlLDOConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     1143 <SysCtlLDOConfigSet+0x33>
cmpq   $0x0,-0x8(%rbp)
je     1143 <SysCtlLDOConfigSet+0x33>
lea    0xec7(%rip),%rdi
mov    $0x428,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rcx
mov    $0x400fe160,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLDOConfigSet>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     112b <SysCtlLDOConfigSet+0x1b>
lea    0xedf(%rip),%rdi
mov    $0x428,%esi
call   1030 <AssertFailure@plt>
mov    %rbx,0x400fe160
40
pop    %rbx
ret

LLVM IR (-O0):
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define void @SysCtlLDOConfigSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1064)
br label %10
10: ; preds = %8, %5, %1
%11 = load i64, i64* %2
store volatile i64 %11, i64* inttoptr (i64 1074782560 to i64*)
ret void
}

LLVM IR (-O2):
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define void @SysCtlLDOConfigSet(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1064)
br label %5
5: ; preds = %3, %1
store volatile i64 %0, i64* inttoptr (i64 1074782560 to i64*)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EPIDividerSet(uint32_t ui32Base, uint32_t ui32Divider) {
  ASSERT(ui32Base == 0x400D0000);
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) = ui32Divider;
}


x86 assembly (clang, -O0):
<EPIDividerSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIDividerSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400d0000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x4(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @EPIDividerSet(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 = icmp eq i32 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 4
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %9, i32* %13
ret void
}

LLVM IR (-O2):
define void @EPIDividerSet(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074593792
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void display(int *arr, int size) {
  for (int i = 0; i < size; i++) {
    printf("%d\t", *(arr + i));
  }
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <display+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void wr_sjl(s) char *s;
{
  wr_s(s);
  wr_j(s);
  wr_l(s);
}


x86 assembly (clang, -O0):
<wr_sjl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <wr_s@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <wr_j@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <wr_l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr_sjl>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <wr_s@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <wr_j@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <wr_l@plt>

LLVM IR (-O0):
define void @wr_sjl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @wr_s to i32 (i8*, ...)*)(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @wr_j to i32 (i8*, ...)*)(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @wr_l to i32 (i8*, ...)*)(i8* %7)
ret void
}

LLVM IR (-O2):
define void @wr_sjl(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @wr_s to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @wr_j to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @wr_l to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Type definitions */
struct DSLinkedList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ds_list_insert(struct DSLinkedList *, int /*<<< orphan*/ *,
                                  void *);
void ds_list_prepend(struct DSLinkedList *lst, void *data) {
  ds_list_insert(lst, NULL, data);
}


x86 assembly (clang, -O0):
<ds_list_prepend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <ds_list_insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds_list_prepend>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <ds_list_insert@plt>

LLVM IR (-O0):
%struct.DSLinkedList = type { i32 }
define void @ds_list_prepend(%struct.DSLinkedList* %0, i8* %1) {
%3 = alloca %struct.DSLinkedList*
%4 = alloca i8*
store %struct.DSLinkedList* %0, %struct.DSLinkedList** %3
store i8* %1, i8** %4
%5 = load %struct.DSLinkedList*, %struct.DSLinkedList** %3
%6 = load i8*, i8** %4
%7 = call i32 @ds_list_insert(%struct.DSLinkedList* %5, i32* null, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.DSLinkedList = type { i32 }
define void @ds_list_prepend(%struct.DSLinkedList* %0, i8* %1) {
%3 = tail call i32 @ds_list_insert(%struct.DSLinkedList* %0, i32* null, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double getPeriod() {
  double t;
  printf("Enter the period of the orbit in minutes: ");
  scanf("%lf", &t);
  return t;
}


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

x86 assembly (clang, -O2):
<getPeriod>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Enter the period of the orbit in minutes: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @getPeriod() {
%1 = alloca double
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@.str = [43 x i8] c"Enter the period of the orbit in minutes: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @getPeriod() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
ret double %5
}
extern int _getpid(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_getpid() {
ret i32 -1
}
void GUI_ViewInit() {}


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

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

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

LLVM IR (-O2):
define void @GUI_ViewInit() {
ret void
}
int cairo_code_draw_lushbg_get_height() { return 400; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushbg_get_height() {
ret i32 400
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushbg_get_height() {
ret i32 400
}
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
char *dirent_getname(struct dirent ***namelist, int ind) {
  return (*namelist)[ind]->d_name;
}


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

x86 assembly (clang, -O2):
<dirent_getname>:
mov    (%rdi),%rax
movslq %esi,%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i8* @dirent_getname(%struct.dirent*** %0, i32 %1) {
%3 = alloca %struct.dirent***
%4 = alloca i32
store %struct.dirent*** %0, %struct.dirent**** %3
store i32 %1, i32* %4
%5 = load %struct.dirent***, %struct.dirent**** %3
%6 = load %struct.dirent**, %struct.dirent*** %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.dirent*, %struct.dirent** %6, i64 %8
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i8*, i8** %11
ret i8* %12
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i8* @dirent_getname(%struct.dirent*** nocapture %0, i32 %1) {
%3 = load %struct.dirent**, %struct.dirent*** %0
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds %struct.dirent*, %struct.dirent** %3, i64 %4
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i8*, i8** %7
ret i8* %8
}
/* Variables and functions */
int fscanf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdin;
char *strdup(char *);
char *parse_word() {
  static char buff[100 + 1];
  if (fscanf(stdin,
             "%"
             "100"
             "s",
             buff) == 1)
    return strdup(buff);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<parse_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
lea    0x2f01(%rip),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    1162 <parse_word+0x42>
lea    0x2eec(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116a <parse_word+0x4a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_word>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0x2f08(%rip),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    114f <parse_word+0x2f>
lea    0x2ef7(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@parse_word.buff = internal global [101 x i8] zeroinitializer
@stdin = global i32 0
@.str = [6 x i8] c"%100s\00"
define i8* @parse_word() {
%1 = alloca i8*
%2 = load i32, i32* @stdin
%3 = call i32 @fscanf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([101 x i8], [101 x i8]* @parse_word.buff, i64 0, i64 0))
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i8* @strdup(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @parse_word.buff, i64 0, i64 0))
store i8* %6, i8** %1
br label %8
7: ; preds = %0
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@parse_word.buff = internal global [101 x i8] zeroinitializer
@stdin = global i32 0
@.str = [6 x i8] c"%100s\00"
define noalias i8* @parse_word() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fscanf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([101 x i8], [101 x i8]* @parse_word.buff, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i8* @strdup(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @parse_word.buff, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
%7 = phi i8* [ %5, %4 ], [ null, %0 ]
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int FOPEN_MAX;
int /*<<< orphan*/ errno;
FILE *fdopen(int fd, const char *mode) {
  if (fd < 0 || fd >= FOPEN_MAX) {
    errno = EINVAL;
    return NULL;
  }
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<fdopen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1127 <fdopen+0x27>
mov    -0xc(%rbp),%eax
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%eax
jl     1146 <fdopen+0x46>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1160 <fdopen+0x60>
mov    0x2e9b(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7a(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdopen>:
mov    0x2ed9(%rip),%rdx
mov    0x2eba(%rip),%rax
mov    %rax,%rcx
cmp    %edi,(%rdx)
jle    111c <fdopen+0x1c>
mov    0x2ecc(%rip),%rcx
test   %edi,%edi
cmovns %rcx,%rax
mov    (%rax),%eax
mov    0x2ea5(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@FOPEN_MAX = global i32 0
@EINVAL = global i32 0
@errno = global i32 0
@ENOSYS = global i32 0
define i32* @fdopen(i32 %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* @FOPEN_MAX
%11 = icmp sge i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8, %2
%13 = load i32, i32* @EINVAL
store i32 %13, i32* @errno
store i32* null, i32** %3
br label %16
14: ; preds = %8
%15 = load i32, i32* @ENOSYS
store i32 %15, i32* @errno
store i32* null, i32** %3
br label %16
16: ; preds = %14, %12
%17 = load i32*, i32** %3
ret i32* %17
}

LLVM IR (-O2):
@FOPEN_MAX = global i32 0
@EINVAL = global i32 0
@errno = global i32 0
@ENOSYS = global i32 0
define noalias i32* @fdopen(i32 %0, i8* nocapture readnone %1) {
%3 = icmp sgt i32 %0, -1
%4 = load i32, i32* @FOPEN_MAX
%5 = icmp sgt i32 %4, %0
%6 = select i1 %3, i1 %5, i1 false
%7 = load i32, i32* @ENOSYS
%8 = load i32, i32* @EINVAL
%9 = select i1 %6, i32 %7, i32 %8
store i32 %9, i32* @errno
ret i32* null
}
void gdk_device_set_axis_use() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_main_context_prepare() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int sysconf(int /*<<< orphan*/);
int getpagesize(void) { return sysconf(_SC_PAGESIZE); }


x86 assembly (clang, -O0):
<getpagesize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpagesize>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i32 @getpagesize() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i32 @getpagesize() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
void Ctypes_hook_wr_sgn_s8(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_dynamic_list()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int square(volatile int *ptr) {
  int a = *ptr;
  sleep(3);
  return a * a;
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1030 <sleep@plt>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rbx
mov    (%rdi),%ebx
mov    $0x3,%edi
call   1030 <sleep@plt>
imul   %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @square(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load volatile i32, i32* %4
store i32 %5, i32* %3
%6 = call i32 @sleep(i32 3)
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @square(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = tail call i32 @sleep(i32 3)
%4 = mul nsw i32 %2, %2
ret i32 %4
}
/* Variables and functions */
scalar_t__ byte_swap_u16(unsigned short);
short byte_swap_16(short x) { return (short)byte_swap_u16((unsigned short)x); }


x86 assembly (clang, -O0):
<byte_swap_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <byte_swap_u16@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_swap_16>:
push   %rax
movzwl %di,%edi
call   1030 <byte_swap_u16@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @byte_swap_16(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i64 @byte_swap_u16(i16 zeroext %3)
%5 = trunc i64 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @byte_swap_16(i16 signext %0) {
%2 = tail call i64 @byte_swap_u16(i16 zeroext %0)
%3 = trunc i64 %2 to i16
ret i16 %3
}
/* Variables and functions */
char *stpcpy(char *, char *);
char *store_array(char *restrict storage, char *array[]) {
  for (; *array; array++, storage++)
    storage = stpcpy(storage, *array);
  return storage;
}


x86 assembly (clang, -O0):
<store_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <store_array+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <stpcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <store_array+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_array>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    (%rsi),%rsi
test   %rsi,%rsi
je     1148 <store_array+0x38>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rdi
call   1030 <stpcpy@plt>
add    $0x1,%rax
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <store_array+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @store_array(i8* noalias %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %12, %5 ], [ %3, %2 ]
%7 = phi i8** [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = tail call i8* @stpcpy(i8* %8, i8* %6)
%10 = getelementptr inbounds i8*, i8** %7, i64 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i8* [ %0, %2 ], [ %11, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ hang();
int /*<<< orphan*/ uart_strln(char *);
void c_unused() {
  uart_strln("Exception: unused");
  hang();
}


x86 assembly (clang, -O0):
<c_unused>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <uart_strln@plt>
mov    $0x0,%al
call   1040 <hang@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_unused>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <uart_strln@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <hang@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Exception: unused\00"
define void @c_unused() {
%1 = call i32 @uart_strln(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @hang()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Exception: unused\00"
define void @c_unused() {
%1 = tail call i32 @uart_strln(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @hang()
ret void
}
void exchange(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


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

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

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

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ get_setting(char *, char *);
scalar_t__ strlen(char *);
float get_debian_version() {
  char str[512];
  str[0] = 0;
  get_setting("debian version", str);
  if (strlen(str) > 0) {
    return atof(str);
  }
  return 7;
}


x86 assembly (clang, -O0):
<get_debian_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movb   $0x0,-0x210(%rbp)
lea    -0x210(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1181 <get_debian_version+0x51>
lea    -0x210(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x4(%rbp)
jmp    118e <get_debian_version+0x5e>
movss  0xe77(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_debian_version>:
push   %rbx
sub    $0x200,%rsp
movb   $0x0,(%rsp)
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <get_setting@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    1165 <get_debian_version+0x35>
mov    %rsp,%rdi
call   1030 <atof@plt>
jmp    116d <get_debian_version+0x3d>
movss  0xe93(%rip),%xmm0
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"debian version\00"
define float @get_debian_version() {
%1 = alloca float
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%5 = call i32 @get_setting(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%7 = call i64 @strlen(i8* %6)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%11 = call float @atof(i8* %10)
store float %11, float* %1
br label %13
12: ; preds = %0
store float 7.000000e+00, float* %1
br label %13
13: ; preds = %12, %9
%14 = load float, float* %1
ret float %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"debian version\00"
define float @get_debian_version() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @get_setting(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @strlen(i8* %2)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call float @atof(i8* %2)
br label %8
8: ; preds = %0, %6
%9 = phi float [ %7, %6 ], [ 7.000000e+00, %0 ]
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int display(void *index, unsigned char *pattern, unsigned long length,
            unsigned long numc, unsigned long *numocc,
            unsigned char **snippet_text, unsigned long **snippet_lengths) {
  return -1;
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @display(i8* %0, i8* %1, i64 %2, i64 %3, i64* %4, i8** %5, i64** %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64*
%13 = alloca i8**
%14 = alloca i64**
store i8* %0, i8** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64* %4, i64** %12
store i8** %5, i8*** %13
store i64** %6, i64*** %14
ret i32 -1
}

LLVM IR (-O2):
define i32 @display(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i64 %3, i64* nocapture readnone %4, i8** nocapture readnone %5, i64** nocapture readnone %6) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ wmbusParser(char *, int);
void vifCode(void) {
  wmbusParser("\x01\x03\x01", sizeof("\x01\x03\x01") - 1);
  wmbusParser("\x01\x78\x01", sizeof("\x01\x78\x01") - 1);
  wmbusParser("\x01\xFD\x08\x01", sizeof("\x01\xFD\x08\x01") - 1);
  wmbusParser("\x01\xFB\x30\x01", sizeof("\x01\xFB\x30\x01") - 1);
}


x86 assembly (clang, -O0):
<vifCode>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3,%esi
call   1030 <wmbusParser@plt>
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
call   1030 <wmbusParser@plt>
lea    0xecb(%rip),%rdi
mov    $0x4,%esi
call   1030 <wmbusParser@plt>
lea    0xebf(%rip),%rdi
mov    $0x4,%esi
call   1030 <wmbusParser@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vifCode>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <wmbusParser@plt>
lea    0xedb(%rip),%rdi
mov    $0x3,%esi
call   1030 <wmbusParser@plt>
lea    0xece(%rip),%rdi
mov    $0x4,%esi
call   1030 <wmbusParser@plt>
lea    0xec2(%rip),%rdi
mov    $0x4,%esi
pop    %rax
jmp    1030 <wmbusParser@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\01\03\01\00"
@.str.1 = [4 x i8] c"\01x\01\00"
@.str.2 = [5 x i8] c"\01\FD\08\01\00"
@.str.3 = [5 x i8] c"\01\FB0\01\00"
define void @vifCode() {
%1 = call i32 @wmbusParser(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = call i32 @wmbusParser(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%3 = call i32 @wmbusParser(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = call i32 @wmbusParser(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\01\03\01\00"
@.str.1 = [4 x i8] c"\01x\01\00"
@.str.2 = [5 x i8] c"\01\FD\08\01\00"
@.str.3 = [5 x i8] c"\01\FB0\01\00"
define void @vifCode() {
%1 = tail call i32 @wmbusParser(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @wmbusParser(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%3 = tail call i32 @wmbusParser(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @wmbusParser(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret void
}