xunge/DecIR huggingface dataset:
/* 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);
int 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,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x4(%rbp),%eax
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 i32 @set_winsize(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.winsize
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = call i32 @memset(%struct.winsize* %8, i32 0, i32 8)
%10 = load i32, i32* %6
%11 = getelementptr inbounds %struct.winsize, %struct.winsize* %8, i32 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* %7
%13 = getelementptr inbounds %struct.winsize, %struct.winsize* %8, i32 0, i32 1
store i32 %12, i32* %13
%14 = load i32, i32* %5
%15 = load i32, i32* @TIOCSWINSZ
%16 = bitcast %struct.winsize* %8 to i8*
%17 = call i32 @ioctl(i32 %14, i32 %15, i8* %16)
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
%struct.winsize = type { i32, i32 }
@TIOCSWINSZ = global i32 0
define i32 @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 i32 undef
}
/* Variables and functions */
int tst_vi_entry(int, char **);
int main(int argc, char **argv) { return tst_vi_entry(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tst_vi_entry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <tst_vi_entry@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @tst_vi_entry(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tst_vi_entry(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
double strtod(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_floats();
int /*<<< orphan*/ test_one_float(double);
int main(int argc, char *argv[]) {
  if (argc == 2) {
    double v = strtod(argv[1], NULL);
    test_one_float(v);
    return 0;
  }
  test_floats();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    117c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <test_one_float@plt>
movl   $0x0,-0x4(%rbp)
jmp    118a <main+0x5a>
mov    $0x0,%al
call   1050 <test_floats@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1148 <main+0x18>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
call   1040 <test_one_float@plt>
jmp    114f <main+0x1f>
xor    %eax,%eax
call   1050 <test_floats@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**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call double @strtod(i8* %12, i32* null)
store double %13, double* %6
%14 = load double, double* %6
%15 = call i32 @test_one_float(double %14)
store i32 0, i32* %3
br label %18
16: ; preds = %2
%17 = call i32 (...) @test_floats()
store i32 0, i32* %3
br label %18
18: ; preds = %16, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call double @strtod(i8* nocapture %6, i32* null)
%8 = tail call i32 @test_one_float(double %7)
br label %11
9: ; preds = %2
%10 = tail call i32 (...) @test_floats()
br label %11
11: ; preds = %9, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int fatalError(char *errorText) {
  fprintf(stderr, "\n FATAL ERROR: %s\n\n", errorText);
  fflush(stderr);
  exit(1);
  return 1;
}


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

x86 assembly (clang, -O2):
<fatalError>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"\0A FATAL ERROR: %s\0A\0A\00"
define i32 @fatalError(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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"\0A FATAL ERROR: %s\0A\0A\00"
define i32 @fatalError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getonlyone(char *);
int /*<<< orphan*/ printall();
int /*<<< orphan*/ usage();
main(int argc, char **argv) {
  if (argc > 2)
    usage();
  if (argc == 2)
    getonlyone(argv[1]);
  else
    printall();
  exit(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)
cmpl   $0x2,-0x8(%rbp)
jle    1167 <main+0x27>
mov    $0x0,%al
call   1040 <usage@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1183 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <getonlyone@plt>
jmp    118a <main+0x4a>
mov    $0x0,%al
call   1030 <printall@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jl     114f <main+0xf>
xor    %eax,%eax
call   1040 <usage@plt>
jmp    1164 <main+0x24>
cmp    $0x2,%edi
jne    1164 <main+0x24>
mov    0x8(%rsi),%rdi
call   1060 <getonlyone@plt>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <printall@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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 = load i32, i32* %4
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @getonlyone(i8* %16)
br label %20
18: ; preds = %10
%19 = call i32 (...) @printall()
br label %20
20: ; preds = %18, %13
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %12
6: ; preds = %2
%7 = icmp eq i32 %0, 2
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @getonlyone(i8* %10)
br label %14
12: ; preds = %4, %6
%13 = tail call i32 (...) @printall()
br label %14
14: ; preds = %12, %8
%15 = tail call i32 @exit(i32 0)
unreachable
}
void diag_debugfs_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @diag_debugfs_cleanup() {
ret void
}
/* Type definitions */
typedef union wait {
  int dummy;
} wait;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __wait4(int /*<<< orphan*/, union wait *, int,
                           int /*<<< orphan*/ *);
pid_t __waitpid(pid_t pid, int *stat_loc, int options) {
  return __wait4(pid, (union wait *)stat_loc, options, NULL);
}


x86 assembly (clang, -O0):
<__waitpid>:
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    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.wait = type { i32 }
define i32 @__waitpid(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 = bitcast i32* %8 to %union.wait*
%10 = load i32, i32* %6
%11 = call i32 @__wait4(i32 %7, %union.wait* %9, i32 %10, i32* null)
ret i32 %11
}

LLVM IR (-O2):
%union.wait = type { i32 }
define i32 @__waitpid(i32 %0, i32* %1, i32 %2) {
%4 = bitcast i32* %1 to %union.wait*
%5 = tail call i32 @__wait4(i32 %0, %union.wait* %4, i32 %2, i32* null)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ugl_AddBytecode(int);
int ugl_GetLabel(char const *);
int /*<<< orphan*/ ugl_plog(char *, int);
void ugl_bytecode_jmp_zero(const char *s) {
  int idx;
  idx = ugl_GetLabel(s);
  ugl_plog("BC jump on zero, label idx=%d", idx);
  ugl_AddBytecode((0x05f));
  ugl_AddBytecode(idx >> 8);
  ugl_AddBytecode(idx & 0x0ff);
}


x86 assembly (clang, -O0):
<ugl_bytecode_jmp_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ugl_GetLabel@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <ugl_plog@plt>
mov    $0x5f,%edi
call   1030 <ugl_AddBytecode@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
call   1030 <ugl_AddBytecode@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
call   1030 <ugl_AddBytecode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ugl_bytecode_jmp_zero>:
push   %rbx
call   1050 <ugl_GetLabel@plt>
mov    %eax,%ebx
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <ugl_plog@plt>
mov    $0x5f,%edi
call   1030 <ugl_AddBytecode@plt>
mov    %ebx,%edi
sar    $0x8,%edi
call   1030 <ugl_AddBytecode@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <ugl_AddBytecode@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"BC jump on zero, label idx=%d\00"
define void @ugl_bytecode_jmp_zero(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ugl_GetLabel(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @ugl_plog(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @ugl_AddBytecode(i32 95)
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = call i32 @ugl_AddBytecode(i32 %10)
%12 = load i32, i32* %3
%13 = and i32 %12, 255
%14 = call i32 @ugl_AddBytecode(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"BC jump on zero, label idx=%d\00"
define void @ugl_bytecode_jmp_zero(i8* %0) {
%2 = tail call i32 @ugl_GetLabel(i8* %0)
%3 = tail call i32 @ugl_plog(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @ugl_AddBytecode(i32 95)
%5 = ashr i32 %2, 8
%6 = tail call i32 @ugl_AddBytecode(i32 %5)
%7 = and i32 %2, 255
%8 = tail call i32 @ugl_AddBytecode(i32 %7)
ret void
}
unsigned int get_rr_interval_stop(struct rq *rq, struct task_struct *task) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define i32 @get_rr_interval_stop(%struct.rq* nocapture readnone %0, %struct.task_struct* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int fatfs_fileop_init(void **, char *, int);
int fatfs_fileop_pinit(void **fsctx, void *dev) {
  char *devname = (char *)dev;
  return fatfs_fileop_init(fsctx, devname, 1);
}


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

x86 assembly (clang, -O2):
<fatfs_fileop_pinit>:
mov    $0x1,%edx
jmp    1030 <fatfs_fileop_init@plt>

LLVM IR (-O0):
define i32 @fatfs_fileop_pinit(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** %4
store i8* %6, i8** %5
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %5
%9 = call i32 @fatfs_fileop_init(i8** %7, i8* %8, i32 1)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fatfs_fileop_pinit(i8** %0, i8* %1) {
%3 = tail call i32 @fatfs_fileop_init(i8** %0, i8* %1, i32 1)
ret i32 %3
}
unsigned long gcd(unsigned long a, unsigned long b) {
  unsigned long t;
  if (a < b) {
    t = a;
    a = b;
    b = t;
  }
  while (0 < b) {
    t = (a % b);
    a = b;
    b = t;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1132 <gcd+0x32>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <gcd+0x37>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jae    1168 <gcd+0x68>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <gcd+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rdx
cmp    %rsi,%rdi
mov    %rdi,%rax
cmovb  %rsi,%rax
cmovb  %rdi,%rdx
test   %rdx,%rdx
jne    112d <gcd+0x2d>
ret
nopw   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
%5 = select i1 %3, i64 %0, i64 %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ %5, %2 ]
%9 = phi i64 [ %8, %7 ], [ %4, %2 ]
%10 = urem i64 %9, %8
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i64 [ %4, %2 ], [ %8, %7 ]
ret i64 %13
}
/* Variables and functions */
void *intel_flash_init(int /*<<< orphan*/);
void *intel_flash_bxt_init() { return intel_flash_init(0); }


x86 assembly (clang, -O0):
<intel_flash_bxt_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <intel_flash_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_flash_bxt_init>:
xor    %edi,%edi
jmp    1030 <intel_flash_init@plt>

LLVM IR (-O0):
define i8* @intel_flash_bxt_init() {
%1 = call i8* @intel_flash_init(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @intel_flash_bxt_init() {
%1 = tail call i8* @intel_flash_init(i32 0)
ret i8* %1
}
void INT_Excep_LVD1_LVD1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_LVD1_LVD1() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *get_second(char *s) {
  register char *p;
  if ((p = strchr(s, ',')) != NULL)
    return (p + 1);
  else
    return (NULL);
}


x86 assembly (clang, -O0):
<get_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1149 <get_second+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <get_second+0x41>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_second>:
push   %rax
mov    $0x2c,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_second(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 44)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* null, i8** %2
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @get_second(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
unsigned xrop3_92_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S ^ D;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_92_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_92_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xff,%edx
or     %ecx,%edx
xor    $0xff,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_92_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_92_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = xor i32 %8, 255
%10 = xor i32 %4, -1
%11 = and i32 %9, %10
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *tcc_malloc(scalar_t__);
char *tcc_strdup(const char *str) {
  char *ptr;
  ptr = tcc_malloc(strlen(str) + 1);
  strcpy(ptr, str);
  return ptr;
}


x86 assembly (clang, -O0):
<tcc_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <tcc_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcc_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <tcc_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @tcc_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @tcc_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @tcc_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @tcc_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int __errno() { return 0; }


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

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

LLVM IR (-O0):
define i32 @__errno() {
ret i32 0
}

LLVM IR (-O2):
define i32 @__errno() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ext();
void n4(int a, int b, int c, int d) { ext(); }


x86 assembly (clang, -O0):
<n4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ext@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @n4(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
%9 = call i32 (...) @ext()
ret void
}

LLVM IR (-O2):
define void @n4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @ext()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dump_int(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ dump_string_array(char **, int, int /*<<< orphan*/ *);
void dump_strings(char **strings, int num_strings, FILE *fp) {
  dump_int(num_strings, fp);
  dump_string_array(strings, num_strings, fp);
  return;
}


x86 assembly (clang, -O0):
<dump_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <dump_int@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <dump_string_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_strings>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    %rdx,%rsi
call   1030 <dump_int@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <dump_string_array@plt>

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

LLVM IR (-O2):
define void @dump_strings(i8** %0, i32 %1, i32* %2) {
%4 = tail call i32 @dump_int(i32 %1, i32* %2)
%5 = tail call i32 @dump_string_array(i8** %0, i32 %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ lfs2_fromle32(int /*<<< orphan*/);
uint32_t lfs2_tole32(uint32_t a) { return lfs2_fromle32(a); }


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

x86 assembly (clang, -O2):
<lfs2_tole32>:
jmp    1030 <lfs2_fromle32@plt>

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

LLVM IR (-O2):
define i32 @lfs2_tole32(i32 %0) {
%2 = tail call i32 @lfs2_fromle32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void platform_terminal_reset_color() { printf("\e[0m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @platform_terminal_reset_color() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_42int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x42 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_42int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x42,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_42int64_midword_mem>:
testb  $0x42,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_42int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 66
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_42int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4325376
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
void *tiger_array_alloc(size_t asz) {
  void **p0_arr;
  p0_arr = (void **)malloc(asz * sizeof(void *));
  if (!p0_arr) {
    fprintf(stderr, "FATAL ERROR: [tiger_array_alloc] failed\n");
  }
  return p0_arr;
}


x86 assembly (clang, -O0):
<tiger_array_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <tiger_array_alloc+0x3d>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiger_array_alloc>:
push   %rbx
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <tiger_array_alloc+0x27>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"FATAL ERROR: [tiger_array_alloc] failed\0A\00"
define i8* @tiger_array_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8**
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 8
%6 = call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8**
store i8** %7, i8*** %3
%8 = load i8**, i8*** %3
%9 = icmp ne i8** %8, null
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %1
%14 = load i8**, i8*** %3
%15 = bitcast i8** %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"FATAL ERROR: [tiger_array_alloc] failed\0A\00"
define i8* @tiger_array_alloc(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i64 @malloc(i64 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
%9 = inttoptr i64 %3 to i8*
ret i8* %9
}
/* Variables and functions */
int wordcount(char *);
char *wordcount_01a() {
  char phrase[] =
      "zyzzyvas flutings mushers octopuses bizones talkier evokers coagent "
      "ringer neutral antipode omnibus havening whistles mistitled vacuums";
  do {
    if (!(wordcount(phrase) == 16))
      return "return 16 for a 16 word phrase";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<wordcount_01a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x88,%edx
call   1030 <memcpy@plt>
lea    -0x90(%rbp),%rdi
call   1040 <wordcount@plt>
cmp    $0x10,%eax
je     1168 <wordcount_01a+0x48>
lea    0xf29(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <wordcount_01a+0x55>
jmp    116d <wordcount_01a+0x4d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordcount_01a>:
push   %rbx
sub    $0x90,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x88,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
call   1040 <wordcount@plt>
xor    %ecx,%ecx
cmp    $0x10,%eax
lea    0xf35(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.wordcount_01a.phrase = [136 x i8] c"zyzzyvas flutings mushers octopuses bizones talkier evokers coagent ringer neutral antipode omnibus havening whistles mistitled vacuums\00"
@.str = [31 x i8] c"return 16 for a 16 word phrase\00"
define i8* @wordcount_01a() {
%1 = alloca i8*
%2 = alloca [136 x i8]
%3 = bitcast [136 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [136 x i8], [136 x i8]* %2, i64 0, i64 0
%6 = call i32 @wordcount(i8* %5)
%7 = icmp eq i32 %6, 16
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.wordcount_01a.phrase = [136 x i8] c"zyzzyvas flutings mushers octopuses bizones talkier evokers coagent ringer neutral antipode omnibus havening whistles mistitled vacuums\00"
@.str = [31 x i8] c"return 16 for a 16 word phrase\00"
define i8* @wordcount_01a() {
%1 = alloca [136 x i8]
%2 = getelementptr inbounds [136 x i8], [136 x i8]* %1, i64 0, i64 0
%3 = call i32 @wordcount(i8* %2)
%4 = icmp eq i32 %3, 16
%5 = select i1 %4, i8* null, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
void iommu_debug_domain_add(struct iommu_domain *domain) {}


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

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

LLVM IR (-O0):
%struct.iommu_domain = type opaque
define void @iommu_debug_domain_add(%struct.iommu_domain* %0) {
%2 = alloca %struct.iommu_domain*
store %struct.iommu_domain* %0, %struct.iommu_domain** %2
ret void
}

LLVM IR (-O2):
%struct.iommu_domain = type opaque
define void @iommu_debug_domain_add(%struct.iommu_domain* nocapture %0) {
ret void
}
int decimal_to_num(int ch) {
  if ('0' <= ch && ch <= '9')
    return ch - '0';
  return -1;
}


x86 assembly (clang, -O0):
<decimal_to_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x30,%eax
cmp    -0x8(%rbp),%eax
jg     112d <decimal_to_num+0x2d>
cmpl   $0x39,-0x8(%rbp)
jg     112d <decimal_to_num+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <decimal_to_num+0x34>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_to_num>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @decimal_to_num(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
int test_01(unsigned short *x) { return x[0]; }


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

x86 assembly (clang, -O2):
<test_01>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @test_01(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = zext i16 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char *substrn(char const *, int, int /*<<< orphan*/);
char *substr(const char *key, int from) {
  return substrn(key, from, strlen(&key[from]));
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1040 <substrn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %esi,%r14
add    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <substrn@plt>

LLVM IR (-O0):
define i8* @substr(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 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @strlen(i8* %10)
%12 = call i8* @substrn(i8* %5, i32 %6, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @substr(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i8* @substrn(i8* %0, i32 %1, i32 %5)
ret i8* %6
}
/* Variables and functions */
int hexstr_get_nibble(char const **);
int hexstr_peek_byte(char const *p) {
  int h = hexstr_get_nibble(&p);
  int l = hexstr_get_nibble(&p);
  if (h >= 0 && l >= 0)
    return (h << 4) | l;
  return -1;
}


x86 assembly (clang, -O0):
<hexstr_peek_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <hexstr_get_nibble@plt>
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <hexstr_get_nibble@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1159 <hexstr_peek_byte+0x49>
cmpl   $0x0,-0x18(%rbp)
jl     1159 <hexstr_peek_byte+0x49>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <hexstr_peek_byte+0x50>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexstr_peek_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <hexstr_get_nibble@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <hexstr_get_nibble@plt>
mov    %ebp,%ecx
shl    $0x4,%ecx
or     %eax,%ecx
or     %eax,%ebp
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hexstr_peek_byte(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @hexstr_get_nibble(i8** %2)
%4 = call i32 @hexstr_get_nibble(i8** %2)
%5 = icmp sgt i32 %3, -1
%6 = icmp sgt i32 %4, -1
%7 = select i1 %5, i1 %6, i1 false
%8 = shl i32 %3, 4
%9 = or i32 %8, %4
%10 = select i1 %7, i32 %9, i32 -1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error() {
  printf("Insuficiente memoria\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Insuficiente memoria\0A\00"
define void @error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Insuficiente memoria\00"
define void @error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_channel_map() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_channel_map"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_channel_map\0A\00"
define i32 @pa_tagstruct_get_channel_map() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_channel_map\00"
define i32 @pa_tagstruct_get_channel_map() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ beatstep_send_sysex(int /*<<< orphan*/, int, int, int);
void beatstep_set_relative(int beatstep_control, int control_no) {
  beatstep_send_sysex(0, 0x01, beatstep_control, 1);
  beatstep_send_sysex(0, 0x02, beatstep_control, 0);
  beatstep_send_sysex(0, 0x03, beatstep_control, control_no);
  beatstep_send_sysex(0, 0x06, beatstep_control, 1);
}


x86 assembly (clang, -O0):
<beatstep_set_relative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0x1,%ecx
mov    %ecx,%esi
call   1030 <beatstep_send_sysex@plt>
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
mov    $0x2,%esi
mov    %ecx,%edi
call   1030 <beatstep_send_sysex@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <beatstep_send_sysex@plt>
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0x6,%esi
mov    $0x1,%ecx
call   1030 <beatstep_send_sysex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beatstep_set_relative>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
call   1030 <beatstep_send_sysex@plt>
xor    %edi,%edi
mov    $0x2,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <beatstep_send_sysex@plt>
xor    %edi,%edi
mov    $0x3,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <beatstep_send_sysex@plt>
xor    %edi,%edi
mov    $0x6,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <beatstep_send_sysex@plt>

LLVM IR (-O0):
define void @beatstep_set_relative(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 = call i32 @beatstep_send_sysex(i32 0, i32 1, i32 %5, i32 1)
%7 = load i32, i32* %3
%8 = call i32 @beatstep_send_sysex(i32 0, i32 2, i32 %7, i32 0)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @beatstep_send_sysex(i32 0, i32 3, i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @beatstep_send_sysex(i32 0, i32 6, i32 %12, i32 1)
ret void
}

LLVM IR (-O2):
define void @beatstep_set_relative(i32 %0, i32 %1) {
%3 = tail call i32 @beatstep_send_sysex(i32 0, i32 1, i32 %0, i32 1)
%4 = tail call i32 @beatstep_send_sysex(i32 0, i32 2, i32 %0, i32 0)
%5 = tail call i32 @beatstep_send_sysex(i32 0, i32 3, i32 %0, i32 %1)
%6 = tail call i32 @beatstep_send_sysex(i32 0, i32 6, i32 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ exit(int);
long long lseek64(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
long long filesize(int fd) {
  long long rval = lseek64(fd, 0, SEEK_END);
  if (rval < 0) {
    perror("filesize");
    exit(-1);
  }
  return rval;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek64@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1173 <filesize+0x43>
lea    0xe9c(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek64@plt>
test   %rax,%rax
js     1148 <filesize+0x18>
pop    %rcx
ret
lea    0xeb1(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@SEEK_END = global i32 0
@.str = [9 x i8] c"filesize\00"
define i64 @filesize(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i64 @lseek64(i32 %0, i32 0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret i64 %3
}