xunge/DecIR huggingface dataset:
int malloc_set_state(void *ptr) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @malloc_set_state(i8* nocapture readnone %0) {
ret i32 -1
}
float return3() { return 3.0; }


x86 assembly (clang, -O0):
<return3>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<return3>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @return3() {
ret float 3.000000e+00
}

LLVM IR (-O2):
define float @return3() {
ret float 3.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ clobber();
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int *p = (int *)malloc(sizeof(*p));
  printf("printf result: %p\n", p);
  clobber();
  *p = 9;
  printf("worked ok!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <clobber@plt>
movl   $0x9,(%rbx)
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"printf result: %p\0A\00"
@.str.1 = [12 x i8] c"worked ok!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = call i32 (...) @clobber()
%8 = load i32*, i32** %2
store i32 9, i32* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"printf result: %p\0A\00"
@str = [11 x i8] c"worked ok!\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = tail call i32 (...) @clobber()
store i32 9, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch;
  scanf("%c", &ch);
  printf("%d", ch);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xf9() {
  Assert_real((isalpha(249) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1250, ("isalpha should be 0 for 0xf9"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf9\00"
define void @t_isalpha_0xf9() {
%1 = tail call i64 @isalpha(i32 249)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1250, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void fail() {
  printf("Test: FAILED\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Test: FAILED\0A\00"
define void @fail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"Test: FAILED\00"
define void @fail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
int test_imm_7Euint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x7E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Euint64_lowword_reg>:
test   $0x7e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Euint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 126
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dioSend(int, int, int, int);
int dioOff(int pin, int sender, int interruptor) {
  dioSend(pin, sender, interruptor, (!(1 == 1)));
}


x86 assembly (clang, -O0):
<dioOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
call   1030 <dioSend@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dioOff>:
xor    %ecx,%ecx
jmp    1030 <dioSend@plt>

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

LLVM IR (-O2):
define i32 @dioOff(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @dioSend(i32 %0, i32 %1, i32 %2, i32 0)
ret i32 undef
}
void halt_process() {}


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

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

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

LLVM IR (-O2):
define void @halt_process() {
ret void
}
int do_727() { return 727; }


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

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

LLVM IR (-O0):
define i32 @do_727() {
ret i32 727
}

LLVM IR (-O2):
define i32 @do_727() {
ret i32 727
}
/* Variables and functions */
int /*<<< orphan*/ vectorMultiply(float *, float *, int);
void vectorInverse(float *vxptr, float *vyptr) {
  vectorMultiply(vxptr, vyptr, -1);
}


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

x86 assembly (clang, -O2):
<vectorInverse>:
mov    $0xffffffff,%edx
jmp    1030 <vectorMultiply@plt>

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

LLVM IR (-O2):
define void @vectorInverse(float* %0, float* %1) {
%3 = tail call i32 @vectorMultiply(float* %0, float* %1, i32 -1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
void _longjmp_unwind(jmp_buf env, int val) {}


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

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

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

LLVM IR (-O2):
define void @_longjmp_unwind(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int jjb1() {
  int x, y;
  x++;
  if (x / 2) {
  L0:
    if (x <= 0)
      goto L3;
    x--;
    print_int(x);
    goto L1;
  } else {
  L1:
    y++;
    print_int(y);
    goto L0;
  }
L3:
  return 0;
}


x86 assembly (clang, -O0):
<jjb1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     115f <jjb1+0x4f>
jmp    113a <jjb1+0x2a>
cmpl   $0x0,-0x4(%rbp)
jg     1149 <jjb1+0x39>
jmp    117a <jjb1+0x6a>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <print_int@plt>
jmp    1164 <jjb1+0x54>
jmp    1164 <jjb1+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <print_int@plt>
jmp    113a <jjb1+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jjb1>:
push   %rbp
push   %rbx
push   %rax
call   1030 <print_int@plt>
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%edi
call   1030 <print_int@plt>
mov    %ebp,%edi
call   1030 <print_int@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <jjb1+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @jjb1() {
%1 = tail call i32 @print_int(i32 undef)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ undef, %0 ], [ %7, %2 ]
%4 = phi i32 [ undef, %0 ], [ %5, %2 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @print_int(i32 %5)
%7 = add nsw i32 %3, 1
%8 = tail call i32 @print_int(i32 %7)
%9 = icmp ult i32 %4, 2
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 0
}
int sl_default_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sl_default_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strndup_real(const char *s, size_t n) {
  char *r;
  if (s == 0)
    return 0;
  r = malloc(n + 1);
  assert(r);
  strncpy(r, s, n);
  r[n] = 0;
  return r;
}


x86 assembly (clang, -O0):
<strndup_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <strndup_real+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1197 <strndup_real+0x67>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup_real>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1169 <strndup_real+0x39>
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r14,1)
jmp    116b <strndup_real+0x3b>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup_real(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add i64 %1, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @assert(i8* %6)
%8 = tail call i32 @strncpy(i8* %6, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %6, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %2, %4
%11 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcmp(int /*<<< orphan*/ const *,
                          int /*<<< orphan*/ const *, int);
bool eth_addr_equals(const uint8_t a[6], const uint8_t b[6]) {
  return !memcmp(a, b, 6);
}


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

x86 assembly (clang, -O2):
<eth_addr_equals>:
push   %rax
mov    $0x6,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @eth_addr_equals(i32* %0, i32* %1) {
%3 = tail call i32 @memcmp(i32* %0, i32* %1, i32 6)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void therm_lvt_init(void) {}


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

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

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

LLVM IR (-O2):
define void @therm_lvt_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __stdio_rewind(int /*<<< orphan*/ *);
void rewind(FILE *stream) { __stdio_rewind(stream); }


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

x86 assembly (clang, -O2):
<rewind>:
jmp    1030 <__stdio_rewind@plt>

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

LLVM IR (-O2):
define void @rewind(i32* %0) {
%2 = tail call i32 @__stdio_rewind(i32* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int /*<<< orphan*/ spi_transfer(int *, int);
void write_fsr(uint8_t value) {
  uint8_t cmd[2];
  cmd[0] = 0x01;
  cmd[1] = value;
  spi_transfer(cmd, sizeof(cmd));
}


x86 assembly (clang, -O0):
<write_fsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1030 <spi_transfer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_fsr>:
push   %rax
movl   $0x1,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <spi_transfer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_fsr(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 1, i32* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %5, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%8 = call i32 @spi_transfer(i32* %7, i32 8)
ret void
}

LLVM IR (-O2):
define void @write_fsr(i32 %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 1, i32* %4
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 %0, i32* %5
%6 = call i32 @spi_transfer(i32* %4, i32 8)
ret void
}
void main(void) {
  int x;
  int y;
  int m;
  m = x = y;
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dw_printf(char *);
void morse_quiet(int tu) {
  int n;
  for (n = 0; n < tu; n++) {
    dw_printf(".");
  }
}


x86 assembly (clang, -O0):
<morse_quiet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <morse_quiet+0x38>
lea    0xecb(%rip),%rdi
call   1030 <dw_printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <morse_quiet+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morse_quiet>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <morse_quiet+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <dw_printf@plt>
add    $0xffffffff,%ebx
jne    1130 <morse_quiet+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define void @morse_quiet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @dw_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @morse_quiet(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @dw_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
void block_SIGUSR1(sigset_t *sigs, sigset_t *old_sigs) {
  if (sigprocmask(SIG_BLOCK, sigs, old_sigs) != 0) {
    perror("sigprocmask create block\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<block_SIGUSR1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
je     1176 <block_SIGUSR1+0x46>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_SIGUSR1>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <sigprocmask@plt>
test   %rax,%rax
jne    114c <block_SIGUSR1+0x1c>
pop    %rax
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@.str = [26 x i8] c"sigprocmask create block\0A\00"
define void @block_SIGUSR1(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @SIG_BLOCK
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i64 @sigprocmask(i32 %5, i32* %6, i32* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@.str = [26 x i8] c"sigprocmask create block\0A\00"
define void @block_SIGUSR1(i32* %0, i32* %1) {
%3 = load i32, i32* @SIG_BLOCK
%4 = tail call i64 @sigprocmask(i32 %3, i32* %0, i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
unsigned xrop3_201_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


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

x86 assembly (clang, -O2):
<xrop3_201_1_0>:
or     %edi,%esi
not    %esi
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_201_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = or i8 %1, %0
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
int /*<<< orphan*/ *strptr_stack_push(void *);
void *strmalloc(size_t size) {
  void *new_str;
  new_str = malloc(size);
  if (new_str == NULL)
    return NULL;
  if (strptr_stack_push(new_str) == NULL) {
    free(new_str);
    return NULL;
  }
  return new_str;
}


x86 assembly (clang, -O0):
<strmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <strmalloc+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1192 <strmalloc+0x62>
mov    -0x18(%rbp),%rdi
call   1040 <strptr_stack_push@plt>
cmp    $0x0,%rax
jne    118a <strmalloc+0x5a>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1192 <strmalloc+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmalloc>:
push   %rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1153 <strmalloc+0x23>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strptr_stack_push@plt>
test   %rax,%rax
jne    1155 <strmalloc+0x25>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32* @strptr_stack_push(i8* %2)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @free(i8* %2)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i8* [ null, %7 ], [ null, %1 ], [ %2, %4 ]
ret i8* %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xcreatewindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcreatewindow_type(void *_p) {
  return (int)((XEvent *)_p)->xcreatewindow.type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xcreatewindow_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xcreatewindow_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int _rl_input_queued(t)
int t;
{
  int old_timeout, r;
  old_timeout = rl_set_keyboard_input_timeout(t);
  r = _rl_input_available();
  rl_set_keyboard_input_timeout(old_timeout);
  return r;
}


x86 assembly (clang, -O0):
<_rl_input_queued>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <rl_set_keyboard_input_timeout@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_rl_input_available@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <rl_set_keyboard_input_timeout@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rl_input_queued>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <rl_set_keyboard_input_timeout@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <_rl_input_available@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <rl_set_keyboard_input_timeout@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_rl_input_queued(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @rl_set_keyboard_input_timeout to i32 (i32, ...)*)(i32 %5)
store i32 %6, i32* %3
%7 = call i32 (...) @_rl_input_available()
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = call i32 (i32, ...) bitcast (i32 (...)* @rl_set_keyboard_input_timeout to i32 (i32, ...)*)(i32 %8)
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @_rl_input_queued(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @rl_set_keyboard_input_timeout to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (...) @_rl_input_available()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @rl_set_keyboard_input_timeout to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lib_strcpy(char *, char *);
void lib_trimleading(char *path) {
  if (*path == '/') {
    lib_strcpy(path, path + 1);
  }
  return;
}


x86 assembly (clang, -O0):
<lib_trimleading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113d <lib_trimleading+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
call   1030 <lib_strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_trimleading>:
cmpb   $0x2f,(%rdi)
jne    111e <lib_trimleading+0xe>
lea    0x1(%rdi),%rsi
jmp    1030 <lib_strcpy@plt>
ret

LLVM IR (-O0):
define void @lib_trimleading(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 47
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @lib_strcpy(i8* %8, i8* %10)
br label %12
12: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @lib_trimleading(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @lib_strcpy(i8* %0, i8* %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void go_down(int n) { printf("%c[%dB", 0x1B, n); }


x86 assembly (clang, -O0):
<go_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_down>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dB\00"
define void @go_down(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _notif_free_error_message();
void notif_free_error_message(void) { _notif_free_error_message(); }


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

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

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

LLVM IR (-O2):
define void @notif_free_error_message() {
%1 = tail call i32 (...) @_notif_free_error_message()
ret void
}
unsigned int matchtail(char *p, char *s, struct data *d, unsigned int o) {
  if (*p != '\0')
    return 2;
  return !(o && (*s == '\0'));
}


x86 assembly (clang, -O0):
<matchtail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112f <matchtail+0x2f>
movl   $0x2,-0x4(%rbp)
jmp    115b <matchtail+0x5b>
xor    %eax,%eax
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x25(%rbp)
je     114e <matchtail+0x4e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchtail>:
mov    $0x2,%eax
cmpb   $0x0,(%rdi)
je     110b <matchtail+0xb>
ret
test   %ecx,%ecx
je     1118 <matchtail+0x18>
xor    %eax,%eax
cmpb   $0x0,(%rsi)
setne  %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.data = type opaque
define i32 @matchtail(i8* %0, i8* %1, %struct.data* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.data*
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store %struct.data* %2, %struct.data** %8
store i32 %3, i32* %9
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 2, i32* %5
br label %27
15: ; preds = %4
%16 = load i32, i32* %9
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i8*, i8** %7
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br label %23
23: ; preds = %18, %15
%24 = phi i1 [ false, %15 ], [ %22, %18 ]
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
store i32 %26, i32* %5
br label %27
27: ; preds = %23, %14
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
%struct.data = type opaque
define i32 @matchtail(i8* nocapture %0, i8* nocapture %1, %struct.data* nocapture readnone %2, i32 %3) {
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = icmp eq i32 %3, 0
br i1 %8, label %13, label %9
9: ; preds = %7
%10 = load i8, i8* %1
%11 = icmp ne i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %9, %4
%14 = phi i32 [ 2, %4 ], [ 1, %7 ], [ %12, %9 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void main() {
  char data[2][3][2] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
  printf("%o\n", data[0][2][1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    0xed9(%rip),%rdi
movsbl -0x7(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.data = [2 x [3 x [2 x i8]]] [[3 x [2 x i8]] [[2 x i8] c"\00\01", [2 x i8] c"\02\03", [2 x i8] c"\04\05"], [3 x [2 x i8]] [[2 x i8] c"\06\07", [2 x i8] c"\08\09", [2 x i8] c"\0A\0B"]]
@.str = [4 x i8] c"%o\0A\00"
define void @main() {
%1 = alloca [2 x [3 x [2 x i8]]]
%2 = bitcast [2 x [3 x [2 x i8]]]* %1 to i8*
%3 = getelementptr inbounds [2 x [3 x [2 x i8]]], [2 x [3 x [2 x i8]]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* %3, i64 0, i64 2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%6 = load i8, i8* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%o\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 5)
ret void
}
int coordToIndex(int x, int y) { return 70 * y + x; }


x86 assembly (clang, -O0):
<coordToIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x46,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coordToIndex>:
imul   $0x46,%esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @coordToIndex(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 = mul nsw i32 70, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @coordToIndex(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 70
%4 = add nsw i32 %3, %0
ret i32 %4
}
int vis_f1(int k) {
  int vis_comm(int j);
  return vis_comm(k) / 2;
}


x86 assembly (clang, -O0):
<vis_f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <vis_comm@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vis_f1>:
push   %rax
call   1030 <vis_comm@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vis_f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @vis_comm(i32 %3)
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @vis_f1(i32 %0) {
%2 = tail call i32 @vis_comm(i32 %0)
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
swap() { ol("TTTTTxchgl %eax, %edx"); }


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
lea    0xee9(%rip),%rdi
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"TTTTTxchgl %eax, %edx\00"
define i32 @swap() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [22 x i8] c"TTTTTxchgl %eax, %edx\00"
define i32 @swap() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
XRaiseWindow() {}


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

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

LLVM IR (-O0):
define i32 @XRaiseWindow() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XRaiseWindow() {
ret i32 undef
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned INT_restore(unsigned old_cpsr) {
  unsigned _cpsr_val;
  _cpsr_val = __get_cpsr();
  __set_cpsr((_cpsr_val & ~(0x00000080 | 0x00000040)) |
             (old_cpsr & (0x00000080 | 0x00000040)));
  return _cpsr_val;
}


x86 assembly (clang, -O0):
<INT_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xffffff3f,%edi
mov    -0x4(%rbp),%eax
and    $0xc0,%eax
or     %eax,%edi
call   1030 <__set_cpsr@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_restore>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebp
and    $0xffffff3f,%eax
and    $0xc0,%ebx
or     %eax,%ebx
mov    %ebx,%edi
call   1030 <__set_cpsr@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @INT_restore(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @__get_cpsr()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -193
%7 = load i32, i32* %2
%8 = and i32 %7, 192
%9 = or i32 %6, %8
%10 = call i32 @__set_cpsr(i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @INT_restore(i32 %0) {
%2 = tail call i32 (...) @__get_cpsr()
%3 = and i32 %2, -193
%4 = and i32 %0, 192
%5 = or i32 %3, %4
%6 = tail call i32 @__set_cpsr(i32 %5)
ret i32 %2
}
void test_buffer() {}


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

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

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

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


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffb,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 -5)
ret i32 0
}
main() {
  ({ (void)0; });
  ({ return 5; });
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Type definitions */
struct rlimit {
  int /*<<< orphan*/ rlim_max;
  int /*<<< orphan*/ rlim_cur;
};
typedef int /*<<< orphan*/ rlim_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ setrlimit(int, struct rlimit *);
void set_limit(int resource, int limit) {
  struct rlimit rl = {
      .rlim_cur = (rlim_t)limit,
      .rlim_max = (rlim_t)limit,
  };
  if (setrlimit(resource, &rl) != 0) {
    exit(111);
  }
}


x86 assembly (clang, -O0):
<set_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <setrlimit@plt>
cmp    $0x0,%rax
je     115a <set_limit+0x3a>
mov    $0x6f,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_limit>:
push   %rax
mov    %esi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
call   1030 <setrlimit@plt>
test   %rax,%rax
jne    1137 <set_limit+0x17>
pop    %rax
ret
mov    $0x6f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
define void @set_limit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.rlimit
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 0
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 1
%9 = load i32, i32* %4
store i32 %9, i32* %8
%10 = load i32, i32* %3
%11 = call i64 @setrlimit(i32 %10, %struct.rlimit* %5)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @exit(i32 111)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
define void @set_limit(i32 %0, i32 %1) {
%3 = alloca %struct.rlimit
%4 = bitcast %struct.rlimit* %3 to i8*
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i64 @setrlimit(i32 %0, %struct.rlimit* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @exit(i32 111)
unreachable
11: ; preds = %2
ret void
}