xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printusage() {
  fprintf(stderr, "usage: tar [-ckxntv] [-f archive] [file]...\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<printusage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"usage: tar [-ckxntv] [-f archive] [file]...\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"usage: tar [-ckxntv] [-f archive] [file]...\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ uart_outputchar(char);
void uart_outputstr(char *str) {
  while (*str != 0) {
    uart_outputchar(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<uart_outputstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <uart_outputstr+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <uart_outputchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uart_outputstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_outputstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_outputstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_outputchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_outputstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_outputstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @uart_outputchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int swi10(int volatile);
int swi120(int volatile);
int swi50(int volatile);
int main() {
  volatile int cnt = 0;
  cnt = swi10(cnt);
  cnt = swi50(cnt);
  cnt = swi120(cnt);
  return cnt;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%edi
call   1040 <swi10@plt>
mov    %eax,0x4(%rsp)
mov    0x4(%rsp),%edi
call   1030 <swi50@plt>
mov    %eax,0x4(%rsp)
mov    0x4(%rsp),%edi
call   1050 <swi120@plt>
mov    %eax,0x4(%rsp)
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
%3 = load volatile i32, i32* %2
%4 = call i32 @swi10(i32 %3)
store volatile i32 %4, i32* %2
%5 = load volatile i32, i32* %2
%6 = call i32 @swi50(i32 %5)
store volatile i32 %6, i32* %2
%7 = load volatile i32, i32* %2
%8 = call i32 @swi120(i32 %7)
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = tail call i32 @swi10(i32 %3)
store volatile i32 %4, i32* %1
%5 = load volatile i32, i32* %1
%6 = tail call i32 @swi50(i32 %5)
store volatile i32 %6, i32* %1
%7 = load volatile i32, i32* %1
%8 = tail call i32 @swi120(i32 %7)
store volatile i32 %8, i32* %1
%9 = load volatile i32, i32* %1
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, int);
size_t syscall(int, int, long, int, int /*<<< orphan*/, int /*<<< orphan*/);
size_t write(int fd, void *buf, size_t count) {
  static char data[128] __attribute__((aligned(64)));
  int len = (((sizeof(data)) < (count)) ? (sizeof(data)) : (count));
  memcpy(data, buf, len);
  return syscall(64, fd, (long)data, len, 0, 0);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x80,%eax
cmp    -0x18(%rbp),%rax
jae    1150 <write+0x30>
mov    $0x80,%eax
mov    %rax,-0x28(%rbp)
jmp    1158 <write+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0x2f13(%rip),%rdi
call   1040 <memcpy@plt>
mov    -0x4(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    $0x40,%edi
lea    0x2efc(%rip),%rdx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0x80,%rdx
mov    $0x80,%ebp
cmovb  %edx,%ebp
lea    0x2f44(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    $0x40,%edi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@write.data = internal global [128 x i8] zeroinitializer
define i64 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = icmp ult i64 128, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %13
11: ; preds = %3
%12 = load i64, i64* %6
br label %13
13: ; preds = %11, %10
%14 = phi i64 [ 128, %10 ], [ %12, %11 ]
%15 = trunc i64 %14 to i32
store i32 %15, i32* %7
%16 = load i8*, i8** %5
%17 = load i32, i32* %7
%18 = call i32 @memcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @write.data, i64 0, i64 0), i8* %16, i32 %17)
%19 = load i32, i32* %4
%20 = load i32, i32* %7
%21 = call i64 @syscall(i32 64, i32 %19, i64 ptrtoint ([128 x i8]* @write.data to i64), i32 %20, i32 0, i32 0)
ret i64 %21
}

LLVM IR (-O2):
@write.data = internal global [128 x i8] zeroinitializer
define i64 @write(i32 %0, i8* %1, i64 %2) {
%4 = icmp ult i64 %2, 128
%5 = select i1 %4, i64 %2, i64 128
%6 = trunc i64 %5 to i32
%7 = tail call i32 @memcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @write.data, i64 0, i64 0), i8* %1, i32 %6)
%8 = tail call i64 @syscall(i32 64, i32 %0, i64 ptrtoint ([128 x i8]* @write.data to i64), i32 %6, i32 0, i32 0)
ret i64 %8
}
/* Variables and functions */
int O_NDELAY;
int O_RDWR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char *, int);
int /*<<< orphan*/ printf(char *);
int init_line(char *device) {
  int line;
  unsigned int bits;
  if ((line = open(device, O_RDWR | O_NDELAY)) == -1) {
    printf("open: ERROR - failed to open the serial port\n");
    exit(0);
  }
  return (line);
}


x86 assembly (clang, -O0):
<init_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2e88(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1176 <init_line+0x46>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_line>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     114f <init_line+0x1f>
pop    %rcx
ret
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NDELAY = global i32 0
@.str = [46 x i8] c"open: ERROR - failed to open the serial port\0A\00"
define i32 @init_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_NDELAY
%8 = or i32 %6, %7
%9 = call i32 @open(i8* %5, i32 %8)
store i32 %9, i32* %3
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NDELAY = global i32 0
@str = [45 x i8] c"open: ERROR - failed to open the serial port\00"
define i32 @init_line(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %1
ret i32 %5
}
/* Variables and functions */
int display_X11_num_screens();
int display_num_screens(void) { return display_X11_num_screens(); }


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

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

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

LLVM IR (-O2):
define i32 @display_num_screens() {
%1 = tail call i32 (...) @display_X11_num_screens()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ jnb_io_read_bz2(char *, char **);
int /*<<< orphan*/ jnb_io_read_gz(char *, char **);
int jnb_io_read_raw(char *, char **);
int jnb_io_read(char *in_filename, char **out_data) {
  if (!jnb_io_read_bz2(in_filename, out_data))
    return 0;
  if (!jnb_io_read_gz(in_filename, out_data))
    return 0;
  return jnb_io_read_raw(in_filename, out_data);
}


x86 assembly (clang, -O0):
<jnb_io_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <jnb_io_read_bz2@plt>
cmp    $0x0,%eax
jne    1162 <jnb_io_read+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1194 <jnb_io_read+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <jnb_io_read_gz@plt>
cmp    $0x0,%eax
jne    1184 <jnb_io_read+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1194 <jnb_io_read+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <jnb_io_read_raw@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jnb_io_read>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <jnb_io_read_bz2@plt>
test   %eax,%eax
je     1164 <jnb_io_read+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <jnb_io_read_gz@plt>
test   %eax,%eax
je     1164 <jnb_io_read+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <jnb_io_read_raw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @jnb_io_read(i8* %0, i8** %1) {
%3 = tail call i32 @jnb_io_read_bz2(i8* %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @jnb_io_read_gz(i8* %0, i8** %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @jnb_io_read_raw(i8* %0, i8** %1)
br label %10
10: ; preds = %5, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *pPath = getenv("PATH");
  char *pHome = getenv("HOME");
  printf("PATH is %s\n", pPath);
  printf("HOME is %s\n", pHome);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [12 x i8] c"PATH is %s\0A\00"
@.str.3 = [12 x i8] c"HOME is %s\0A\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
char *read_file2mem(char const *, int /*<<< orphan*/ *, int);
char *spn_read_text_file(const char *name) {
  return read_file2mem(name, NULL, 1);
}


x86 assembly (clang, -O0):
<spn_read_text_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <read_file2mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spn_read_text_file>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <read_file2mem@plt>

LLVM IR (-O0):
define i8* @spn_read_text_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @read_file2mem(i8* %3, i32* null, i32 1)
ret i8* %4
}

LLVM IR (-O2):
define i8* @spn_read_text_file(i8* %0) {
%2 = tail call i8* @read_file2mem(i8* %0, i32* null, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
void perror_exit() {
  perror(NULL);
  exit(1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rax
xor    %edi,%edi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perror_exit() {
%1 = call i32 @perror(i32* null)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @perror_exit() {
%1 = tail call i32 @perror(i32* null)
%2 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((no, noclone)) unsigned short foo13(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1L << (sizeof(char) * 8 - 1)) : 0) + 1 ||
      arg + 1 > ((!0) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                      : ((1L << (sizeof(char) * 8)) - 1)) -
                    1)
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo13>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x1,%rax
jl     1137 <foo13+0x37>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x7e,%rax
jle    1144 <foo13+0x44>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1162 <foo13+0x62>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo13>:
lea    0x1(%rdi),%ecx
cmp    $0x7e,%di
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo13(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %8, 1
br i1 %9, label %16, label %10
10: ; preds = %1
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp sgt i64 %14, 126
br i1 %15, label %16, label %18
16: ; preds = %10, %1
%17 = load i16, i16* %4
store i16 %17, i16* %2
br label %27
18: ; preds = %10
%19 = load i16, i16* %3
%20 = zext i16 %19 to i32
%21 = add nsw i32 %20, 1
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
%23 = load i16, i16* %3
%24 = trunc i16 %23 to i8
%25 = sext i8 %24 to i16
store i16 %25, i16* %4
%26 = load i16, i16* %3
store i16 %26, i16* %2
br label %27
27: ; preds = %18, %16
%28 = load i16, i16* %2
ret i16 %28
}

LLVM IR (-O2):
define zeroext i16 @foo13(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 125
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ free_string(char *);
char *ipv4_ipv6(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void ipv4_ipv6_c(char *userInput, char *buf) {
  char *result = ipv4_ipv6(userInput);
  strcpy(buf, result);
  free_string(result);
}


x86 assembly (clang, -O0):
<ipv4_ipv6_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ipv4_ipv6@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1050 <free_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_ipv6_c>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <ipv4_ipv6@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <free_string@plt>

LLVM IR (-O0):
define void @ipv4_ipv6_c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @ipv4_ipv6(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free_string(i8* %11)
ret void
}

LLVM IR (-O2):
define void @ipv4_ipv6_c(i8* %0, i8* %1) {
%3 = tail call i8* @ipv4_ipv6(i8* %0)
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
%5 = tail call i32 @free_string(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void ldtest1(const char *str) { printf("ldtest1 => %s\n", str); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"ldtest1 => %s\0A\00"
define void @ldtest1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int max(a, b) { return (a > b) ? a : b; }


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

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

LLVM IR (-O0):
define i32 @max(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 sgt 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 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void mal_error(char *msg) {
  fprintf(stderr, "mal: %s\n", msg);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"mal: %s\0A\00"
define void @mal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"mal: %s\0A\00"
define void @mal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int printf(char *, char const *);
int hello_name(const char *name) { return printf("hello world %s.\n", name); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"hello world %s.\0A\00"
define i32 @hello_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"hello world %s.\0A\00"
define i32 @hello_name(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
void handle_key_sim_win(int ch) {}


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

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

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

LLVM IR (-O2):
define void @handle_key_sim_win(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ loff_t;

/* Variables and functions */
int main(void) {
  loff_t offset = 0;
  (void)offset;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t intrev(uint64_t i) {
  uint64_t rev = 0;
  uint64_t rem;
  while (i) {
    rem = i % 10;
    rev *= 10;
    rev += rem;
    i /= 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<intrev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <intrev+0x49>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <intrev+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intrev>:
xor    %eax,%eax
test   %edi,%edi
je     113f <intrev+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <intrev+0x10>
ret

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

LLVM IR (-O2):
define i32 @intrev(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, World\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ car(struct object *);
int z_isequal(int /*<<< orphan*/, struct object *);
int z_tagged(struct object *object, struct object *tag) {
  return z_isequal(car(object), tag);
}


x86 assembly (clang, -O0):
<z_tagged>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <car@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <z_isequal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_tagged>:
push   %rbx
mov    %rsi,%rbx
call   1040 <car@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <z_isequal@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define i32 @z_tagged(%struct.object* %0, %struct.object* %1) {
%3 = alloca %struct.object*
%4 = alloca %struct.object*
store %struct.object* %0, %struct.object** %3
store %struct.object* %1, %struct.object** %4
%5 = load %struct.object*, %struct.object** %3
%6 = call i32 @car(%struct.object* %5)
%7 = load %struct.object*, %struct.object** %4
%8 = call i32 @z_isequal(i32 %6, %struct.object* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.object = type { i32 }
define i32 @z_tagged(%struct.object* %0, %struct.object* %1) {
%3 = tail call i32 @car(%struct.object* %0)
%4 = tail call i32 @z_isequal(i32 %3, %struct.object* %1)
ret i32 %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dmeanwd(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dmeanwd(N, x, stride);
  printf("mean: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1050 <stdlib_strided_dmeanwd@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dmeanwd@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dmeanwd(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dmeanwd(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void read_spec(spec, part) char spec[];
struct vstring *part;
{
}


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

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

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

LLVM IR (-O2):
%struct.vstring = type opaque
define void @read_spec(i8* nocapture %0, %struct.vstring* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ internal_logit(char *, int, char *, char *);
void set_realtime_prio() {
  internal_logit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/ecthiender/mocp-git/refs/"
                 "heads/master/out_buf.c",
                 55, "UNKNOWN_FUNC",
                 "No sched_get_priority_max() function: realtime priority not "
                 "used.");
}


x86 assembly (clang, -O0):
<set_realtime_prio>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x37,%esi
lea    0xf63(%rip),%rdx
lea    0xf69(%rip),%rcx
call   1030 <internal_logit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_realtime_prio>:
lea    0xee9(%rip),%rdi
lea    0xf6c(%rip),%rdx
lea    0xf72(%rip),%rcx
mov    $0x37,%esi
jmp    1030 <internal_logit@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ecthiender/mocp-git/refs/heads/master/out_buf.c\00"
@.str.1 = [13 x i8] c"UNKNOWN_FUNC\00"
@.str.2 = [66 x i8] c"No sched_get_priority_max() function: realtime priority not used.\00"
define void @set_realtime_prio() {
%1 = call i32 @internal_logit(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ecthiender/mocp-git/refs/heads/master/out_buf.c\00"
@.str.1 = [13 x i8] c"UNKNOWN_FUNC\00"
@.str.2 = [66 x i8] c"No sched_get_priority_max() function: realtime priority not used.\00"
define void @set_realtime_prio() {
%1 = tail call i32 @internal_logit(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int _NSIG;
int __signalfd(int, int /*<<< orphan*/ const *, int, int);
int signalfd(int __fd, const sigset_t *__mask, int __flags) {
  return __signalfd(__fd, __mask, _NSIG / 8, __flags);
}


x86 assembly (clang, -O0):
<signalfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
call   1030 <__signalfd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalfd>:
mov    %edx,%ecx
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x3,%edx
jmp    1030 <__signalfd@plt>

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

LLVM IR (-O2):
@_NSIG = global i32 0
define i32 @signalfd(i32 %0, i32* %1, i32 %2) {
%4 = load i32, i32* @_NSIG
%5 = sdiv i32 %4, 8
%6 = tail call i32 @__signalfd(i32 %0, i32* %1, i32 %5, i32 %2)
ret i32 %6
}
char *put_padding_r(const unsigned w, const char wc, char *p, char *e) {
  for (char *const b = e - w; b < p; *--p = wc) {
  }
  return p;
}


x86 assembly (clang, -O0):
<put_padding_r>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    %ecx,%edx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1157 <put_padding_r+0x57>
jmp    113d <put_padding_r+0x3d>
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
jmp    112a <put_padding_r+0x2a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_padding_r>:
push   %rbx
mov    %edi,%eax
mov    %rcx,%rbx
sub    %rax,%rbx
cmp    %rdx,%rbx
jae    1132 <put_padding_r+0x22>
add    %rax,%rdx
sub    %rcx,%rdx
movzbl %sil,%esi
mov    %rbx,%rdi
call   1030 <memset@plt>
jmp    1135 <put_padding_r+0x25>
mov    %rdx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @put_padding_r(i32 %0, i8 signext %1, i8* writeonly %2, i8* readnone %3) {
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %3 to i64
%7 = zext i32 %0 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds i8, i8* %3, i64 %8
%10 = icmp ult i8* %9, %2
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = add i64 %5, %7
%13 = sub i64 %6, %12
%14 = getelementptr i8, i8* %2, i64 %13
%15 = add i64 %5, %7
%16 = sub i64 %15, %6
br label %17
17: ; preds = %11, %4
%18 = phi i8* [ %2, %4 ], [ %14, %11 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, char);
int /*<<< orphan*/ stderr;
int no_conjunction(char opt_a, char opt_b) {
  fprintf(stderr, "Option -%c cannot be used in conjuntion with %c.\n\n", opt_a,
          opt_b);
  return 2;
}


x86 assembly (clang, -O0):
<no_conjunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x1(%rbp),%al
lea    0xec9(%rip),%rsi
movsbl %al,%edx
movsbl -0x2(%rbp),%ecx
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_conjunction>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Option -%c cannot be used in conjuntion with %c.\0A\0A\00"
define i32 @no_conjunction(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i32, i32* @stderr
%6 = load i8, i8* %3
%7 = load i8, i8* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %7)
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Option -%c cannot be used in conjuntion with %c.\0A\0A\00"
define i32 @no_conjunction(i8 signext %0, i8 signext %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int null_pass_through(uint8_t id, uint8_t *in_cdb, uint8_t *b, uint32_t *len) {
  return (0);
}


x86 assembly (clang, -O0):
<null_pass_through>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @null_pass_through(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @null_pass_through(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ UINT32_MAX;
int /*<<< orphan*/ bgen_die(char *);
uint32_t panic_add_uint32(uint32_t a, uint32_t b) {
  if (b > UINT32_MAX - a) {
    bgen_die("panic_add_uint32 overflow");
  }
  return a + b;
}


x86 assembly (clang, -O0):
<panic_add_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ecd(%rip),%rcx
mov    (%rcx),%rcx
sub    -0x8(%rbp),%rcx
cmp    %rcx,%rax
jle    1147 <panic_add_uint32+0x37>
lea    0xebe(%rip),%rdi
call   1030 <bgen_die@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic_add_uint32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ed7(%rip),%rax
mov    (%rax),%rax
sub    %rdi,%rax
cmp    %rsi,%rax
jge    1138 <panic_add_uint32+0x28>
lea    0xecd(%rip),%rdi
call   1030 <bgen_die@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@UINT32_MAX = global i64 0
@.str = [26 x i8] c"panic_add_uint32 overflow\00"
define i64 @panic_add_uint32(i64 %0, i64 %1) {
%3 = load i64, i64* @UINT32_MAX
%4 = sub nsw i64 %3, %0
%5 = icmp slt i64 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @bgen_die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = add nsw i64 %1, %0
ret i64 %9
}
do_scale_alpha(argc, argv) int argc;
char **argv;
{}


x86 assembly (clang, -O0):
<do_scale_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @do_scale_alpha(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
int udev_queue_export_device_failed(struct udev_queue *udev_queue,
                                    struct udev_device *udev_device) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.udev_queue = type opaque
%struct.udev_device = type opaque
define i32 @udev_queue_export_device_failed(%struct.udev_queue* nocapture readnone %0, %struct.udev_device* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ emsSetk(char const *, int /*<<< orphan*/);
void msgSetk(const char *token, int64_t kvalue) { emsSetk(token, kvalue); }


x86 assembly (clang, -O0):
<msgSetk>:
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 <emsSetk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgSetk>:
jmp    1030 <emsSetk@plt>

LLVM IR (-O0):
define void @msgSetk(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 @emsSetk(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @msgSetk(i8* %0, i32 %1) {
%3 = tail call i32 @emsSetk(i8* %0, i32 %1)
ret void
}