xunge/DecIR huggingface dataset:
int _fork_r(struct _reent *r) { return -1; }


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

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

LLVM IR (-O0):
%struct._reent = type opaque
define i32 @_fork_r(%struct._reent* %0) {
%2 = alloca %struct._reent*
store %struct._reent* %0, %struct._reent** %2
ret i32 -1
}

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_fork_r(%struct._reent* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
char *javaNew(int);
int /*<<< orphan*/ write(char *);
char *pyInput(char *prompt) {
  write(prompt);
  char *gotten = javaNew(256);
  gets(gotten);
  return gotten;
}


x86 assembly (clang, -O0):
<pyInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <write@plt>
mov    $0x100,%edi
call   1040 <javaNew@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <gets@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyInput>:
push   %rbx
call   1030 <write@plt>
mov    $0x100,%edi
call   1040 <javaNew@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <gets@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pyInput(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @write(i8* %4)
%6 = call i8* @javaNew(i32 256)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @gets(i8* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @pyInput(i8* %0) {
%2 = tail call i32 @write(i8* %0)
%3 = tail call i8* @javaNew(i32 256)
%4 = tail call i32 @gets(i8* %3)
ret i8* %3
}
int foo(int x) {
  int c, y;
  if (c)
    x = 2;
  y = x + 1;
  return y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1118 <foo+0x18>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xd2() {
  Assert_real((isgraph(210) == 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_isgraph.c",
              1055, ("isgraph should be 0 for 0xd2"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xd2>:
push   %rax
mov    $0xd2,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41f,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd2\00"
define void @t_isgraph_0xd2() {
%1 = call i64 @isgraph(i32 210)
%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 1055, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd2\00"
define void @t_isgraph_0xd2() {
%1 = tail call i64 @isgraph(i32 210)
%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 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  char *cards = "JQK";
  char a_card = cards[2];
  cards[2] = cards[1];
  cards[1] = cards[0];
  cards[0] = cards[2];
  cards[2] = cards[1];
  cards[1] = a_card;
  puts(cards);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"JQK\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 2
store i8 %9, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 %19, i8* %21
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 2
store i8 %24, i8* %26
%27 = load i8, i8* %3
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8 %27, i8* %29
%30 = load i8*, i8** %2
%31 = call i32 @puts(i8* %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"JQK\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void put32_msb(uint32_t a, void *out) {
  a = htonl(a);
  memcpy(out, &a, sizeof(a));
}


x86 assembly (clang, -O0):
<put32_msb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32_msb>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @put32_msb(i32 %0, i8* %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %0)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %1, i32* %3, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *memset(char *, int, int);
int *grab_and_touch(char *block[], int i) {
  block[i] = (char *)malloc((1024 * 1024));
  if (!block[i])
    return NULL;
  return (memset(block[i], 1, (1024 * 1024)));
}


x86 assembly (clang, -O0):
<grab_and_touch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    1168 <grab_and_touch+0x48>
movq   $0x0,-0x8(%rbp)
jmp    1187 <grab_and_touch+0x67>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x1,%esi
mov    $0x100000,%edx
call   1030 <memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grab_and_touch>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x100000,%edi
call   1040 <malloc@plt>
movslq %ebx,%rcx
mov    %rax,(%r14,%rcx,8)
test   %rax,%rax
je     1158 <grab_and_touch+0x38>
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x100000,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memset@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @grab_and_touch(i8** nocapture writeonly %0, i32 %1) {
%3 = tail call i64 @malloc(i32 1048576)
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
store i8* %4, i8** %6
%7 = icmp eq i64 %3, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32* @memset(i8* %4, i32 1, i32 1048576)
br label %10
10: ; preds = %2, %8
%11 = phi i32* [ %9, %8 ], [ null, %2 ]
ret i32* %11
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main() {
  f1(5);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 5)
ret i32 0
}
/* Type definitions */
struct _tuple3 {
  int dummy;
};
struct Cyc_Sexp_Parser {
  int dummy;
};

/* Variables and functions */
struct _tuple3 *Cyc_Sexp_mk_sshort(short);
unsigned short Cyc_Sexp_parse_short(struct Cyc_Sexp_Parser *);
struct _tuple3 *Cyc_Sexp_parse_sshort(struct Cyc_Sexp_Parser *p) {
  unsigned short _T0;
  short _T1;
  struct _tuple3 *_T2;
  _T0 = Cyc_Sexp_parse_short(p);
  _T1 = (short)_T0;
  _T2 = Cyc_Sexp_mk_sshort(_T1);
  return _T2;
}


x86 assembly (clang, -O0):
<Cyc_Sexp_parse_sshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Cyc_Sexp_parse_short@plt>
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%edi
call   1040 <Cyc_Sexp_mk_sshort@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Sexp_parse_sshort>:
push   %rax
call   1030 <Cyc_Sexp_parse_short@plt>
movswl %ax,%edi
pop    %rax
jmp    1040 <Cyc_Sexp_mk_sshort@plt>

LLVM IR (-O0):
%struct._tuple3 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple3* @Cyc_Sexp_parse_sshort(%struct.Cyc_Sexp_Parser* %0) {
%2 = alloca %struct.Cyc_Sexp_Parser*
%3 = alloca i16
%4 = alloca i16
%5 = alloca %struct._tuple3*
store %struct.Cyc_Sexp_Parser* %0, %struct.Cyc_Sexp_Parser** %2
%6 = load %struct.Cyc_Sexp_Parser*, %struct.Cyc_Sexp_Parser** %2
%7 = call zeroext i16 @Cyc_Sexp_parse_short(%struct.Cyc_Sexp_Parser* %6)
store i16 %7, i16* %3
%8 = load i16, i16* %3
store i16 %8, i16* %4
%9 = load i16, i16* %4
%10 = call %struct._tuple3* @Cyc_Sexp_mk_sshort(i16 signext %9)
store %struct._tuple3* %10, %struct._tuple3** %5
%11 = load %struct._tuple3*, %struct._tuple3** %5
ret %struct._tuple3* %11
}

LLVM IR (-O2):
%struct._tuple3 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple3* @Cyc_Sexp_parse_sshort(%struct.Cyc_Sexp_Parser* %0) {
%2 = tail call zeroext i16 @Cyc_Sexp_parse_short(%struct.Cyc_Sexp_Parser* %0)
%3 = tail call %struct._tuple3* @Cyc_Sexp_mk_sshort(i16 signext %2)
ret %struct._tuple3* %3
}
/* Variables and functions */
int Inverte(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i;
  scanf("%d", &i);
  printf(i == Inverte(i) ? "sim" : "nao");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Inverte@plt>
mov    -0x8(%rbp),%ecx
mov    %eax,%edx
lea    0xea5(%rip),%rdi
lea    0xe9a(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <Inverte@plt>
cmp    %eax,%ebx
lea    0xea9(%rip),%rax
lea    0xea6(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"sim\00"
@.str.2 = [4 x i8] c"nao\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @Inverte(i32 %4)
%6 = icmp eq i32 %3, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"sim\00"
@.str.2 = [4 x i8] c"nao\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @Inverte(i32 %4)
%6 = icmp eq i32 %4, %5
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear_terminal() {
  printf("\033[2J");
  printf("\033[0;0H");
}


x86 assembly (clang, -O0):
<clear_terminal>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_terminal>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[0;0H\00"
define void @clear_terminal() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[0;0H\00"
define void @clear_terminal() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *index(char *, char);
remove_nl(char *s) {
  char *p;
  if ((p = index(s, '\n')) != NULL)
    *p = '\0';
}


x86 assembly (clang, -O0):
<remove_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <index@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     113f <remove_nl+0x2f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_nl>:
push   %rax
mov    $0xa,%esi
call   1030 <index@plt>
test   %rax,%rax
je     1123 <remove_nl+0x13>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32 @remove_nl(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @index(i8* %5, i8 signext 10)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %4
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @remove_nl(i8* %0) {
%2 = tail call i8* @index(i8* %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRE2_set(void) { return U_WMRCORENONE_set("U_WMRE2"); }


x86 assembly (clang, -O0):
<U_WMRE2_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE2\00"
define i8* @U_WMRE2_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE2\00"
define i8* @U_WMRE2_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int atoi(char *);
int sdb_integer(int n, char **p, void *closure) {
  int *i = (int *)closure;
  *i = atoi(p[0]);
  return 0;
}


x86 assembly (clang, -O0):
<sdb_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_integer>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sdb_integer(i32 %0, i8** nocapture %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i8*, i8** %1
%6 = tail call i32 @atoi(i8* %5)
store i32 %6, i32* %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void usage(void) {
  errx(EX_USAGE, "sysinit -i sysinit.bin -o sysinit_data.c \\\n"
                 "\t"
                 "-k sysinit -s sysinit_data [ -R (reverse)]");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@EX_USAGE = global i32 0
@.str = [87 x i8] c"sysinit -i sysinit.bin -o sysinit_data.c \\\0A\09-k sysinit -s sysinit_data [ -R (reverse)]\00"
define void @usage() {
%1 = load i32, i32* @EX_USAGE
%2 = call i32 @errx(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EX_USAGE = global i32 0
@.str = [87 x i8] c"sysinit -i sysinit.bin -o sysinit_data.c \\\0A\09-k sysinit -s sysinit_data [ -R (reverse)]\00"
define void @usage() {
%1 = load i32, i32* @EX_USAGE
%2 = tail call i32 @errx(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_64(int /*<<< orphan*/);
uint64_t cpu_to_le64(uint64_t native) { return bswap_64(native); }


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

x86 assembly (clang, -O2):
<cpu_to_le64>:
jmp    1030 <bswap_64@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_le64(i32 %0) {
%2 = tail call i32 @bswap_64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This is main!\n");
  bar();
  foo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    $0x0,%al
call   1050 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"This is main!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @foo()
ret i32 0
}
struct page *arch_validate(struct page *page, unsigned int gfp_mask,
                           int order) {
  return (page);
}


x86 assembly (clang, -O0):
<arch_validate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_validate>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.page = type opaque
define %struct.page* @arch_validate(%struct.page* %0, i32 %1, i32 %2) {
%4 = alloca %struct.page*
%5 = alloca i32
%6 = alloca i32
store %struct.page* %0, %struct.page** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.page*, %struct.page** %4
ret %struct.page* %7
}

LLVM IR (-O2):
%struct.page = type opaque
define %struct.page* @arch_validate(%struct.page* readnone returned %0, i32 %1, i32 %2) {
ret %struct.page* %0
}
void WideTimer5A_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<WideTimer5A_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <WideTimer5A_Handler+0x9>
jmp    1109 <WideTimer5A_Handler+0x9>

x86 assembly (clang, -O2):
<WideTimer5A_Handler>:
jmp    1100 <WideTimer5A_Handler>

LLVM IR (-O0):
define void @WideTimer5A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @WideTimer5A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void TimerOverflow() {}


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

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

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

LLVM IR (-O2):
define void @TimerOverflow() {
ret void
}
int test_imm_12int8_reg(signed char val) {
  return ((val) & (0x12 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_12int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x12,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_12int8_reg(i8 signext %0) {
%2 = and i8 %0, 18
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct fs_dirent {
  int dummy;
};

/* Variables and functions */
struct fs_dirent *diskfs_dirent_create_file_or_dir(struct fs_dirent *,
                                                   char const *, int);
struct fs_dirent *diskfs_dirent_create_dir(struct fs_dirent *d,
                                           const char *name) {
  return diskfs_dirent_create_file_or_dir(d, name, 2);
}


x86 assembly (clang, -O0):
<diskfs_dirent_create_dir>:
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    $0x2,%edx
call   1030 <diskfs_dirent_create_file_or_dir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diskfs_dirent_create_dir>:
mov    $0x2,%edx
jmp    1030 <diskfs_dirent_create_file_or_dir@plt>

LLVM IR (-O0):
%struct.fs_dirent = type { i32 }
define %struct.fs_dirent* @diskfs_dirent_create_dir(%struct.fs_dirent* %0, i8* %1) {
%3 = alloca %struct.fs_dirent*
%4 = alloca i8*
store %struct.fs_dirent* %0, %struct.fs_dirent** %3
store i8* %1, i8** %4
%5 = load %struct.fs_dirent*, %struct.fs_dirent** %3
%6 = load i8*, i8** %4
%7 = call %struct.fs_dirent* @diskfs_dirent_create_file_or_dir(%struct.fs_dirent* %5, i8* %6, i32 2)
ret %struct.fs_dirent* %7
}

LLVM IR (-O2):
%struct.fs_dirent = type { i32 }
define %struct.fs_dirent* @diskfs_dirent_create_dir(%struct.fs_dirent* %0, i8* %1) {
%3 = tail call %struct.fs_dirent* @diskfs_dirent_create_file_or_dir(%struct.fs_dirent* %0, i8* %1, i32 2)
ret %struct.fs_dirent* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void str1_to_str2(char *des, char split, char *src) {
  char *ptr;
  ptr = des + strlen(des);
  *ptr++ = split;
  *ptr = 0;
  strcpy(ptr, src);
  return;
}


x86 assembly (clang, -O0):
<str1_to_str2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str1_to_str2>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @str1_to_str2(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8* %12, i8** %7
%13 = load i8, i8* %5
%14 = load i8*, i8** %7
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %7
store i8 %13, i8* %14
%16 = load i8*, i8** %7
store i8 0, i8* %16
%17 = load i8*, i8** %7
%18 = load i8*, i8** %6
%19 = call i32 @strcpy(i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @str1_to_str2(i8* %0, i8 signext %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %1, i8* %6
store i8 0, i8* %7
%8 = tail call i32 @strcpy(i8* %7, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void tcpmsg_finalize(char *buf, int buf_len) {
  int data_len = buf_len - 4;
  memcpy(buf, (char *)&data_len, 4);
}


x86 assembly (clang, -O0):
<tcpmsg_finalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpmsg_finalize>:
push   %rax
add    $0xfffffffc,%esi
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @tcpmsg_finalize(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 4
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = bitcast i32* %5 to i8*
%10 = call i32 @memcpy(i8* %8, i8* %9, i32 4)
ret void
}

LLVM IR (-O2):
define void @tcpmsg_finalize(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = add nsw i32 %1, -4
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
ret void
}
/* Type definitions */
struct mrb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ m_putc(int, int);
int mrb_get(struct mrb *);
int get_line(int line, struct mrb *q) {
  int ch, found = 0;
  while ((ch = mrb_get(q)) != -1)
    if (ch == 10) {
      m_putc(line, 0);
      found = 1;
      break;
    } else
      m_putc(line, ch);
  return found;
}


x86 assembly (clang, -O0):
<get_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mrb_get@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     117b <get_line+0x5b>
cmpl   $0xa,-0x14(%rbp)
jne    116b <get_line+0x4b>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <m_putc@plt>
movl   $0x1,-0x18(%rbp)
jmp    117b <get_line+0x5b>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <m_putc@plt>
jmp    1136 <get_line+0x16>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <mrb_get@plt>
cmp    $0xffffffff,%eax
je     114d <get_line+0x2d>
cmp    $0xa,%eax
je     1151 <get_line+0x31>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <m_putc@plt>
jmp    1130 <get_line+0x10>
xor    %eax,%eax
jmp    115f <get_line+0x3f>
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <m_putc@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.mrb = type { i32 }
define i32 @get_line(i32 %0, %struct.mrb* %1) {
%3 = alloca i32
%4 = alloca %struct.mrb*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store %struct.mrb* %1, %struct.mrb** %4
store i32 0, i32* %6
br label %7
7: ; preds = %21, %2
%8 = load %struct.mrb*, %struct.mrb** %4
%9 = call i32 @mrb_get(%struct.mrb* %8)
store i32 %9, i32* %5
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = call i32 @m_putc(i32 %15, i32 0)
store i32 1, i32* %6
br label %22
17: ; preds = %11
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = call i32 @m_putc(i32 %18, i32 %19)
br label %21
21: ; preds = %17
br label %7
22: ; preds = %14, %7
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
%struct.mrb = type { i32 }
define i32 @get_line(i32 %0, %struct.mrb* %1) {
br label %3
3: ; preds = %7, %2
%4 = tail call i32 @mrb_get(%struct.mrb* %1)
switch i32 %4, label %7 [
i32 -1, label %9
i32 10, label %5
]
5: ; preds = %3
%6 = tail call i32 @m_putc(i32 %0, i32 0)
br label %9
7: ; preds = %3
%8 = tail call i32 @m_putc(i32 %0, i32 %4)
br label %3
9: ; preds = %3, %5
%10 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ COND_GT();
int /*<<< orphan*/ EA_AL_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sgt_8_al(void) { m68ki_write_8(EA_AL_8(), COND_GT() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_sgt_8_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AL_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_GT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sgt_8_al>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AL_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_GT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sgt_8_al() {
%1 = call i32 (...) @EA_AL_8()
%2 = call i64 (...) @COND_GT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sgt_8_al() {
%1 = tail call i32 (...) @EA_AL_8()
%2 = tail call i64 (...) @COND_GT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x98() {
  Assert_real((isalnum(152) == 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_isalnum.c",
              765, ("isalnum should be 0 for 0x98"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x98>:
push   %rax
mov    $0x98,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2fd,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x98\00"
define void @t_isalnum_0x98() {
%1 = call i64 @isalnum(i32 152)
%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 765, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x98\00"
define void @t_isalnum_0x98() {
%1 = tail call i64 @isalnum(i32 152)
%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 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int MUS_QrySongPlaying(int handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MUS_QrySongPlaying(i32 %0) {
ret i32 0
}
int SimpleNum(int a, int b) {
  int i;
  for (i = 2; i <= a; ++i)
    if (b % i == 0 && a % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<SimpleNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115c <SimpleNum+0x5c>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1149 <SimpleNum+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1149 <SimpleNum+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1163 <SimpleNum+0x63>
jmp    114e <SimpleNum+0x4e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <SimpleNum+0x11>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SimpleNum>:
mov    $0x1,%r8d
cmp    $0x2,%edi
jge    110f <SimpleNum+0xf>
mov    %r8d,%eax
ret
mov    %edi,%r9d
mov    %edi,%ecx
neg    %ecx
mov    $0x2,%edi
jmp    1132 <SimpleNum+0x32>
nopl   (%rax)
lea    (%rcx,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
je     110b <SimpleNum+0xb>
mov    %esi,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1120 <SimpleNum+0x20>
mov    %r9d,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1120 <SimpleNum+0x20>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @SimpleNum(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %11
%5 = phi i32 [ %12, %11 ], [ 2, %2 ]
%6 = srem i32 %1, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = srem i32 %0, %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %4, %8
%12 = add nuw i32 %5, 1
%13 = icmp eq i32 %5, %0
br i1 %13, label %14, label %4
14: ; preds = %8, %11, %2
%15 = phi i32 [ 1, %2 ], [ 1, %11 ], [ 0, %8 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ text;

/* Variables and functions */
scalar_t__ roadmap_message_format(char *, int, char *);
const char *get_time_to_destination(void) {
  static char text[256];
  if (roadmap_message_format(text, sizeof(text), "%A|%T"))
    return &text[0];
  return "";
}


x86 assembly (clang, -O0):
<get_time_to_destination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f21(%rip),%rdi
mov    $0x100,%esi
lea    0xed5(%rip),%rdx
call   1030 <roadmap_message_format@plt>
cmp    $0x0,%rax
je     114a <get_time_to_destination+0x3a>
lea    0x2eff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <get_time_to_destination+0x45>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_to_destination>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <roadmap_message_format@plt>
test   %rax,%rax
lea    0xecf(%rip),%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_time_to_destination.text = internal global [256 x i8] zeroinitializer
@.str = [6 x i8] c"%A|%T\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @get_time_to_destination() {
%1 = alloca i8*
%2 = call i64 @roadmap_message_format(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_time_to_destination.text, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_time_to_destination.text, i64 0, i64 0), i8** %1
br label %6
5: ; preds = %0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@get_time_to_destination.text = internal global [256 x i8] zeroinitializer
@.str = [6 x i8] c"%A|%T\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @get_time_to_destination() {
%1 = tail call i64 @roadmap_message_format(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_time_to_destination.text, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_time_to_destination.text, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int main(void) {
  ~INT_MAX;
  return 0;
}


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

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

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main() {
ret i32 0
}
void SensorSetBrightness_FUJITSU(unsigned char val) {}


x86 assembly (clang, -O0):
<SensorSetBrightness_FUJITSU>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SensorSetBrightness_FUJITSU(i8 zeroext %0) {
ret void
}
long long longlong_ignoring_unsignedlonglongint(long long x,
                                                unsigned long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<longlong_ignoring_unsignedlonglongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longlong_ignoring_unsignedlonglongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlong_ignoring_unsignedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
int is_bigendian(void) {
  unsigned char i[sizeof(int)] = {0};
  i[sizeof(int) - 1] = 1;
  int *p = (int *)i;
  return *p == 1;
}


x86 assembly (clang, -O0):
<is_bigendian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movb   $0x1,-0x1(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_bigendian() {
%1 = alloca [4 x i8]
%2 = alloca i32*
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 3
store i8 1, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
ret i32 %10
}

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