xunge/DecIR huggingface dataset:
int is_empty(unsigned char *data, int length) {
  int empty;
  int i;
  empty = 1;
  for (i = 0; i < length; i++) {
    if (data[i] != 0) {
      empty = 0;
      break;
    }
  }
  return empty;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <is_empty+0x59>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1146 <is_empty+0x46>
movl   $0x0,-0x10(%rbp)
jmp    1159 <is_empty+0x59>
jmp    114b <is_empty+0x4b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <is_empty+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <is_empty+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,(%rdi,%rdx,1)
jne    1120 <is_empty+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <is_empty+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_empty(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %6, %8, %2
%15 = phi i32 [ 1, %2 ], [ 0, %8 ], [ 1, %6 ]
ret i32 %15
}
void CRSetCrashLogMessage(const char *text) {}


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

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

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

LLVM IR (-O2):
define void @CRSetCrashLogMessage(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char const *);
void ft_putendl(char const *s) {
  if (!(s))
    return;
  ft_putstr(s);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <ft_putendl+0x1c>
jmp    114f <ft_putendl+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     1136 <ft_putendl+0x16>
push   %rax
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>
ret

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

LLVM IR (-O2):
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_putstr(i8* %0)
%5 = tail call i32 @ft_putchar(i8 signext 10)
br label %6
6: ; preds = %1, %3
ret void
}
void del_file(char *name) {}


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

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

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

LLVM IR (-O2):
define void @del_file(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int sjeng_write(int fd, char *buff) {
  printf("sending sjeng: \"%s\"\n", buff);
  write(fd, buff, strlen(buff));
  write(fd, "\n", strlen("\n"));
  return 0;
}


x86 assembly (clang, -O0):
<sjeng_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xe92(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe81(%rip),%rsi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sjeng_write>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xeb4(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"sending sjeng: \22%s\22\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @sjeng_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @write(i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"sending sjeng: \22%s\22\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @sjeng_write(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %4)
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int wdog_unsudirribe(int, unsigned int);
int wdog_pmon_unsudirribe(int id, int ack) {
  return wdog_unsudirribe(id, (unsigned int)ack);
}


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

x86 assembly (clang, -O2):
<wdog_pmon_unsudirribe>:
jmp    1030 <wdog_unsudirribe@plt>

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

LLVM IR (-O2):
define i32 @wdog_pmon_unsudirribe(i32 %0, i32 %1) {
%3 = tail call i32 @wdog_unsudirribe(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ init();
int main(int argc, char *argv[]) {
  init();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int main(void) {
  int pid;
  if ((pid = fork()) < 0) {
    perror("fork");
    exit(1);
  }
  fprintf(stderr, "%d\n", pid);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1178 <main+0x38>
lea    0xe97(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
jns    1162 <main+0x22>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e77(%rip),%rcx
mov    (%rcx),%edi
lea    0xe93(%rip),%rsi
mov    %eax,%edx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fork\00"
@stderr = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
@stderr = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
uint8_t read8(volatile void *addr) { return *(volatile uint8_t *)addr; }


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

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

LLVM IR (-O0):
define i32 @read8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @read8(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
unsigned modify_tmp(unsigned index, unsigned *p_track) {
  unsigned occupied;
  unsigned track = *p_track;
  index--;
  occupied = ((track >> index) & 1);
  *p_track |= 1 << index;
  return occupied;
}


x86 assembly (clang, -O0):
<modify_tmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify_tmp>:
mov    %edi,%ecx
mov    (%rsi),%edx
add    $0xff,%cl
mov    %edx,%eax
shr    %cl,%eax
and    $0x1,%eax
bts    %ecx,%edx
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define i32 @modify_tmp(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %6
%9 = load i32, i32* %3
%10 = add i32 %9, -1
store i32 %10, i32* %3
%11 = load i32, i32* %6
%12 = load i32, i32* %3
%13 = lshr i32 %11, %12
%14 = and i32 %13, 1
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = shl i32 1, %15
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = or i32 %18, %16
store i32 %19, i32* %17
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @modify_tmp(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add i32 %0, -1
%5 = lshr i32 %3, %4
%6 = and i32 %5, 1
%7 = shl nuw i32 1, %4
%8 = or i32 %3, %7
store i32 %8, i32* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ do_battles();
void process_battle(void) { do_battles(); }


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

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

LLVM IR (-O0):
define void @process_battle() {
%1 = call i32 (...) @do_battles()
ret void
}

LLVM IR (-O2):
define void @process_battle() {
%1 = tail call i32 (...) @do_battles()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M502_f(char *s) {
  debug("M502_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M502_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M502_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M502_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M502_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M502_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M502_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void foo(int a) {
  switch (a) {
  case 1: {
  } break;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    111d <foo+0x1d>
jmp    1118 <foo+0x18>
jmp    111d <foo+0x1d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 1, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %1, %4
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(int);
main() {
  if (f(0x0123456789ABCDEFLL) != 0xCD)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x89abcdef,%edi
call   1040 <f@plt>
cmp    $0xcd,%eax
je     115b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x89abcdef,%edi
call   1040 <f@plt>
cmp    $0xcd,%eax
jne    1149 <main+0x19>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 -1985229329)
%3 = icmp ne i32 %2, 205
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -1985229329)
%2 = icmp eq i32 %1, 205
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
__attribute__((no_sanitize("pointer-overflow"))) char *
blacklist_1(char *base, unsigned long offset) {
  return base + offset;
}


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

x86 assembly (clang, -O2):
<blacklist_1>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @blacklist_1(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @blacklist_1(i8* readnone %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int contains_nonzero_byte(const uint8_t *bitmask, int start_index,
                          int end_index) {
  const uint8_t *end = bitmask + end_index;
  bitmask += start_index;
  if (bitmask != end) {
    if (*bitmask != 0) {
      return 1;
    }
    ++bitmask;
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains_nonzero_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     116a <contains_nonzero_byte+0x6a>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115e <contains_nonzero_byte+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1171 <contains_nonzero_byte+0x71>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains_nonzero_byte>:
cmp    %edx,%esi
je     1114 <contains_nonzero_byte+0x14>
movslq %esi,%rcx
mov    $0x1,%eax
cmpq   $0x0,(%rdi,%rcx,8)
je     1114 <contains_nonzero_byte+0x14>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @contains_nonzero_byte(i64* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5, %3
br label %11
11: ; preds = %5, %10
%12 = phi i32 [ 0, %10 ], [ 1, %5 ]
ret i32 %12
}
double ldexp(double value, int exp) { return value; }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @ldexp(double returned %0, i32 %1) {
ret double %0
}
int fun1219() { return 1219; }


x86 assembly (clang, -O0):
<fun1219>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1219() {
ret i32 1219
}

LLVM IR (-O2):
define i32 @fun1219() {
ret i32 1219
}
/* Variables and functions */
char toupper(char);
char *picolToUpper(char *str) {
  char *cp;
  for (cp = str; *cp; cp++)
    *cp = toupper(*cp);
  return str;
}


x86 assembly (clang, -O0):
<picolToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <picolToUpper+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <picolToUpper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolToUpper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <picolToUpper+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <picolToUpper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @picolToUpper(i8* returned %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 signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%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 i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ print_subset3(int const);
int main() {
  const int n = 5;
  print_subset3(n);
  return 0;
}


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

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

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

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

/* Variables and functions */
struct ether_addr *ether_aton_r(char const *, struct ether_addr *);
struct ether_addr *ether_aton(const char *asc) {
  static struct ether_addr result;
  return ether_aton_r(asc, &result);
}


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

x86 assembly (clang, -O2):
<ether_aton>:
lea    0x2f15(%rip),%rsi
jmp    1030 <ether_aton_r@plt>

LLVM IR (-O0):
%struct.ether_addr = type { i32 }
@ether_aton.result = internal global %struct.ether_addr zeroinitializer
define %struct.ether_addr* @ether_aton(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.ether_addr* @ether_aton_r(i8* %3, %struct.ether_addr* @ether_aton.result)
ret %struct.ether_addr* %4
}

LLVM IR (-O2):
%struct.ether_addr = type { i32 }
@ether_aton.result = internal global %struct.ether_addr zeroinitializer
define %struct.ether_addr* @ether_aton(i8* %0) {
%2 = tail call %struct.ether_addr* @ether_aton_r(i8* %0, %struct.ether_addr* @ether_aton.result)
ret %struct.ether_addr* %2
}
void proc_a(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @proc_a() {
br label %1
1: ; preds = %0, %1
br label %1
}
int vorbisclose(void *datasource) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @vorbisclose(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void dyad_init(void) { signal(SIGPIPE, SIG_IGN); }


x86 assembly (clang, -O0):
<dyad_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyad_init>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @dyad_init() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @dyad_init() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
ret void
}
int marker2(int a) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @marker2(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x7d() {
  Assert_real((isodigit(125) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              630, ("isodigit should be 0 for }"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for }\00"
define void @t_isodigit_0x7d() {
%1 = call i64 @isodigit(i32 125)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 630, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for }\00"
define void @t_isodigit_0x7d() {
%1 = tail call i64 @isodigit(i32 125)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 630, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printd_aux(int);
int /*<<< orphan*/ putchar(char);
void printd(int n) {
  printd_aux(n);
  putchar('\n');
}


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

x86 assembly (clang, -O2):
<printd>:
push   %rax
call   1030 <printd_aux@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <putchar@plt>

LLVM IR (-O0):
define void @printd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printd_aux(i32 %3)
%5 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @printd(i32 %0) {
%2 = tail call i32 @printd_aux(i32 %0)
%3 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
char b_abs(char *);
signed char intr_wrap_099(signed char p1) { return b_abs(&p1); }


x86 assembly (clang, -O0):
<intr_wrap_099>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
call   1030 <b_abs@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_099>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <b_abs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_099(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call signext i8 @b_abs(i8* %2)
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @intr_wrap_099(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call signext i8 @b_abs(i8* %2)
ret i8 %3
}
int main(int argc, char *argv[]) {
  int cmd = atoi(argv[1]);
  asm volatile(".byte 0x0f,0x01,0xc1" : : "a"(cmd) : "memory");
  printf("Made hypercall %x\n", cmd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
vmcall
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
vmcall
lea    0xeca(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Made hypercall %x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Made hypercall %x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %4)
tail call void asm sideeffect ".byte 0x0f,0x01,0xc1", "{ax},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
char const *soxr_version();
char const *src_get_version(void) { return soxr_version(); }


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

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

LLVM IR (-O0):
define i8* @src_get_version() {
%1 = call i8* (...) @soxr_version()
ret i8* %1
}

LLVM IR (-O2):
define i8* @src_get_version() {
%1 = tail call i8* (...) @soxr_version()
ret i8* %1
}
/* Variables and functions */
float _erff(float);
float erff(float x) { return _erff(x); }


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

x86 assembly (clang, -O2):
<erff>:
jmp    1030 <_erff@plt>

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

LLVM IR (-O2):
define float @erff(float %0) {
%2 = tail call float @_erff(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void lsd_fatal_error(char *file, int line, char *mesg) {
  fprintf(stderr, "fatal error: %s: %s::%d: %s", mesg, file, line,
          strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<lsd_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    %rax,%r9
lea    0xe74(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<lsd_fatal_error>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %esi,%r14d
mov    %rdi,%rbp
mov    0x2e99(%rip),%rax
mov    (%rax),%ebx
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea2(%rip),%rsi
mov    %ebx,%edi
mov    %r15,%rdx
mov    %rbp,%rcx
mov    %r14d,%r8d
mov    %rax,%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"fatal error: %s: %s::%d: %s\00"
@errno = global i32 0
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10, i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"fatal error: %s: %s::%d: %s\00"
@errno = global i32 0
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1, i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct dns_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dns_p_free(struct dns_packet *);
struct dns_packet *dns_p_setptr(struct dns_packet **dst,
                                struct dns_packet *src) {
  dns_p_free(*dst);
  *dst = src;
  return src;
}


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

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

LLVM IR (-O0):
%struct.dns_packet = type { i32 }
define %struct.dns_packet* @dns_p_setptr(%struct.dns_packet** %0, %struct.dns_packet* %1) {
%3 = alloca %struct.dns_packet**
%4 = alloca %struct.dns_packet*
store %struct.dns_packet** %0, %struct.dns_packet*** %3
store %struct.dns_packet* %1, %struct.dns_packet** %4
%5 = load %struct.dns_packet**, %struct.dns_packet*** %3
%6 = load %struct.dns_packet*, %struct.dns_packet** %5
%7 = call i32 @dns_p_free(%struct.dns_packet* %6)
%8 = load %struct.dns_packet*, %struct.dns_packet** %4
%9 = load %struct.dns_packet**, %struct.dns_packet*** %3
store %struct.dns_packet* %8, %struct.dns_packet** %9
%10 = load %struct.dns_packet*, %struct.dns_packet** %4
ret %struct.dns_packet* %10
}

LLVM IR (-O2):
%struct.dns_packet = type { i32 }
define %struct.dns_packet* @dns_p_setptr(%struct.dns_packet** nocapture %0, %struct.dns_packet* returned %1) {
%3 = load %struct.dns_packet*, %struct.dns_packet** %0
%4 = tail call i32 @dns_p_free(%struct.dns_packet* %3)
store %struct.dns_packet* %1, %struct.dns_packet** %0
ret %struct.dns_packet* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ w;
struct winsize {
  unsigned int ws_col;
  unsigned int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCSWINSZ;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ memset(struct winsize *, int /*<<< orphan*/, int);
void set_winsize(int fd, unsigned int cols, unsigned int rows) {
  struct winsize w;
  memset(&w, 0, sizeof(w));
  w.ws_col = cols;
  w.ws_row = rows;
  ioctl(fd, TIOCSWINSZ, (char *)&w);
}


x86 assembly (clang, -O0):
<set_winsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_winsize>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %rsp,%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    %ebp,(%rsp)
mov    %ebx,0x4(%rsp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.winsize = type { i32, i32 }
@TIOCSWINSZ = global i32 0
define void @set_winsize(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.winsize
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 @memset(%struct.winsize* %7, i32 0, i32 8)
%9 = load i32, i32* %5
%10 = getelementptr inbounds %struct.winsize, %struct.winsize* %7, i32 0, i32 0
store i32 %9, i32* %10
%11 = load i32, i32* %6
%12 = getelementptr inbounds %struct.winsize, %struct.winsize* %7, i32 0, i32 1
store i32 %11, i32* %12
%13 = load i32, i32* %4
%14 = load i32, i32* @TIOCSWINSZ
%15 = bitcast %struct.winsize* %7 to i8*
%16 = call i32 @ioctl(i32 %13, i32 %14, i8* %15)
ret void
}

LLVM IR (-O2):
%struct.winsize = type { i32, i32 }
@TIOCSWINSZ = global i32 0
define void @set_winsize(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.winsize
%5 = bitcast %struct.winsize* %4 to i8*
%6 = call i32 @memset(%struct.winsize* %4, i32 0, i32 8)
%7 = getelementptr inbounds %struct.winsize, %struct.winsize* %4, i64 0, i32 0
store i32 %1, i32* %7
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %4, i64 0, i32 1
store i32 %2, i32* %8
%9 = load i32, i32* @TIOCSWINSZ
%10 = call i32 @ioctl(i32 %0, i32 %9, i8* %5)
ret void
}
double *dvector(nl, nh)
long nh, nl;
{
  double *v;
  v = (double *)malloc((unsigned int)((nh - nl + 1 + 1) * sizeof(double)));
  if (!v)
    nrerror("allocation failure in dvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x1,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116a <dvector+0x4a>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %r14d,%esi
lea    0x10(,%rsi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <dvector+0x2c>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = zext i32 %12 to i64
%14 = call i8* @malloc(i64 %13)
%15 = bitcast i8* %14 to double*
store double* %15, double** %5
%16 = load double*, double** %5
%17 = icmp ne double* %16, null
br i1 %17, label %20, label %18
18: ; preds = %2
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = load double*, double** %5
%22 = load i64, i64* %3
%23 = sub i64 0, %22
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = getelementptr inbounds double, double* %24, i64 1
ret double* %25
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = and i64 %5, 4294967288
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = bitcast i8* %7 to double*
%13 = sub i64 0, %0
%14 = getelementptr inbounds double, double* %12, i64 %13
%15 = getelementptr inbounds double, double* %14, i64 1
ret double* %15
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  uint32_t a, b;
  a = 0x100;
  b = 0x10;
  printf("a=0x%x, ~a=0x%x, a^b=0x%x\n", a, ~a, a ^ b);
  printf("b=0x%x, ~b=0x%x, a^b=0x%x\n", b, ~b, b ^ a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x100,-0x4(%rbp)
movl   $0x10,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
xor    -0x4(%rbp),%ecx
lea    0xec4(%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
mov    $0x100,%esi
mov    $0xfffffeff,%edx
mov    $0x110,%ecx
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x10,%esi
mov    $0xffffffef,%edx
mov    $0x110,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"a=0x%x, ~a=0x%x, a^b=0x%x\0A\00"
@.str.1 = [27 x i8] c"b=0x%x, ~b=0x%x, a^b=0x%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 256, i32* %1
store i32 16, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = xor i32 %4, -1
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = xor i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = xor i32 %11, -1
%13 = load i32, i32* %2
%14 = load i32, i32* %1
%15 = xor i32 %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %12, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"a=0x%x, ~a=0x%x, a^b=0x%x\0A\00"
@.str.1 = [27 x i8] c"b=0x%x, ~b=0x%x, a^b=0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 256, i32 -257, i32 272)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 16, i32 -17, i32 272)
ret i32 0
}