xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[3] = {1, 2, 3};
  printf("byte size: %d\n", sizeof(a));
  printf("array length: %d\n", sizeof(a) / sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    0xed2(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [15 x i8] c"byte size: %d\0A\00"
@.str.1 = [18 x i8] c"array length: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"byte size: %d\0A\00"
@.str.1 = [18 x i8] c"array length: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
void SysCtlWakeUpPinDisable(void) {
  (*((volatile unsigned long *)(0x40007004))) &= ~0x00000100;
}


x86 assembly (clang, -O0):
<SysCtlWakeUpPinDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40007004,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffeff,%rcx
mov    $0x40007004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlWakeUpPinDisable>:
andq   $0xfffffffffffffeff,0x40007004
40 ff fe ff ff
ret

LLVM IR (-O0):
define void @SysCtlWakeUpPinDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770500 to i64*)
%2 = and i64 %1, -257
store volatile i64 %2, i64* inttoptr (i64 1073770500 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlWakeUpPinDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770500 to i64*)
%2 = and i64 %1, -257
store volatile i64 %2, i64* inttoptr (i64 1073770500 to i64*)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ stat(char const *, struct stat *);
int /*<<< orphan*/ stderr;
mode_t misc_device_mode(const char *device) {
  struct stat st;
  if (stat(device, &st) == 0)
    return st.st_mode;
  fprintf(stderr, "Stat of the device '%s' failed.", device);
  exit(8);
}


x86 assembly (clang, -O0):
<misc_device_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    115c <misc_device_mode+0x2c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x8,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<misc_device_mode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1151 <misc_device_mode+0x21>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x8,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"Stat of the device '%s' failed.\00"
define i32 @misc_device_mode(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 8)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"Stat of the device '%s' failed.\00"
define i32 @misc_device_mode(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = call i32 @exit(i32 8)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ get_top();
int main(void) {
  if (get_top() == 0) {
    return 0;
  }
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_top@plt>
cmp    $0x0,%rax
jne    114c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    115a <main+0x3a>
xor    %edi,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_top@plt>
test   %rax,%rax
je     1134 <main+0x14>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @get_top()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 @assert(i32 0)
store i32 0, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @get_top()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @assert(i32 0)
br label %5
5: ; preds = %0, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void show_usage() {
  printf("Usage: sock2serial [OPTIONS] -s serial-port\n"
         "Sock2serial is a tool for serial and tcp data transmission\nIt's "
         "just like ser2net, but lighter.\n"
         "Misc:\n"
         "   -h, --help         print this usage message, then exit\n"
         "   -v, --version      print version number, then exit\n"
         "   -s, --serial       set serial port\n"
         "   -b, --baud         set serial baud(default as %d)\n"
         "   -p, --tcp-port     set tcp bind port(default as %d)\n\n",
         57600, 2001);
  exit(1);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0xe100,%esi
mov    $0x7d1,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xe100,%esi
mov    $0x7d1,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [406 x i8] c"Usage: sock2serial [OPTIONS] -s serial-port\0ASock2serial is a tool for serial and tcp data transmission\0AIt's just like ser2net, but lighter.\0AMisc:\0A -h, --help print this usage message, then exit\0A -v, --version print version number, then exit\0A -s, --serial set serial port\0A -b, --baud set serial baud(default as %d)\0A -p, --tcp-port set tcp bind port(default as %d)\0A\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([406 x i8], [406 x i8]* @.str, i64 0, i64 0), i32 57600, i32 2001)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [406 x i8] c"Usage: sock2serial [OPTIONS] -s serial-port\0ASock2serial is a tool for serial and tcp data transmission\0AIt's just like ser2net, but lighter.\0AMisc:\0A -h, --help print this usage message, then exit\0A -v, --version print version number, then exit\0A -s, --serial set serial port\0A -b, --baud set serial baud(default as %d)\0A -p, --tcp-port set tcp bind port(default as %d)\0A\0A\00"
define void @show_usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([406 x i8], [406 x i8]* @.str, i64 0, i64 0), i32 57600, i32 2001)
%2 = tail call i32 @exit(i32 1)
unreachable
}
void RealMainP$Boot$booted(void) { BlinkNoTimerTaskC$Boot$booted(); }


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

x86 assembly (clang, -O2):
<RealMainP$Boot$booted>:
xor    %eax,%eax
jmp    1030 <BlinkNoTimerTaskC$Boot$booted@plt>

LLVM IR (-O0):
define void @"RealMainP$Boot$booted"() {
%1 = call i32 (...) @"BlinkNoTimerTaskC$Boot$booted"()
ret void
}

LLVM IR (-O2):
define void @"RealMainP$Boot$booted"() {
%1 = tail call i32 (...) @"BlinkNoTimerTaskC$Boot$booted"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seq_engine_get_current_scene();
int song_get_arp_enable(int /*<<< orphan*/, int);
int seq_ctrl_get_arp_enable(int track) {
  return song_get_arp_enable(seq_engine_get_current_scene(), track);
}


x86 assembly (clang, -O0):
<seq_ctrl_get_arp_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <seq_engine_get_current_scene@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <song_get_arp_enable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_ctrl_get_arp_enable>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <seq_engine_get_current_scene@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <song_get_arp_enable@plt>

LLVM IR (-O0):
define i32 @seq_ctrl_get_arp_enable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @seq_engine_get_current_scene()
%4 = load i32, i32* %2
%5 = call i32 @song_get_arp_enable(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @seq_ctrl_get_arp_enable(i32 %0) {
%2 = tail call i32 (...) @seq_engine_get_current_scene()
%3 = tail call i32 @song_get_arp_enable(i32 %2, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_disconnection_complete_get_status(const uint8_t *event) {
  return event[2];
}


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

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

LLVM IR (-O0):
define i32 @hci_event_disconnection_complete_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_disconnection_complete_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
int compare_int(void *a, void *b) { return *(int *)a - *(int *)b; }


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

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

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

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *string(const char *str) {
  static char buffer[256];
  strncpy(buffer, str, sizeof(buffer));
  return buffer;
}


x86 assembly (clang, -O0):
<string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f19(%rip),%rdi
mov    $0x100,%edx
call   1030 <strncpy@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f25(%rip),%rbx
mov    %rbx,%rdi
mov    $0x100,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@string.buffer = internal global [256 x i8] zeroinitializer
define i8* @string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @string.buffer, i64 0, i64 0), i8* %3, i32 256)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @string.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@string.buffer = internal global [256 x i8] zeroinitializer
define i8* @string(i8* %0) {
%2 = tail call i32 @strncpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @string.buffer, i64 0, i64 0), i8* %0, i32 256)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @string.buffer, i64 0, i64 0)
}
void foo3e() {}


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

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

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

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

/* Variables and functions */
int real_getsockopt(int, int, int, void *, int /*<<< orphan*/ *);
int getsockopt(int fd, int level, int option_name, void *restrict option_value,
               socklen_t *restrict option_len) {
  return real_getsockopt(fd, level, option_name, option_value, option_len);
}


x86 assembly (clang, -O0):
<getsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <real_getsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockopt>:
jmp    1030 <real_getsockopt@plt>

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

LLVM IR (-O2):
define i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* noalias %3, i32* noalias %4) {
%6 = tail call i32 @real_getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
scalar_t__ C_islower(int);
int C_toupper(int c) {
  { return C_islower(c) ? (c - 'a' + 'A') : c; }
}


x86 assembly (clang, -O0):
<C_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <C_islower@plt>
cmp    $0x0,%rax
je     113e <C_toupper+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <C_toupper+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <C_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @C_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @C_islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 97
%9 = add nsw i32 %8, 65
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @C_toupper(i32 %0) {
%2 = tail call i64 @C_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
__attribute__((const)) int av_isspace(int c) {
  return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
         c == '\v';
}


x86 assembly (clang, -O0):
<av_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <av_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <av_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <av_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <av_isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <av_isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_isspace>:
cmp    $0x20,%edi
ja     111d <av_isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <av_isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @av_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct ip {
  int /*<<< orphan*/ ip_off;
};

/* Variables and functions */
int ntohs(int /*<<< orphan*/);
int get_ip_frag_off(struct ip *self) { return ntohs(self->ip_off); }


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

x86 assembly (clang, -O2):
<get_ip_frag_off>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.ip = type { i32 }
define i32 @get_ip_frag_off(%struct.ip* %0) {
%2 = alloca %struct.ip*
store %struct.ip* %0, %struct.ip** %2
%3 = load %struct.ip*, %struct.ip** %2
%4 = getelementptr inbounds %struct.ip, %struct.ip* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i32 @get_ip_frag_off(%struct.ip* nocapture %0) {
%2 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x65() {
  Assert_real((ispunct(101) == 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_ispunct.c",
              510, ("ispunct should be 0 for e"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x65>:
push   %rax
mov    $0x65,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1fe,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for e\00"
define void @t_ispunct_0x65() {
%1 = call i64 @ispunct(i32 101)
%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 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for e\00"
define void @t_ispunct_0x65() {
%1 = tail call i64 @ispunct(i32 101)
%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 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ft_nbrmin(int n1, int n2) { return ((n1 < n2) ? n1 : n2); }


x86 assembly (clang, -O0):
<ft_nbrmin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <ft_nbrmin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <ft_nbrmin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrmin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_nbrmin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_nbrmin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int stat(const char *file, struct stat *st) { return -1; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @stat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
double my_random_double();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ srandom(int);
main(int argc, char *argv[]) {
  int i;
  double d;
  double t0, t1;
  int iters = 1000;
  int seed = 17;
  srandom(seed);
  for (i = 0; i < iters; i++) {
    d = my_random_double();
    printf("%f\n", d);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x34(%rbp)
movl   $0x11,-0x38(%rbp)
mov    -0x38(%rbp),%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    119a <main+0x6a>
mov    $0x0,%al
call   1050 <my_random_double@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x11,%edi
call   1030 <srandom@plt>
mov    $0x3e8,%ebp
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <my_random_double@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %10
store i32 17, i32* %11
%12 = load i32, i32* %11
%13 = call i32 @srandom(i32 %12)
store i32 0, i32* %6
br label %14
14: ; preds = %22, %2
%15 = load i32, i32* %6
%16 = load i32, i32* %10
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = call double (...) @my_random_double()
store double %19, double* %7
%20 = load double, double* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %14
25: ; preds = %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srandom(i32 17)
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call double (...) @my_random_double()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 0
}
/* Variables and functions */
char *string_escape_character_array(char *, char *, char *);
char *string_escape(char *destination, char *source, char *character_array) {
  return string_escape_character_array(destination, source, character_array);
}


x86 assembly (clang, -O0):
<string_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <string_escape_character_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_escape>:
jmp    1030 <string_escape_character_array@plt>

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

LLVM IR (-O2):
define i8* @string_escape(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @string_escape_character_array(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ random_uint32();
int32_t random_int32() { return (int32_t)random_uint32(); }


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

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

LLVM IR (-O0):
define i32 @random_int32() {
%1 = call i32 (...) @random_uint32()
ret i32 %1
}

LLVM IR (-O2):
define i32 @random_int32() {
%1 = tail call i32 (...) @random_uint32()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int a[], int n) {
  for (int i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ tgamma(double);
int /*<<< orphan*/ tgammaf(float);
int /*<<< orphan*/ tgammal(long double);
void uninitvar_tgamma(void) {
  float f;
  (void)tgammaf(f);
  double d;
  (void)tgamma(d);
  long double ld;
  (void)tgammal(ld);
}


x86 assembly (clang, -O0):
<uninitvar_tgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1050 <tgammaf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <tgamma@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <tgammal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_tgamma>:
sub    $0x18,%rsp
call   1050 <tgammaf@plt>
call   1030 <tgamma@plt>
call   1040 <tgammal@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_tgamma() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @tgammaf(float %4)
%6 = load double, double* %2
%7 = call i32 @tgamma(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @tgammal(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_tgamma() {
%1 = tail call i32 @tgammaf(float undef)
%2 = tail call i32 @tgamma(double undef)
%3 = tail call i32 @tgammal(x86_fp80 undef)
ret void
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t __attribute__((always_)) inb(uint16_t port) {
  uint8_t data;
  __asm__ volatile("inb %w1, %b0" : "=a"(data) : "Nd"(port));
  return data;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inb(i32 %0) {
%2 = tail call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ cleanup(int);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void onsig(int signo) {
  (void)cleanup(1);
  (void)signal(signo, SIG_DFL);
  (void)kill(getpid(), signo);
  _exit(1);
}


x86 assembly (clang, -O0):
<onsig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1070 <cleanup@plt>
mov    -0x4(%rbp),%edi
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1060 <kill@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<onsig>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1070 <cleanup@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1050 <signal@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1060 <kill@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
define void @onsig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @cleanup(i32 1)
%4 = load i32, i32* %2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = call i32 (...) @getpid()
%8 = load i32, i32* %2
%9 = call i32 @kill(i32 %7, i32 %8)
%10 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
define void @onsig(i32 %0) {
%2 = tail call i32 @cleanup(i32 1)
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @kill(i32 %5, i32 %0)
%7 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ log_enterexit_func(char *, char *, char const *);
void log_enter_ecall(const char *func) {
  log_enterexit_func("enter", "ecall", func);
}


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

x86 assembly (clang, -O2):
<log_enter_ecall>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <log_enterexit_func@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"enter\00"
@.str.1 = [6 x i8] c"ecall\00"
define void @log_enter_ecall(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_enterexit_func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"enter\00"
@.str.1 = [6 x i8] c"ecall\00"
define void @log_enter_ecall(i8* %0) {
%2 = tail call i32 @log_enterexit_func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int isInAng(double ang, double ang1, double ang2) {
  int ok = 0;
  if (ang2 > ang1) {
    if (ang >= ang1 && ang <= ang2)
      ok = 1;
  } else if (ang >= ang1 || ang <= ang2)
    ok = 1;
  return ok;
}


x86 assembly (clang, -O0):
<isInAng>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115a <isInAng+0x5a>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1155 <isInAng+0x55>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1155 <isInAng+0x55>
movl   $0x1,-0x1c(%rbp)
jmp    118a <isInAng+0x8a>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    117e <isInAng+0x7e>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1185 <isInAng+0x85>
movl   $0x1,-0x1c(%rbp)
jmp    118a <isInAng+0x8a>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInAng>:
ucomisd %xmm1,%xmm2
jbe    111a <isInAng+0x1a>
ucomisd %xmm0,%xmm2
setae  %cl
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%eax
ret
ucomisd %xmm0,%xmm2
setae  %cl
ucomisd %xmm1,%xmm0
setae  %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isInAng(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store i32 0, i32* %7
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %21
11: ; preds = %3
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fcmp oge double %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load double, double* %4
%17 = load double, double* %6
%18 = fcmp ole double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %7
br label %20
20: ; preds = %19, %15, %11
br label %31
21: ; preds = %3
%22 = load double, double* %4
%23 = load double, double* %5
%24 = fcmp oge double %22, %23
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load double, double* %4
%27 = load double, double* %6
%28 = fcmp ole double %26, %27
br i1 %28, label %29, label %30
29: ; preds = %25, %21
store i32 1, i32* %7
br label %30
30: ; preds = %29, %25
br label %31
31: ; preds = %30, %20
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @isInAng(double %0, double %1, double %2) {
%4 = fcmp ogt double %2, %1
%5 = fcmp oge double %0, %1
%6 = fcmp ole double %0, %2
br i1 %4, label %7, label %9
7: ; preds = %3
%8 = and i1 %5, %6
br label %11
9: ; preds = %3
%10 = or i1 %5, %6
br label %11
11: ; preds = %9, %7
%12 = phi i1 [ %8, %7 ], [ %10, %9 ]
%13 = zext i1 %12 to i32
ret i32 %13
}
int foo(int k, int N) {
  while (k < N) {
    int i = 0;
    int j = k;
    while (i < j) {
      i = i + 1;
      j = j - 1;
    }
    k = k + 1;
  }
  return k;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1154 <foo+0x54>
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1146 <foo+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <foo+0x23>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110a <foo+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void RRG() {}


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

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

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

LLVM IR (-O2):
define void @RRG() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void explain(void) {
  fprintf(stderr, "Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ "
                  "mtu BYTES[/BYTES] ]\n");
  fprintf(stderr, "               [ peakrate KBPS ] [ latency TIME ]\n");
}


x86 assembly (clang, -O0):
<explain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf17(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<explain>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf21(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ mtu BYTES[/BYTES] ]\0A\00"
@.str.1 = [51 x i8] c" [ peakrate KBPS ] [ latency TIME ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ mtu BYTES[/BYTES] ]\0A\00"
@.str.1 = [51 x i8] c" [ peakrate KBPS ] [ latency TIME ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int member_0;
  int member_1;
  int member_2;
};

/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t14() {
  struct {
    int a[3];
  } v = {{1, 2, 3}};
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          123, 2, v.a[1]);
  ;
}


x86 assembly (clang, -O0):
<t14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xed6(%rip),%rdi
mov    $0x7b,%esi
mov    $0x2,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t14>:
lea    0xee9(%rip),%rdi
mov    $0x7b,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.anon = type { [3 x i32] }
@__const.t14.v = %struct.anon { [3 x i32] [i32 1, i32 2, i32 3] }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t14() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
%3 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%5 = load i32, i32* %4
%6 = call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 123, i32 2, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t14() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 123, i32 2, i32 2)
ret void
}
/* Type definitions */
typedef scalar_t__ val;
typedef int uint32_t;

/* Variables and functions */
uint32_t __fswahb32(uint32_t val) {
  return ((uint32_t)((((uint32_t)(val) & (uint32_t)0x00ff00ffUL) << 8) |
                     (((uint32_t)(val) & (uint32_t)0xff00ff00UL) >> 8)));
}


x86 assembly (clang, -O0):
<__fswahb32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fswahb32>:
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
sar    $0x8,%edi
and    $0xffff00ff,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__fswahb32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711935
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, -16711936
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__fswahb32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = ashr i32 %0, 8
%5 = and i32 %4, -65281
%6 = or i32 %3, %5
ret i32 %6
}
long minLong(long a, long b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<minLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <minLong+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <minLong+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minLong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @minLong(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showUrl(char *url, char *target, void *client_data) {
  printf("GetURL : %s\n", url);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"GetURL : %s\0A\00"
define void @showUrl(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"GetURL : %s\0A\00"
define void @showUrl(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}