xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print_4(char *);
int /*<<< orphan*/ println_6();
void println_5(char *s_19) {
  print_4(s_19);
  println_6();
}


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

x86 assembly (clang, -O2):
<println_5>:
push   %rax
call   1040 <print_4@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <println_6@plt>

LLVM IR (-O0):
define void @println_5(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print_4(i8* %3)
%5 = call i32 (...) @println_6()
ret void
}

LLVM IR (-O2):
define void @println_5(i8* %0) {
%2 = tail call i32 @print_4(i8* %0)
%3 = tail call i32 (...) @println_6()
ret void
}
void leds_init(void) {
  (*(volatile unsigned long *)0x7F008800) &=
      ~((0xf << (4 * 4)) + (0xf << (5 * 4)) + (0xf << (6 * 4)) +
        (0xf << (7 * 4)));
  (*(volatile unsigned long *)0x7F008800) |=
      ((1 << (4 * 4)) + (1 << (5 * 4)) + (1 << (6 * 4)) + (1 << (7 * 4)));
}


x86 assembly (clang, -O0):
<leds_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008800,%eax
mov    (%rax),%rcx
and    $0xffff,%rcx
mov    $0x7f008800,%eax
mov    %rcx,(%rax)
mov    $0x7f008800,%eax
mov    (%rax),%rcx
or     $0x11110000,%rcx
mov    $0x7f008800,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<leds_init>:
andq   $0xffff,0x7f008800
orq    $0x11110000,0x7f008800
ret

LLVM IR (-O0):
define void @leds_init() {
%1 = load volatile i64, i64* inttoptr (i64 2130741248 to i64*)
%2 = and i64 %1, 65535
store volatile i64 %2, i64* inttoptr (i64 2130741248 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130741248 to i64*)
%4 = or i64 %3, 286326784
store volatile i64 %4, i64* inttoptr (i64 2130741248 to i64*)
ret void
}

LLVM IR (-O2):
define void @leds_init() {
%1 = load volatile i64, i64* inttoptr (i64 2130741248 to i64*)
%2 = and i64 %1, 65535
store volatile i64 %2, i64* inttoptr (i64 2130741248 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130741248 to i64*)
%4 = or i64 %3, 286326784
store volatile i64 %4, i64* inttoptr (i64 2130741248 to i64*)
ret void
}
struct protoent *getprotoent() {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<getprotoent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    112b <getprotoent+0x1b>

x86 assembly (clang, -O2):
<getprotoent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <getprotoent+0x20>

LLVM IR (-O0):
%struct.protoent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getprotoent = [12 x i8] c"getprotoent\00"
define %struct.protoent* @getprotoent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.getprotoent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
%struct.protoent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getprotoent = [12 x i8] c"getprotoent\00"
define %struct.protoent* @getprotoent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.getprotoent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ test_rle_binary_format();
int /*<<< orphan*/ test_rle_decompression();
int /*<<< orphan*/ test_rle_no_overflow();
int main(void) {
  test_rle_binary_format();
  test_rle_decompression();
  test_rle_no_overflow();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_rle_binary_format()
%2 = tail call i32 (...) @test_rle_decompression()
%3 = tail call i32 (...) @test_rle_no_overflow()
ret i32 0
}
/* Variables and functions */
int core6_swap(char *, int);
int U_EMRPOLYGON16_swap(char *record, int torev) {
  return (core6_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYGON16_swap>:
jmp    1030 <core6_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYGON16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core6_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int debug_ev(int fd, int mask) {
  printf("fd is %d, event(%s)\n", fd,
         mask & 0x01 ? "read" : (mask & 0x02 ? "write" : "unknown"));
  return 0;
}


x86 assembly (clang, -O0):
<debug_ev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1143 <debug_ev+0x33>
lea    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1162 <debug_ev+0x52>
mov    -0x8(%rbp),%edx
and    $0x2,%edx
lea    0xed0(%rip),%rax
lea    0xec3(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_ev>:
push   %rax
mov    %edi,%eax
test   $0x2,%sil
lea    0xf02(%rip),%rcx
lea    0xef5(%rip),%rdi
cmove  %rcx,%rdi
test   $0x1,%sil
lea    0xee1(%rip),%rdx
cmove  %rdi,%rdx
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"fd is %d, event(%s)\0A\00"
@.str.1 = [5 x i8] c"read\00"
@.str.2 = [6 x i8] c"write\00"
@.str.3 = [8 x i8] c"unknown\00"
define i32 @debug_ev(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 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0)
br label %16
16: ; preds = %10, %9
%17 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %9 ], [ %15, %10 ]
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"fd is %d, event(%s)\0A\00"
@.str.1 = [5 x i8] c"read\00"
@.str.2 = [6 x i8] c"write\00"
@.str.3 = [8 x i8] c"unknown\00"
define i32 @debug_ev(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
%5 = and i32 %1, 2
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%8 = select i1 %4, i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ net_send_open_close(int, int, char *, int /*<<< orphan*/);
void net_send_open(int fd, int cpu, char *buts_name) {
  net_send_open_close(fd, cpu, buts_name, 0);
}


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

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

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

LLVM IR (-O2):
define void @net_send_open(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @net_send_open_close(i32 %0, i32 %1, i8* %2, i32 0)
ret void
}
int solib_wrapper(function) int (*function)(int);
{ return (*function)(100); }


x86 assembly (clang, -O0):
<solib_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solib_wrapper>:
mov    %rdi,%rax
mov    $0x64,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @solib_wrapper(i32 (i32)* nocapture %0) {
%2 = tail call i32 %0(i32 100)
ret i32 %2
}
int absolute(int i) { return (i < 0) ? -i : i; }


x86 assembly (clang, -O0):
<absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <absolute+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absolute+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absolute(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int wordchar(int ch) {
  return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') ||
         (ch >= '0' && ch <= '9');
}


x86 assembly (clang, -O0):
<wordchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <wordchar+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <wordchar+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <wordchar+0x39>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <wordchar+0x58>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <wordchar+0x52>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordchar>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @wordchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @wordchar(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fshut(int /*<<< orphan*/ *, char const *);
void enfshut(int status, FILE *fp, const char *fname) {
  if (fshut(fp, fname))
    exit(status);
}


x86 assembly (clang, -O0):
<enfshut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fshut@plt>
cmp    $0x0,%rax
je     1152 <enfshut+0x32>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enfshut>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <fshut@plt>
test   %rax,%rax
jne    1135 <enfshut+0x15>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @enfshut(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %5
%8 = load i8*, i8** %6
%9 = call i64 @fshut(i32* %7, i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %4
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @enfshut(i32 %0, i32* %1, i8* %2) {
%4 = tail call i64 @fshut(i32* %1, i8* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @exit(i32 %0)
unreachable
8: ; preds = %3
ret void
}
char *gettext(msgid) const char *msgid;
{ return libintl_gettext(msgid); }


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

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

LLVM IR (-O0):
define i8* @gettext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @libintl_gettext to i32 (i8*, ...)*)(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @gettext(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @libintl_gettext to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x1c() {
  Assert_real((isbdigit(28) == 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_isbdigit.c",
              145, ("isbdigit should be 0 for 0x1c"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x1c>:
push   %rax
mov    $0x1c,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x91,%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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1c\00"
define void @t_isbdigit_0x1c() {
%1 = call i64 @isbdigit(i32 28)
%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 145, 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1c\00"
define void @t_isbdigit_0x1c() {
%1 = tail call i64 @isbdigit(i32 28)
%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 145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t CVTTLD_SI64(long double ld) { return (int64_t)ld; }


x86 assembly (clang, -O0):
<CVTTLD_SI64>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x16(%rbp)
movzwl -0x16(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x18(%rbp)
fldcw  -0x18(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x16(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CVTTLD_SI64>:
fldt   0x8(%rsp)
fnstcw -0x8(%rsp)
movzwl -0x8(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x6(%rsp)
fldcw  -0x6(%rsp)
fistpl -0x4(%rsp)
fldcw  -0x8(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @CVTTLD_SI64(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptosi x86_fp80 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @CVTTLD_SI64(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int read(int, char *, int);
int sysfs_fd_get_str(int fd, char *val, int size) {
  int n;
  lseek(fd, 0, 0);
  n = read(fd, val, size);
  if (n <= 0)
    return -1;
  val[n] = 0;
  return n;
}


x86 assembly (clang, -O0):
<sysfs_fd_get_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <lseek@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1166 <sysfs_fd_get_str+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <sysfs_fd_get_str+0x58>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_fd_get_str>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %esi,%esi
xor    %edx,%edx
call   1030 <lseek@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    114e <sysfs_fd_get_str+0x2e>
mov    %eax,%ecx
movb   $0x0,(%rbx,%rcx,1)
jmp    1153 <sysfs_fd_get_str+0x33>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sysfs_fd_get_str(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 0, i32 0)
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ %5, %7 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
char *strdup(char *);
char *get_window_name(void) { return strdup(" "); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define noalias i8* @get_window_name() {
%1 = tail call dereferenceable_or_null(2) i8* @strdup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ put_char(unsigned int);
void put_word(unsigned w) {
  put_char(w);
  put_char(w >> 8);
  put_char(w >> 16);
  put_char(w >> 24);
}


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

x86 assembly (clang, -O2):
<put_word>:
push   %rbx
mov    %edi,%ebx
call   1030 <put_char@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <put_char@plt>
mov    %ebx,%edi
shr    $0x10,%edi
call   1030 <put_char@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put_char@plt>

LLVM IR (-O0):
define void @put_word(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @put_char(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = call i32 @put_char(i32 %6)
%8 = load i32, i32* %2
%9 = lshr i32 %8, 16
%10 = call i32 @put_char(i32 %9)
%11 = load i32, i32* %2
%12 = lshr i32 %11, 24
%13 = call i32 @put_char(i32 %12)
ret void
}

LLVM IR (-O2):
define void @put_word(i32 %0) {
%2 = tail call i32 @put_char(i32 %0)
%3 = lshr i32 %0, 8
%4 = tail call i32 @put_char(i32 %3)
%5 = lshr i32 %0, 16
%6 = tail call i32 @put_char(i32 %5)
%7 = lshr i32 %0, 24
%8 = tail call i32 @put_char(i32 %7)
ret void
}
/* Variables and functions */
int f(int);
int main(void) {
  f(f(1));
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @f(i32 %1)
ret i32 0
}
void setnetent(int stayopen) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<setnetent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1132 <setnetent+0x22>

x86 assembly (clang, -O2):
<setnetent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <setnetent+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.setnetent = [10 x i8] c"setnetent\00"
define void @setnetent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.setnetent, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.setnetent = [10 x i8] c"setnetent\00"
define void @setnetent(i32 %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.setnetent, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ putbyte(unsigned char);
void onebyte(int co) { putbyte((unsigned char)co); }


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

x86 assembly (clang, -O2):
<onebyte>:
movzbl %dil,%edi
jmp    1030 <putbyte@plt>

LLVM IR (-O0):
define void @onebyte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @putbyte(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @onebyte(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @putbyte(i8 zeroext %2)
ret void
}
/* Variables and functions */
double rint(double);
double nearbyint(double x) {
  x = rint(x);
  return x;
}


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

x86 assembly (clang, -O2):
<nearbyint>:
jmp    1030 <rint@plt>

LLVM IR (-O0):
define double @nearbyint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.rint.f64(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @nearbyint(double %0) {
%2 = tail call double @llvm.rint.f64(double %0)
ret double %2
}
void gentlbp() {}


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

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

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

LLVM IR (-O2):
define void @gentlbp() {
ret void
}
int new_var() {
  static int index = 1;
  return index++;
}


x86 assembly (clang, -O0):
<new_var>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_var>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@new_var.index = internal global i32 1
define i32 @new_var() {
%1 = load i32, i32* @new_var.index
%2 = add nsw i32 %1, 1
store i32 %2, i32* @new_var.index
ret i32 %1
}

LLVM IR (-O2):
@new_var.index = internal unnamed_addr global i32 1
define i32 @new_var() {
%1 = load i32, i32* @new_var.index
%2 = add nsw i32 %1, 1
store i32 %2, i32* @new_var.index
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char *, int);
int /*<<< orphan*/ val_is_ok(int);
int val_to_hash(int val, int ply) {
  if ((2) <= 1 && !(val_is_ok(val)))
    fatal_error("%s:%u: Assertion '"
                "val_is_ok(val)"
                "' failed.",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/cutechess/sloppy/refs/heads/"
                "master/src/hash.c",
                154);
  ;
  if (val < -5000)
    val -= ply;
  else if (val > 5000)
    val += ply;
  if ((2) <= 1 && !(val_is_ok(val)))
    fatal_error("%s:%u: Assertion '"
                "val_is_ok(val)"
                "' failed.",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/cutechess/sloppy/refs/heads/"
                "master/src/hash.c",
                161);
  ;
  return val;
}


x86 assembly (clang, -O0):
<val_to_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffec78,-0x4(%rbp)
jge    1127 <val_to_hash+0x27>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_to_hash+0x42>
cmpl   $0x1388,-0x4(%rbp)
jle    113d <val_to_hash+0x3d>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_to_hash+0x42>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_to_hash>:
xor    %eax,%eax
cmp    $0x1389,%edi
cmovge %esi,%eax
neg    %esi
cmp    $0xffffec78,%edi
cmovl  %esi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @val_to_hash(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, -5000
%4 = icmp sgt i32 %0, 5000
%5 = select i1 %4, i32 %1, i32 0
%6 = sub i32 0, %1
%7 = select i1 %3, i32 %6, i32 %5
%8 = add i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int main() {
  while (1)
    fork();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fork@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fork@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @fork()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @fork()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ __gmpf_set_default_prec(unsigned int);
void set_default_prec_mpf(unsigned int prec) { __gmpf_set_default_prec(prec); }


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

x86 assembly (clang, -O2):
<set_default_prec_mpf>:
jmp    1030 <__gmpf_set_default_prec@plt>

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

LLVM IR (-O2):
define void @set_default_prec_mpf(i32 %0) {
%2 = tail call i32 @__gmpf_set_default_prec(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ stdin;
void fig08_10() {
  char sentence[80];
  puts("Enter a line of text:");
  fgets(sentence, 80, stdin);
  puts("\nThe line printed backward is:");
  reverse(sentence);
}


x86 assembly (clang, -O0):
<fig08_10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
lea    -0x50(%rbp),%rdi
call   1030 <reverse@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig08_10>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter a line of text:\00"
@stdin = global i32 0
@.str.1 = [31 x i8] c"\0AThe line printed backward is:\00"
define void @fig08_10() {
%1 = alloca [80 x i8]
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 80, i32 %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%8 = call i32 @reverse(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter a line of text:\00"
@stdin = global i32 0
@.str.1 = [31 x i8] c"\0AThe line printed backward is:\00"
define void @fig08_10() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 80, i32 %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @reverse(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addnchar(char *, long);
int /*<<< orphan*/ closeandpush();
char *luaL_check_lstr(int, long *);
scalar_t__ luaL_check_number(int);
int /*<<< orphan*/ luaL_resetbuffer();
void str_rep(void) {
  long l;
  char *s = luaL_check_lstr(1, &l);
  int n = ((int)luaL_check_number(2));
  luaL_resetbuffer();
  while (n-- > 0)
    addnchar(s, l);
  closeandpush();
}


x86 assembly (clang, -O0):
<str_rep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
call   1070 <luaL_check_lstr@plt>
mov    %rax,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <luaL_check_number@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <luaL_resetbuffer@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    11a4 <str_rep+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <addnchar@plt>
jmp    117e <str_rep+0x2e>
mov    $0x0,%al
call   1050 <closeandpush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_rep>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%rsi
mov    $0x1,%edi
call   1070 <luaL_check_lstr@plt>
mov    %rax,%r14
mov    $0x2,%edi
call   1040 <luaL_check_number@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <luaL_resetbuffer@plt>
test   %ebx,%ebx
jle    1194 <str_rep+0x44>
add    $0x1,%ebx
nop
mov    (%rsp),%rsi
mov    %r14,%rdi
call   1030 <addnchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1180 <str_rep+0x30>
xor    %eax,%eax
call   1050 <closeandpush@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @str_rep() {
%1 = alloca i64
%2 = alloca i8*
%3 = alloca i32
%4 = call i8* @luaL_check_lstr(i32 1, i64* %1)
store i8* %4, i8** %2
%5 = call i64 @luaL_check_number(i32 2)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = call i32 (...) @luaL_resetbuffer()
br label %8
8: ; preds = %12, %0
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
%11 = icmp sgt i32 %9, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i64, i64* %1
%15 = call i32 @addnchar(i8* %13, i64 %14)
br label %8
16: ; preds = %8
%17 = call i32 (...) @closeandpush()
ret void
}

LLVM IR (-O2):
define void @str_rep() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i8* @luaL_check_lstr(i32 1, i64* %1)
%4 = call i64 @luaL_check_number(i32 2)
%5 = trunc i64 %4 to i32
%6 = call i32 (...) @luaL_resetbuffer()
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %14
8: ; preds = %0, %8
%9 = phi i32 [ %10, %8 ], [ %5, %0 ]
%10 = add nsw i32 %9, -1
%11 = load i64, i64* %1
%12 = call i32 @addnchar(i8* %3, i64 %11)
%13 = icmp ugt i32 %9, 1
br i1 %13, label %8, label %14
14: ; preds = %8, %0
%15 = call i32 (...) @closeandpush()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ safeRead(int const, unsigned char *, int);
int /*<<< orphan*/ unmarshallInt(unsigned char *, int *const);
void ReadInt(int const socketFd, int *const valueP) {
  unsigned char buffer[4];
  safeRead(socketFd, buffer, sizeof(buffer));
  unmarshallInt(buffer, valueP);
}


x86 assembly (clang, -O0):
<ReadInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <safeRead@plt>
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <unmarshallInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadInt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <safeRead@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <unmarshallInt@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ReadInt(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = call i32 @safeRead(i32 %6, i8* %7, i32 4)
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @unmarshallInt(i8* %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @ReadInt(i32 %0, i32* %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @safeRead(i32 %0, i8* %4, i32 4)
%6 = call i32 @unmarshallInt(i8* %4, i32* %1)
ret void
}
/* Variables and functions */
int islower(unsigned char);
int isLower(const char *ptr) { return islower(*(unsigned char *)ptr); }


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

x86 assembly (clang, -O2):
<isLower>:
movzbl (%rdi),%edi
jmp    1030 <islower@plt>

LLVM IR (-O0):
define i32 @isLower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @islower(i8 zeroext %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @isLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @islower(i8 zeroext %2)
ret i32 %3
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_set_watchdog(void *e,
                                                                 int b) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_set_watchdog>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_set_watchdog>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_set_watchdog(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_set_watchdog(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fmaxf(float, float);
float sqrtf(int /*<<< orphan*/);
void __hv_sqrt_f(float bIn, float *bOut) { *bOut = sqrtf(fmaxf(0.0f, bIn)); }


x86 assembly (clang, -O0):
<__hv_sqrt_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
xorps  %xmm0,%xmm0
call   1030 <fmaxf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_sqrt_f>:
push   %rbx
mov    %rdi,%rbx
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
call   1030 <fmaxf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_sqrt_f(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = call i32 @fmaxf(float 0.000000e+00, float %5)
%7 = call float @sqrtf(i32 %6)
%8 = load float*, float** %4
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @__hv_sqrt_f(float %0, float* nocapture writeonly %1) {
%3 = tail call i32 @fmaxf(float 0.000000e+00, float %0)
%4 = tail call float @sqrtf(i32 %3)
store float %4, float* %1
ret void
}
int cube_element_in_bintree(int x) { return x * x * x; }


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

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

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

LLVM IR (-O2):
define i32 @cube_element_in_bintree(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int readint0(int *);
int test0(int *x) { return readint0(x); }


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

x86 assembly (clang, -O2):
<test0>:
jmp    1030 <readint0@plt>

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

LLVM IR (-O2):
define i32 @test0(i32* %0) {
%2 = tail call i32 @readint0(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ f0();
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
void test() {
  f0();
  f1();
  f2();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f0@plt>
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1040 <f2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1030 <f0@plt>
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <f2@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 (...) @f0()
%2 = call i32 (...) @f1()
%3 = call i32 (...) @f2()
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @f0()
%2 = tail call i32 (...) @f1()
%3 = tail call i32 (...) @f2()
ret void
}
void arm_early_mmu_cache_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @arm_early_mmu_cache_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int A = 25;
  int B = 16;
  int C = 7;
  int D = 4;
  int E = 9;
  int *ptrA = &A;
  int *ptrB = &B;
  int *ptrC = &C;
  int *ptrD = &D;
  int *ptrE = &E;
  int result1 = ((*ptrA - *ptrB) * (*ptrC + *ptrD)) / *ptrE;
  printf("%d", result1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x19,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x9,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
sub    (%rcx),%eax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x38(%rbp),%rdx
add    (%rdx),%ecx
imul   %ecx,%eax
mov    -0x40(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}