xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s file count [[d]{r|w|rw} [pages_per_vec [objid]]]\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"usage: %s file count [[d]{r|w|rw} [pages_per_vec [objid]]]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"usage: %s file count [[d]{r|w|rw} [pages_per_vec [objid]]]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void timeInit() {
  (*(volatile unsigned long *)(0xE01FC000 + 0x0C4)) |= 2;
  (*(volatile unsigned long *)(0xE01FC000 + 0x1A8)) =
      ((*(volatile unsigned long *)(0xE01FC000 + 0x1A8)) & (~0x0c)) | 0x04;
  (*(volatile unsigned long *)(0xE0004000 + 0x04)) = 0;
  (*(volatile unsigned long *)(0xE0004000 + 0x0C)) = 12000000 / 1000 - 1;
  (*(volatile unsigned long *)(0xE0004000 + 0x04)) = 2;
  (*(volatile unsigned long *)(0xE0004000 + 0x04)) = 1;
}


x86 assembly (clang, -O0):
<timeInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe01fc0c4,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0xe01fc0c4,%eax
mov    %rcx,(%rax)
mov    $0xe01fc1a8,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffff3,%rcx
or     $0x4,%rcx
mov    $0xe01fc1a8,%eax
mov    %rcx,(%rax)
mov    $0xe0004004,%eax
movq   $0x0,(%rax)
mov    $0xe000400c,%eax
movq   $0x2edf,(%rax)
mov    $0xe0004004,%eax
movq   $0x2,(%rax)
mov    $0xe0004004,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeInit>:
mov    $0xe0004004,%eax
orq    $0x2,0x1f80c0(%rax)
02
mov    0x1f81a4(%rax),%rcx
and    $0xfffffffffffffff3,%rcx
or     $0x4,%rcx
mov    %rcx,0x1f81a4(%rax)
movq   $0x0,(%rax)
movq   $0x2edf,0x8(%rax)
movq   $0x2,(%rax)
movq   $0x1,(%rax)
ret

LLVM IR (-O0):
define void @timeInit() {
%1 = load volatile i64, i64* inttoptr (i64 3760177348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 3760177348 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3760177576 to i64*)
%4 = and i64 %3, -13
%5 = or i64 %4, 4
store volatile i64 %5, i64* inttoptr (i64 3760177576 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 11999, i64* inttoptr (i64 3758112780 to i64*)
store volatile i64 2, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112772 to i64*)
ret void
}

LLVM IR (-O2):
define void @timeInit() {
%1 = load volatile i64, i64* inttoptr (i64 3760177348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 3760177348 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3760177576 to i64*)
%4 = and i64 %3, -13
%5 = or i64 %4, 4
store volatile i64 %5, i64* inttoptr (i64 3760177576 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 11999, i64* inttoptr (i64 3758112780 to i64*)
store volatile i64 2, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112772 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq2(int, int, unsigned char *, long long);
void vt100_SGR2(int n, int m) {
  vt100_EscSeq2(n, m, (unsigned char *)"m", (long long)2);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdx
mov    $0x2,%ecx
call   1030 <vt100_EscSeq2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rdx
mov    $0x2,%ecx
jmp    1030 <vt100_EscSeq2@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"m\00"
define void @vt100_SGR2(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 @vt100_EscSeq2(i32 %5, i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"m\00"
define void @vt100_SGR2(i32 %0, i32 %1) {
%3 = tail call i32 @vt100_EscSeq2(i32 %0, i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x53() {
  Assert_real((islower(83) == 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_islower.c",
              420, ("islower should be 0 for S"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x53>:
push   %rax
mov    $0x53,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1a4,%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 0 for S\00"
define void @t_islower_0x53() {
%1 = call i64 @islower(i32 83)
%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 420, 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 0 for S\00"
define void @t_islower_0x53() {
%1 = tail call i64 @islower(i32 83)
%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 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(void) {
  int i = 0;
  while (i <= 100) {
    printf("\rPercent complete: %d%%", i);
    fflush(stdout);
    sleep(1);
    i++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1187 <main+0x57>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%r14
mov    0x2e8e(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0DPercent complete: %d%%\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
%11 = call i32 @sleep(i32 1)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0DPercent complete: %d%%\00"
@stdout = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @sleep(i32 1)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_fmatrix(int **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_fmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_fmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_fmatrix(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32** %0, i32*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i32**, i32*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i32*, i32** %11, i64 %12
%14 = load i32*, i32** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 -1
%18 = bitcast i32* %17 to i8*
%19 = call i32 @free(i8* %18)
%20 = load i32**, i32*** %6
%21 = load i64, i64* %7
%22 = getelementptr inbounds i32*, i32** %20, i64 %21
%23 = getelementptr inbounds i32*, i32** %22, i64 -1
%24 = bitcast i32** %23 to i8*
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @free_fmatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = bitcast i32* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds i32*, i32** %6, i64 -1
%13 = bitcast i32** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int sci_get_chip_id();
int soc_id_is_sc9820v0(void) {
  return ((sci_get_chip_id() & (0xFFFF0000)) == ((0x96320000) & (0xFFFF0000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc9820v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
cmp    $0x96320000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc9820v0>:
push   %rax
xor    %eax,%eax
call   1030 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x96320000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @soc_id_is_sc9820v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, -1775108096
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @soc_id_is_sc9820v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, -1775108096
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x90() {
  Assert_real((isodigit(144) == 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_isodigit.c",
              725, ("isodigit should be 0 for 0x90"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x90>:
push   %rax
mov    $0x90,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2d5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x90\00"
define void @t_isodigit_0x90() {
%1 = call i64 @isodigit(i32 144)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x90\00"
define void @t_isodigit_0x90() {
%1 = tail call i64 @isodigit(i32 144)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __process_trace_bufs();
scalar_t__ wait_empty_entries();
void process_trace_bufs(void) {
  while (wait_empty_entries())
    __process_trace_bufs();
}


x86 assembly (clang, -O0):
<process_trace_bufs>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <process_trace_bufs+0x9>
mov    $0x0,%al
call   1040 <wait_empty_entries@plt>
cmp    $0x0,%rax
je     1146 <process_trace_bufs+0x26>
mov    $0x0,%al
call   1030 <__process_trace_bufs@plt>
jmp    1129 <process_trace_bufs+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_trace_bufs>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <wait_empty_entries@plt>
test   %rax,%rax
je     1145 <process_trace_bufs+0x25>
xor    %eax,%eax
call   1030 <__process_trace_bufs@plt>
jmp    1130 <process_trace_bufs+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @process_trace_bufs() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @wait_empty_entries()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @__process_trace_bufs()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @process_trace_bufs() {
%1 = tail call i64 (...) @wait_empty_entries()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @__process_trace_bufs()
%5 = tail call i64 (...) @wait_empty_entries()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
bool is_split_char(unsigned char c) {
  size_t length = 3;
  unsigned char split_chars[] = {'\n', '\r', 0xda};
  for (size_t i = 0; i < length; i++)
    if (c == split_chars[i])
      return true;
  return false;
}


x86 assembly (clang, -O0):
<is_split_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movq   $0x3,-0x10(%rbp)
mov    0xee7(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xedf(%rip),%al
mov    %al,-0x11(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1173 <is_split_char+0x73>
movzbl -0x5(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl -0x13(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    115d <is_split_char+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    117a <is_split_char+0x7a>
jmp    1162 <is_split_char+0x62>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112e <is_split_char+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_split_char>:
add    $0x26,%dil
cmp    $0x33,%dil
ja     1124 <is_split_char+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x9000000000001,%rdx
bt     %rcx,%rdx
jae    1124 <is_split_char+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.is_split_char.split_chars = [3 x i8] c"\0A\0D\DA"
define i32 @is_split_char(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i64
%5 = alloca [3 x i8]
%6 = alloca i64
store i8 %0, i8* %3
store i64 3, i64* %4
%7 = bitcast [3 x i8]* %5 to i8*
store i64 0, i64* %6
br label %8
8: ; preds = %22, %1
%9 = load i64, i64* %6
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = load i64, i64* %6
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %14, %18
br i1 %19, label %20, label %21
20: ; preds = %12
store i32 1, i32* %2
br label %26
21: ; preds = %12
br label %22
22: ; preds = %21
%23 = load i64, i64* %6
%24 = add i64 %23, 1
store i64 %24, i64* %6
br label %8
25: ; preds = %8
store i32 0, i32* %2
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @is_split_char(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 10, label %3
i8 13, label %3
i8 -38, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ WregPair(int);
int /*<<< orphan*/ Ws(char *);
int /*<<< orphan*/ Wx(int, int);
int Winst97(int i, int code) {
  int regpair = ((code >> 3) & 6) + 24;
  int value = ((code >> 2) & 0x30) | (code & 0xf);
  Ws("sbiw  ");
  WregPair(regpair);
  Ws(", $");
  Wx(value, 2);
  return 0;
}


x86 assembly (clang, -O0):
<Winst97>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
and    $0x6,%eax
add    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
and    $0x30,%eax
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
lea    0xe98(%rip),%rdi
call   1030 <Ws@plt>
mov    -0xc(%rbp),%edi
call   1040 <WregPair@plt>
lea    0xe8b(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1050 <Wx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Winst97>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
shr    $0x3,%ebx
and    $0x6,%ebx
or     $0x18,%ebx
mov    %esi,%ebp
shr    $0x2,%ebp
and    $0x30,%ebp
and    $0xf,%esi
or     %esi,%ebp
lea    0xeae(%rip),%rdi
call   1030 <Ws@plt>
mov    %ebx,%edi
call   1040 <WregPair@plt>
lea    0xea2(%rip),%rdi
call   1030 <Ws@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1050 <Wx@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sbiw \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst97(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* %4
%8 = ashr i32 %7, 3
%9 = and i32 %8, 6
%10 = add nsw i32 %9, 24
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = ashr i32 %11, 2
%13 = and i32 %12, 48
%14 = load i32, i32* %4
%15 = and i32 %14, 15
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %5
%19 = call i32 @WregPair(i32 %18)
%20 = call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %6
%22 = call i32 @Wx(i32 %21, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"sbiw \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst97(i32 %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = and i32 %3, 6
%5 = or i32 %4, 24
%6 = lshr i32 %1, 2
%7 = and i32 %6, 48
%8 = and i32 %1, 15
%9 = or i32 %7, %8
%10 = tail call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @WregPair(i32 %5)
%12 = tail call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @Wx(i32 %9, i32 2)
ret i32 0
}
int sizeofcompint(int number) {
  int size = 0;
  do {
    size++;
  } while ((number >>= 7));
  return size;
}


x86 assembly (clang, -O0):
<sizeofcompint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    110e <sizeofcompint+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeofcompint>:
xor    %eax,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
sar    $0x7,%ecx
cmp    $0x7f,%edi
mov    %ecx,%edi
ja     1110 <sizeofcompint+0x10>
ret

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

LLVM IR (-O2):
define i32 @sizeofcompint(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = ashr i32 %3, 7
%7 = icmp ult i32 %3, 128
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %5
}
void hw_clear_port_event(void) {}


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

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

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

LLVM IR (-O2):
define void @hw_clear_port_event() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genStd4(char);
void foo_foo_() { genStd4('_'); }


x86 assembly (clang, -O0):
<foo_foo_>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
call   1030 <genStd4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_foo_>:
mov    $0x5f,%edi
jmp    1030 <genStd4@plt>

LLVM IR (-O0):
define void @foo_foo_() {
%1 = call i32 @genStd4(i8 signext 95)
ret void
}

LLVM IR (-O2):
define void @foo_foo_() {
%1 = tail call i32 @genStd4(i8 signext 95)
ret void
}
/* Type definitions */
struct passwd {
  char *pw_dir;
};

/* Variables and functions */
char *getenv(char *);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
char *xw_home_dir(void) {
  char *home = NULL;
  if ((home = getenv("HOME")) == NULL) {
    struct passwd *pwd = getpwuid(getuid());
    if (pwd)
      home = pwd->pw_dir;
  };
  return home;
}


x86 assembly (clang, -O0):
<xw_home_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1187 <xw_home_dir+0x57>
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1182 <xw_home_dir+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <xw_home_dir+0x57>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xw_home_dir>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <xw_home_dir+0x2d>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
test   %rax,%rax
je     115d <xw_home_dir+0x2d>
mov    (%rax),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [5 x i8] c"HOME\00"
define i8* @xw_home_dir() {
%1 = alloca i8*
%2 = alloca %struct.passwd*
store i8* null, i8** %1
%3 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %0
%6 = call i32 (...) @getuid()
%7 = call %struct.passwd* @getpwuid(i32 %6)
store %struct.passwd* %7, %struct.passwd** %2
%8 = load %struct.passwd*, %struct.passwd** %2
%9 = icmp ne %struct.passwd* %8, null
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load %struct.passwd*, %struct.passwd** %2
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i32 0, i32 0
%13 = load i8*, i8** %12
store i8* %13, i8** %1
br label %14
14: ; preds = %10, %5
br label %15
15: ; preds = %14, %0
%16 = load i8*, i8** %1
ret i8* %16
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [5 x i8] c"HOME\00"
define i8* @xw_home_dir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 (...) @getuid()
%5 = tail call %struct.passwd* @getpwuid(i32 %4)
%6 = icmp eq %struct.passwd* %5, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %5, i64 0, i32 0
%9 = load i8*, i8** %8
br label %10
10: ; preds = %3, %7, %0
%11 = phi i8* [ %1, %0 ], [ %9, %7 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(int argc, char **argv) {
  foo(argc);
  foo(argc * 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
call   1030 <foo@plt>
add    %ebx,%ebx
mov    %ebx,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0)
%4 = shl nsw i32 %0, 1
%5 = tail call i32 @foo(i32 %4)
ret i32 0
}
/* Variables and functions */
int MainEntry(int, char **);
int main(int argc, char **argv) { return MainEntry(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <MainEntry@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @MainEntry(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int GetInput();
int /*<<< orphan*/ printf(char *, int);
void BasicWhileLoop() {
  int x = 0;
  int condition = GetInput();
  while (x < condition) {
    printf("Executed %d times \n", x);
    x++;
  }
}


x86 assembly (clang, -O0):
<BasicWhileLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GetInput@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <BasicWhileLoop+0x42>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <BasicWhileLoop+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BasicWhileLoop>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <GetInput@plt>
test   %eax,%eax
jle    1151 <BasicWhileLoop+0x31>
mov    %eax,%ebp
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <BasicWhileLoop+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Executed %d times \0A\00"
define void @BasicWhileLoop() {
%1 = tail call i32 (...) @GetInput()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
char *__argp_base_name(const char *arg) {
  char *p = strrchr(arg, '/');
  return (char *)(p ? p + 1 : arg);
}


x86 assembly (clang, -O0):
<__argp_base_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <__argp_base_name+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <__argp_base_name+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__argp_base_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__argp_base_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ event;
};
struct TYPE_4__ {
  TYPE_1__ xcirculate;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xcirculate_event(void *_p) {
  return (unsigned long)((XEvent *)_p)->xcirculate.event;
}


x86 assembly (clang, -O0):
<get_XEvent_xcirculate_event>:
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_xcirculate_event>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xcirculate_event(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
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xcirculate_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sim_internal_fail(void) {
  fprintf(stderr, "Internal error in simulator, aborting\n");
  abort();
}


x86 assembly (clang, -O0):
<sim_internal_fail>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sim_internal_fail>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Internal error in simulator, aborting\0A\00"
define void @sim_internal_fail() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Internal error in simulator, aborting\0A\00"
define void @sim_internal_fail() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
reg0imm1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (r0 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x21,%eax
jg     1138 <reg0imm1+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <reg0imm1+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0imm1>:
and    $0xfffe,%edi
xor    %eax,%eax
cmp    $0x22,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @reg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %8
%17 = zext i16 %16 to i32
%18 = icmp sle i32 %17, 33
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @reg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = and i32 %0, 65534
%8 = icmp ult i32 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
char *nextTok(char **);
int at_tok_nextstr(char **p_cur, char **p_out) {
  if (*p_cur == NULL)
    return -1;
  *p_out = nextTok(p_cur);
  if (*p_out == NULL)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<at_tok_nextstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <at_tok_nextstr+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <at_tok_nextstr+0x5e>
mov    -0x10(%rbp),%rdi
call   1030 <nextTok@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1167 <at_tok_nextstr+0x57>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <at_tok_nextstr+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_tok_nextstr>:
push   %rbx
cmpq   $0x0,(%rdi)
je     112a <at_tok_nextstr+0x1a>
mov    %rsi,%rbx
call   1030 <nextTok@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @at_tok_nextstr(i8** %0, i8** nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i8* @nextTok(i8** %0)
store i8* %6, i8** %1
%7 = icmp eq i8* %6, null
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
unsigned char *mem_combine(unsigned char *, unsigned int, unsigned char const *,
                           unsigned int);
unsigned char *mem_append(unsigned char *src, unsigned int src_len,
                          const unsigned char *append,
                          unsigned int append_len) {
  unsigned char *p = mem_combine(src, src_len, append, append_len);
  free(src);
  return p;
}


x86 assembly (clang, -O0):
<mem_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <mem_combine@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_append>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <mem_combine@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mem_append(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i8* @mem_combine(i8* %10, i32 %11, i8* %12, i32 %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %9
ret i8* %17
}

LLVM IR (-O2):
define i8* @mem_append(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @mem_combine(i8* %0, i32 %1, i8* %2, i32 %3)
%6 = tail call i32 @free(i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ etp_set_min_parallel(unsigned int);
void eio_set_min_parallel(unsigned int nthreads) {
  etp_set_min_parallel(nthreads);
}


x86 assembly (clang, -O0):
<eio_set_min_parallel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <etp_set_min_parallel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eio_set_min_parallel>:
jmp    1030 <etp_set_min_parallel@plt>

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

LLVM IR (-O2):
define void @eio_set_min_parallel(i32 %0) {
%2 = tail call i32 @etp_set_min_parallel(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, int);
int /*<<< orphan*/ puts(char *);
void on_error2(void *context, const char *error, int line_num, int char_pos) {
  printf("error %s at %d:%d in text:\n", error, line_num, char_pos);
  puts((char *)context);
  exit(-1);
}


x86 assembly (clang, -O0):
<on_error2>:
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    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<on_error2>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"error %s at %d:%d in text:\0A\00"
define void @on_error2(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 i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i32 %11)
%13 = load i8*, i8** %5
%14 = call i32 @puts(i8* %13)
%15 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"error %s at %d:%d in text:\0A\00"
define void @on_error2(i8* nocapture %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i32 %3)
%6 = tail call i32 @puts(i8* dereferenceable(1) %0)
%7 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int SSL_shutdown(int /*<<< orphan*/ *);
scalar_t__ waitforit(int /*<<< orphan*/ *);
int do_shutdown(SSL *ssl) {
  int ret;
again:
  ret = SSL_shutdown(ssl);
  if (ret < 0) {
    if (waitforit(ssl)) {
      goto again;
    } else {
      return -1;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<do_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <SSL_shutdown@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1166 <do_shutdown+0x46>
mov    -0x10(%rbp),%rdi
call   1040 <waitforit@plt>
cmp    $0x0,%rax
je     115a <do_shutdown+0x3a>
jmp    112c <do_shutdown+0xc>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <do_shutdown+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_shutdown>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <SSL_shutdown@plt>
test   %eax,%eax
jns    114e <do_shutdown+0x2e>
mov    %rbx,%rdi
call   1040 <waitforit@plt>
test   %rax,%rax
jne    1130 <do_shutdown+0x10>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @do_shutdown(i32* %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @SSL_shutdown(i32* %0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i64 @waitforit(i32* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2, %5
%9 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %9
}
/* Variables and functions */
char *strstr(char *, char *);
char *chk_ppd_default_setting_line(char *ppd_line) {
  char *p;
  p = strstr(ppd_line, "*Default");
  if (p != ppd_line)
    return NULL;
  return p;
}


x86 assembly (clang, -O0):
<chk_ppd_default_setting_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     114b <chk_ppd_default_setting_line+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1153 <chk_ppd_default_setting_line+0x43>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_ppd_default_setting_line>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
cmovne %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"*Default\00"
define i8* @chk_ppd_default_setting_line(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, %0
%4 = select i1 %3, i8* %2, i8* null
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t uart_busy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uart_busy() {
ret i32 0
}