xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/paulcdejean/AeonTick/refs/heads/master/"
             "libtermkey-0.17/.libs/lt-demo.c",
             311, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x137,%esi
lea    0xf4a(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf65(%rip),%rdx
mov    $0x137,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/paulcdejean/AeonTick/refs/heads/master/libtermkey-0.17/.libs/lt-demo.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/paulcdejean/AeonTick/refs/heads/master/libtermkey-0.17/.libs/lt-demo.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", add(123, 456));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 123, i32 456)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int _NSIG;
int __rt_sigprocmask(int, int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                     int);
int sigprocmask(int how, const sigset_t *set, sigset_t *oldset) {
  return __rt_sigprocmask(how, set, oldset, _NSIG / 8);
}


x86 assembly (clang, -O0):
<sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1030 <__rt_sigprocmask@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigprocmask>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x3,%ecx
jmp    1030 <__rt_sigprocmask@plt>

LLVM IR (-O0):
@_NSIG = global i32 0
define i32 @sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* @_NSIG
%11 = sdiv i32 %10, 8
%12 = call i32 @__rt_sigprocmask(i32 %7, i32* %8, i32* %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@_NSIG = global i32 0
define i32 @sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = load i32, i32* @_NSIG
%5 = sdiv i32 %4, 8
%6 = tail call i32 @__rt_sigprocmask(i32 %0, i32* %1, i32* %2, i32 %5)
ret i32 %6
}
int main() {
  int i;
  int j = 0;
  for (i = 0; i < 5; i = i + 1) {
    j = j + 2;
  }
  return j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    113a <main+0x3a>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
int BitwiseAdd(int a, int b) {
  int c, d;
  do {
    c = a & b;
    c = c << 1;
    d = a ^ b;
    a = d;
    b = c;
  } while (a & b);
  return (a | b);
}


x86 assembly (clang, -O0):
<BitwiseAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    110a <BitwiseAdd+0xa>
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitwiseAdd>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %edi,%eax
and    %ecx,%eax
add    %eax,%eax
xor    %ecx,%edi
test   %edi,%eax
jne    1110 <BitwiseAdd+0x10>
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @BitwiseAdd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = and i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = shl i32 %11, 1
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = xor i32 %13, %14
store i32 %15, i32* %6
%16 = load i32, i32* %6
store i32 %16, i32* %3
%17 = load i32, i32* %5
store i32 %17, i32* %4
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = and i32 %19, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %7, label %23
23: ; preds = %18
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = or i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @BitwiseAdd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %7, %3 ]
%5 = phi i32 [ %0, %2 ], [ %8, %3 ]
%6 = and i32 %5, %4
%7 = shl i32 %6, 1
%8 = xor i32 %5, %4
%9 = and i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = or i32 %7, %8
ret i32 %12
}
/* Variables and functions */
double round_double(double);
double round_float(double d) { return round_double(d); }


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

x86 assembly (clang, -O2):
<round_float>:
jmp    1030 <round_double@plt>

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

LLVM IR (-O2):
define double @round_float(double %0) {
%2 = tail call double @round_double(double %0)
ret double %2
}
void do_stat(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}


x86 assembly (clang, -O0):
<do_stat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_stat(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
ret void
}

LLVM IR (-O2):
define void @do_stat(i32 %0, i8** nocapture %1, i32 %2) {
ret void
}
int customTarget() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @customTarget() {
ret i32 0
}
int output_cmd(int plugin, unsigned int control_id, unsigned int group,
               int value) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @output_cmd(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
int fun878() { return 878; }


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

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

LLVM IR (-O0):
define i32 @fun878() {
ret i32 878
}

LLVM IR (-O2):
define i32 @fun878() {
ret i32 878
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int baz(void) {
  foo();
  return 6;
}


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

x86 assembly (clang, -O2):
<baz>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
mov    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @baz() {
%1 = call i32 (...) @foo()
ret i32 6
}

LLVM IR (-O2):
define i32 @baz() {
%1 = tail call i32 (...) @foo()
ret i32 6
}
/* Variables and functions */
size_t lookup_auto_expand_threshold(void *context, size_t capacity) {
  return (2 * ((capacity) / 3));
}


x86 assembly (clang, -O0):
<lookup_auto_expand_threshold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_auto_expand_threshold>:
mov    %rsi,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rax
and    $0xfffffffffffffffe,%rax
ret

LLVM IR (-O0):
define i64 @lookup_auto_expand_threshold(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = udiv i64 %5, 3
%7 = mul i64 2, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @lookup_auto_expand_threshold(i8* nocapture readnone %0, i64 %1) {
%3 = udiv i64 %1, 3
%4 = shl nuw i64 %3, 1
ret i64 %4
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int setreuid(int, scalar_t__);
int seteuid(uid_t uid) {
  int result;
  if (uid == (uid_t)~0) {
    __set_errno(EINVAL);
    return -1;
  }
  result = setreuid(-1, uid);
  return result;
}


x86 assembly (clang, -O0):
<seteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1151 <seteuid+0x31>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <seteuid+0x48>
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edi
call   1040 <setreuid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seteuid>:
cmp    $0xffffffffffffffff,%rdi
je     1133 <seteuid+0x13>
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1040 <setreuid@plt>
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @seteuid(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EINVAL
%9 = call i32 @__set_errno(i32 %8)
store i32 -1, i32* %2
br label %14
10: ; preds = %1
%11 = load i64, i64* %3
%12 = call i32 @setreuid(i32 -1, i64 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @seteuid(i64 %0) {
%2 = icmp eq i64 %0, -1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EINVAL
%5 = tail call i32 @__set_errno(i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 @setreuid(i32 -1, i64 %0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ -1, %3 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puthex_b(int);
void puthex(int c) {
  puthex_b((c >> 8) & 0xFFU);
  puthex_b(c & 0xFFU);
}


x86 assembly (clang, -O0):
<puthex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <puthex_b@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <puthex_b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthex>:
push   %rbx
mov    %edi,%ebx
movzbl %bh,%edi
call   1030 <puthex_b@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <puthex_b@plt>

LLVM IR (-O0):
define void @puthex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = call i32 @puthex_b(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = call i32 @puthex_b(i32 %8)
ret void
}

LLVM IR (-O2):
define void @puthex(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
%4 = tail call i32 @puthex_b(i32 %3)
%5 = and i32 %0, 255
%6 = tail call i32 @puthex_b(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void err_print(char *info) {
  printf(" \033[0;31m "
         "%s"
         " \033[0m\n",
         info);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c" \1B[0;31m %s \1B[0m\0A\00"
define void @err_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(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" \1B[0;31m %s \1B[0m\0A\00"
define void @err_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0Toggle();
void TelosbSensorReadingC__Leds__led0Toggle(void) { LedsP__Leds__led0Toggle(); }


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

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

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

LLVM IR (-O2):
define void @TelosbSensorReadingC__Leds__led0Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led0Toggle()
ret void
}
/* Variables and functions */
size_t round_up_pow2(size_t a, size_t b) { return ((a + b - 1) & (~(b - 1))); }


x86 assembly (clang, -O0):
<round_up_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up_pow2>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @round_up_pow2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @round_up_pow2(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
int test_imm_DCint32_mem(int *val) {
  return ((*val) & (0xDC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DCint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xdc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DCint32_mem>:
testb  $0xdc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DCint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 220
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int protected_memcpy(void *to, void *from, int sz, int maxsz) {
  if (sz > maxsz)
    sz = maxsz;
  memcpy(to, from, sz);
  return sz;
}


x86 assembly (clang, -O0):
<protected_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1138 <protected_memcpy+0x28>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protected_memcpy>:
push   %rbx
mov    %edx,%ebx
cmp    %ecx,%edx
cmovg  %ecx,%ebx
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @protected_memcpy(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %3
%6 = select i1 %5, i32 %3, i32 %2
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %6)
ret i32 %6
}
void _papi_hwd_lock_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_papi_hwd_lock_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seteuid(int);
int /*<<< orphan*/ setuid(int);
int setresuid(int ruid, int euid, int suid) {
  if (ruid != -1)
    setuid(ruid);
  if (euid != -1)
    seteuid(euid);
  return 0;
}


x86 assembly (clang, -O0):
<setresuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1143 <setresuid+0x23>
mov    -0x4(%rbp),%edi
call   1030 <setuid@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1155 <setresuid+0x35>
mov    -0x8(%rbp),%edi
call   1040 <seteuid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setresuid>:
push   %rbx
mov    %esi,%ebx
cmp    $0xffffffff,%edi
je     112d <setresuid+0xd>
call   1030 <setuid@plt>
cmp    $0xffffffff,%ebx
je     1139 <setresuid+0x19>
mov    %ebx,%edi
call   1040 <seteuid@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @setresuid(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, -1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @setuid(i32 %0)
br label %7
7: ; preds = %5, %3
%8 = icmp eq i32 %1, -1
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @seteuid(i32 %1)
br label %11
11: ; preds = %9, %7
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(char const, int /*<<< orphan*/ *const);
void pm_writechar(FILE *const ofP, char const c) { putc(c, ofP); }


x86 assembly (clang, -O0):
<pm_writechar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_writechar>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @pm_writechar(i32* nocapture %0, i8 signext %1) {
%3 = tail call i32 @putc(i8 signext %1, i32* %0)
ret void
}
/* Variables and functions */
float mp_bswap_float(float);
char *mp_store_float(char *data, float val) {
  *(float *)(data) = mp_bswap_float(val);
  return data + sizeof(float);
}


x86 assembly (clang, -O0):
<mp_store_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <mp_bswap_float@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_store_float>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mp_bswap_float@plt>
movss  %xmm0,(%rbx)
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mp_store_float(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @mp_bswap_float(float %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
store float %6, float* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 4
ret i8* %10
}

LLVM IR (-O2):
define i8* @mp_store_float(i8* writeonly %0, float %1) {
%3 = tail call float @mp_bswap_float(float %1)
%4 = bitcast i8* %0 to float*
store float %3, float* %4
%5 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Kullanim: %s <deger>", argv[0]);
  } else {
    printf("yanlis deger girdiniz");
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jge    114a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1158 <main+0x48>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1129 <main+0x19>
mov    (%rsi),%rsi
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1137 <main+0x27>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Kullanim: %s <deger>\00"
@.str.1 = [22 x i8] c"yanlis deger girdiniz\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Kullanim: %s <deger>\00"
@.str.1 = [22 x i8] c"yanlis deger girdiniz\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i32 0
}
int getopt_r(argc, argv, optstring, opt)
int argc;
char *const *argv;
const char *optstring;
struct opt_r *opt;
{
  return _getopt_r_internal(argc, argv, optstring, (const struct option *)0,
                            (int *)0, 0, opt);
}


x86 assembly (clang, -O0):
<getopt_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <_getopt_r_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_r>:
push   %rax
mov    %rcx,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1030 <_getopt_r_internal@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.opt_r = type opaque
%struct.option = type opaque
define i32 @getopt_r(i32 %0, i8** %1, i8* %2, %struct.opt_r* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca %struct.opt_r*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store %struct.opt_r* %3, %struct.opt_r** %8
%9 = load i32, i32* %5
%10 = load i8**, i8*** %6
%11 = load i8*, i8** %7
%12 = load %struct.opt_r*, %struct.opt_r** %8
%13 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...) bitcast (i32 (...)* @_getopt_r_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...)*)(i32 %9, i8** %10, i8* %11, %struct.option* null, i32* null, i32 0, %struct.opt_r* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.opt_r = type opaque
%struct.option = type opaque
define i32 @getopt_r(i32 %0, i8** %1, i8* %2, %struct.opt_r* %3) {
%5 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...) bitcast (i32 (...)* @_getopt_r_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0, %struct.opt_r* %3)
ret i32 %5
}
int dont_capture_me(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dont_capture_me() {
ret i32 0
}
/* Type definitions */
struct fdi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ track_pc(struct fdi *, int);
void track_pc_8(struct fdi *fdi) { track_pc(fdi, 8); }


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

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

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

LLVM IR (-O2):
%struct.fdi = type { i32 }
define void @track_pc_8(%struct.fdi* %0) {
%2 = tail call i32 @track_pc(%struct.fdi* %0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void mutilsSafeStrcpy(char *dst, char *src, int n) {
  (void)strncpy(dst, src, n);
  dst[n] = '\0';
}


x86 assembly (clang, -O0):
<mutilsSafeStrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutilsSafeStrcpy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @mutilsSafeStrcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
/* Variables and functions */
unsigned strlen(char *str) {
  char *s = str;
  while (*s)
    s++;
  return s - str;
}


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

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int fn1(signed int x, signed int y) {
  signed int tem1 = x & y;
  signed int tem2 = x | y;
  return tem1 ^ tem2;
}


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

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

LLVM IR (-O0):
define i32 @fn1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *strchr(const char *s, char c) {
  for (; *s; s++)
    if (*s == c)
      return (char *)s;
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <strchr+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    113b <strchr+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <strchr+0x59>
jmp    1140 <strchr+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <strchr+0x21>
mov    %rdi,%rax
nopl   0x0(%rax)
cmp    %sil,%cl
je     1123 <strchr+0x23>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ null, %2 ], [ null, %9 ], [ %7, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ cpuInit();
int /*<<< orphan*/ gpioInit();
int /*<<< orphan*/ gpioSetDir(int, int, int);
int /*<<< orphan*/ gpioSetValue(int, int, int);
int /*<<< orphan*/ pmuInit();
int /*<<< orphan*/ systickInit(int);
void systemInit() {
  cpuInit();
  systickInit((1));
  gpioInit();
  pmuInit();
  gpioSetDir((2), (10), 1);
  gpioSetValue((2), (10), (1));
}


x86 assembly (clang, -O0):
<systemInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <cpuInit@plt>
mov    $0x1,%edi
call   1030 <systickInit@plt>
mov    $0x0,%al
call   1040 <gpioInit@plt>
mov    $0x0,%al
call   1060 <pmuInit@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1070 <gpioSetDir@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1050 <gpioSetValue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<systemInit>:
push   %rax
xor    %eax,%eax
call   1080 <cpuInit@plt>
mov    $0x1,%edi
call   1030 <systickInit@plt>
xor    %eax,%eax
call   1040 <gpioInit@plt>
xor    %eax,%eax
call   1060 <pmuInit@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1070 <gpioSetDir@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x1,%edx
pop    %rax
jmp    1050 <gpioSetValue@plt>

LLVM IR (-O0):
define void @systemInit() {
%1 = call i32 (...) @cpuInit()
%2 = call i32 @systickInit(i32 1)
%3 = call i32 (...) @gpioInit()
%4 = call i32 (...) @pmuInit()
%5 = call i32 @gpioSetDir(i32 2, i32 10, i32 1)
%6 = call i32 @gpioSetValue(i32 2, i32 10, i32 1)
ret void
}

LLVM IR (-O2):
define void @systemInit() {
%1 = tail call i32 (...) @cpuInit()
%2 = tail call i32 @systickInit(i32 1)
%3 = tail call i32 (...) @gpioInit()
%4 = tail call i32 (...) @pmuInit()
%5 = tail call i32 @gpioSetDir(i32 2, i32 10, i32 1)
%6 = tail call i32 @gpioSetValue(i32 2, i32 10, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void free_int16_t(int16_t _val) { return; }


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

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

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

LLVM IR (-O2):
define void @free_int16_t(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ game_run();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  setlocale(LC_ALL, "Portuguese");
  system("color f0");
  game_run();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xebb(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <game_run@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xebe(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1050 <game_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [9 x i8] c"color f0\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @game_run()
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [9 x i8] c"color f0\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @game_run()
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  int *pI;
  pI = (int *)malloc(sizeof(int));
  printf("Let's leak a pointer to int\n");
  *pI = 303;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
movl   $0x12f,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [29 x i8] c"Let's leak a pointer to int\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
store i32 303, i32* %7
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
@str.2 = [28 x i8] c"Let's leak a pointer to int\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
store i32 303, i32* %3
ret i32 0
}
int Kit_DsdLit2Var(int Lit) { return Lit >> 1; }


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

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

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

LLVM IR (-O2):
define i32 @Kit_DsdLit2Var(i32 %0) {
%2 = ashr i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printStack();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basPrintStack() {
  printStack();
  pushNumber(0);
}


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

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

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

LLVM IR (-O2):
define void @basPrintStack() {
%1 = tail call i32 (...) @printStack()
%2 = tail call i32 @pushNumber(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void copyfile(FILE *fromfp, FILE *tofp) {
  int c;
  while ((c = getc(fromfp)) != EOF)
    putc(c, tofp);
}


x86 assembly (clang, -O0):
<copyfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     115c <copyfile+0x3c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
jmp    1130 <copyfile+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyfile>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%eax
je     1157 <copyfile+0x37>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1140 <copyfile+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @copyfile(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = call i32 @putc(i32 %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @copyfile(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putc(i32 %7, i32* %1)
%9 = tail call i32 @getc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x75() {
  Assert_real((islower(117)),
              "/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_islower.c",
              590, ("islower should be 1 for u"));
}


x86 assembly (clang, -O0):
<t_islower_0x75>:
push   %rbp
mov    %rsp,%rbp
mov    $0x75,%edi
call   1030 <islower@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x24e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x75>:
push   %rax
mov    $0x75,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x24e,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for u\00"
define void @t_islower_0x75() {
%1 = call i32 @islower(i32 117)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 590, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for u\00"
define void @t_islower_0x75() {
%1 = tail call i32 @islower(i32 117)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 590, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}