xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int, int, int);
void path_create(char *path, char *str, int id, int n) {
  int dname = n / 100;
  int fname = n;
  sprintf(str, "%s/%04d/%04d/%04d.txt", path, id, dname, fname);
}


x86 assembly (clang, -O0):
<path_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xeac(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_create>:
mov    %edx,%r10d
mov    %rsi,%rax
mov    %rdi,%rdx
movslq %ecx,%r9
imul   $0x51eb851f,%r9,%r8
mov    %r8,%rcx
shr    $0x3f,%rcx
sar    $0x25,%r8
add    %ecx,%r8d
lea    0xec8(%rip),%rsi
mov    %rax,%rdi
mov    %r10d,%ecx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"%s/%04d/%04d/%04d.txt\00"
define void @path_create(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %8
%12 = sdiv i32 %11, 100
store i32 %12, i32* %9
%13 = load i32, i32* %8
store i32 %13, i32* %10
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = load i32, i32* %7
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s/%04d/%04d/%04d.txt\00"
define void @path_create(i8* %0, i8* nocapture writeonly %1, i32 %2, i32 %3) {
%5 = sdiv i32 %3, 100
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i32 %5, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tcl_interface_init();
void pi_init(void) { tcl_interface_init(); }


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

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

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

LLVM IR (-O2):
define void @pi_init() {
%1 = tail call i32 (...) @tcl_interface_init()
ret void
}
int do_820() { return 820; }


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

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

LLVM IR (-O0):
define i32 @do_820() {
ret i32 820
}

LLVM IR (-O2):
define i32 @do_820() {
ret i32 820
}
int nxnypz1() {
  int x, y, z;
  x = 1;
  y = 0;
  z = 0;
  if (x)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<nxnypz1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112e <nxnypz1+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <nxnypz1+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @nxnypz1() {
ret i32 1
}
int proc_comm_batt_get_level(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @proc_comm_batt_get_level() {
ret i32 0
}
void dbur_WriteString(char *dbgmsg) {}


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

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

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

LLVM IR (-O2):
define void @dbur_WriteString(i8* nocapture %0) {
ret void
}
void new (char new_chessboard[8][8]) {
  int i = 0, j = 0;
  for (i = 0; i < 8; j++) {
    new_chessboard[i][j] = '.';
    if (j == 7) {
      j = -1;
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    116b <new+0x6b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
cmpl   $0x7,-0x10(%rbp)
jne    1158 <new+0x58>
movl   $0xffffffff,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <new+0x5d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <new+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<new>:
xor    %r8d,%r8d
xor    %edx,%edx
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%esi
movslq %edx,%rax
lea    (%rdi,%rsi,8),%rdx
movb   $0x2e,(%rax,%rdx,1)
lea    0x1(%rax),%edx
xor    %esi,%esi
cmp    $0x7,%eax
sete   %sil
cmove  %r8d,%edx
add    %esi,%ecx
cmp    $0x8,%ecx
jb     1110 <new+0x10>
ret

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

LLVM IR (-O2):
define void @new([8 x i8]* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %10, %2 ]
%4 = phi i32 [ 0, %1 ], [ %12, %2 ]
%5 = zext i32 %4 to i64
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %5, i64 %6
store i8 46, i8* %7
%8 = icmp eq i32 %3, 7
%9 = add nsw i32 %3, 1
%10 = select i1 %8, i32 0, i32 %9
%11 = zext i1 %8 to i32
%12 = add nuw nsw i32 %4, %11
%13 = icmp ult i32 %12, 8
br i1 %13, label %2, label %14
14: ; preds = %2
ret void
}
int wcfs_is_addr(const char *name) {
  if ((name[0] == '0') && (name[1] == 'x'))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<wcfs_is_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1135 <wcfs_is_addr+0x35>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    1135 <wcfs_is_addr+0x35>
movl   $0x1,-0x4(%rbp)
jmp    113c <wcfs_is_addr+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcfs_is_addr>:
cmpb   $0x30,(%rdi)
jne    1110 <wcfs_is_addr+0x10>
mov    $0x1,%eax
cmpb   $0x78,0x1(%rdi)
je     1112 <wcfs_is_addr+0x12>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @wcfs_is_addr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 120
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
int left(int *Arr, int i) { return Arr[2 * i]; }


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
add    %esi,%esi
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @left(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 = mul nsw i32 2, %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @left(i32* nocapture %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
void __cleanup_pclose_func(FILE **f) {
  if (*f)
    pclose(*f);
}


x86 assembly (clang, -O0):
<__cleanup_pclose_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <__cleanup_pclose_func+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cleanup_pclose_func>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <__cleanup_pclose_func+0xd>
jmp    1030 <pclose@plt>
ret

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

LLVM IR (-O2):
define void @__cleanup_pclose_func(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
int test_imm_34uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x34 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_34uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 52
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void PDO_DBG_ERR_FMT(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @PDO_DBG_ERR_FMT(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strrchr(char *, char);
void obd_uuid2fsname(char *buf, char *uuid, int buflen) {
  char *p;
  strncpy(buf, uuid, buflen - 1);
  buf[buflen - 1] = '\0';
  p = strrchr(buf, '-');
  if (p)
    *p = '\0';
}


x86 assembly (clang, -O0):
<obd_uuid2fsname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    $0x2d,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117b <obd_uuid2fsname+0x5b>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obd_uuid2fsname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %edx,%r14
lea    -0x1(%r14),%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %rbx,%rdi
mov    $0x2d,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     114e <obd_uuid2fsname+0x2e>
movb   $0x0,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @obd_uuid2fsname(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
%8 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 45)
%9 = icmp eq i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %3
store i8 0, i8* %8
br label %11
11: ; preds = %10, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rf_command(int);
void rf_flush_rx_fifo(void) { rf_command(0xe2); }


x86 assembly (clang, -O0):
<rf_flush_rx_fifo>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe2,%edi
call   1030 <rf_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rf_flush_rx_fifo>:
mov    $0xe2,%edi
jmp    1030 <rf_command@plt>

LLVM IR (-O0):
define void @rf_flush_rx_fifo() {
%1 = call i32 @rf_command(i32 226)
ret void
}

LLVM IR (-O2):
define void @rf_flush_rx_fifo() {
%1 = tail call i32 @rf_command(i32 226)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo_hook() { printf("foo_hook() called\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"foo_hook() called\00"
define void @foo_hook() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int print(int /*<<< orphan*/, int *);
int printf(const char *format, ...) {
  register int *varg = (int *)(&format);
  return print(0, varg);
}


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

x86 assembly (clang, -O2):
<printf>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <print@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i32*
%4 = call i32 @print(i32 0, i32* %3)
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_clock_nanosleep;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int,
            struct timespec const *, struct timespec *);
int audio_utils_clock_nanosleep(clockid_t clock_id, int flags,
                                const struct timespec *request,
                                struct timespec *remain) {
  return syscall(SYS_clock_nanosleep, clock_id, flags, request, remain);
}


x86 assembly (clang, -O0):
<audio_utils_clock_nanosleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_utils_clock_nanosleep>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_clock_nanosleep = global i32 0
define i32 @audio_utils_clock_nanosleep(i32 %0, i32 %1, %struct.timespec* %2, %struct.timespec* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.timespec*
%8 = alloca %struct.timespec*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.timespec* %2, %struct.timespec** %7
store %struct.timespec* %3, %struct.timespec** %8
%9 = load i32, i32* @SYS_clock_nanosleep
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load %struct.timespec*, %struct.timespec** %7
%13 = load %struct.timespec*, %struct.timespec** %8
%14 = call i32 @syscall(i32 %9, i32 %10, i32 %11, %struct.timespec* %12, %struct.timespec* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_clock_nanosleep = global i32 0
define i32 @audio_utils_clock_nanosleep(i32 %0, i32 %1, %struct.timespec* %2, %struct.timespec* %3) {
%5 = load i32, i32* @SYS_clock_nanosleep
%6 = tail call i32 @syscall(i32 %5, i32 %0, i32 %1, %struct.timespec* %2, %struct.timespec* %3)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
size_t read_FD_BE(int, int /*<<< orphan*/ *, int);
size_t uint32ReadFromFD(int fd, uint32_t *data) {
  return read_FD_BE(fd, data, sizeof(uint32_t));
}


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

x86 assembly (clang, -O2):
<uint32ReadFromFD>:
mov    $0x4,%edx
jmp    1030 <read_FD_BE@plt>

LLVM IR (-O0):
define i64 @uint32ReadFromFD(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 i64 @read_FD_BE(i32 %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @uint32ReadFromFD(i32 %0, i32* %1) {
%3 = tail call i64 @read_FD_BE(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Type definitions */
struct FormatType {
  int dummy;
};

/* Variables and functions */
scalar_t__ dirfile_read_channel(char, struct FormatType const *, char const *,
                                int *);
double *dirfile_read_double_channel(const struct FormatType *F,
                                    const char *channelname, int *nsamples) {
  return (double *)dirfile_read_channel('d', F, channelname, nsamples);
}


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

x86 assembly (clang, -O2):
<dirfile_read_double_channel>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x64,%edi
jmp    1030 <dirfile_read_channel@plt>

LLVM IR (-O0):
%struct.FormatType = type { i32 }
define double* @dirfile_read_double_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = alloca %struct.FormatType*
%5 = alloca i8*
%6 = alloca i32*
store %struct.FormatType* %0, %struct.FormatType** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load %struct.FormatType*, %struct.FormatType** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i64 @dirfile_read_channel(i8 signext 100, %struct.FormatType* %7, i8* %8, i32* %9)
%11 = inttoptr i64 %10 to double*
ret double* %11
}

LLVM IR (-O2):
%struct.FormatType = type { i32 }
define double* @dirfile_read_double_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = tail call i64 @dirfile_read_channel(i8 signext 100, %struct.FormatType* %0, i8* %1, i32* %2)
%5 = inttoptr i64 %4 to double*
ret double* %5
}
struct sgsn_pdp_ctx *miniggsn_create_pdp_conf(struct pdp_t *pdp,
                                              struct sgsn_pdp_ctx *pctx) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pdp_t = type opaque
%struct.sgsn_pdp_ctx = type opaque
define %struct.sgsn_pdp_ctx* @miniggsn_create_pdp_conf(%struct.pdp_t* %0, %struct.sgsn_pdp_ctx* %1) {
%3 = alloca %struct.pdp_t*
%4 = alloca %struct.sgsn_pdp_ctx*
store %struct.pdp_t* %0, %struct.pdp_t** %3
store %struct.sgsn_pdp_ctx* %1, %struct.sgsn_pdp_ctx** %4
ret %struct.sgsn_pdp_ctx* null
}

LLVM IR (-O2):
%struct.pdp_t = type opaque
%struct.sgsn_pdp_ctx = type opaque
define noalias %struct.sgsn_pdp_ctx* @miniggsn_create_pdp_conf(%struct.pdp_t* nocapture readnone %0, %struct.sgsn_pdp_ctx* nocapture readnone %1) {
ret %struct.sgsn_pdp_ctx* null
}
void net_init(void) {}


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

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

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

LLVM IR (-O2):
define void @net_init() {
ret void
}
/* Variables and functions */
int f(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int a = 5, b = 3;
  int c = f(a, b);
  printf("a = %d, b = %d, c = %d", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <f@plt>
lea    0xec9(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"a = %d, b = %d, c = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 5, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @f(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"a = %d, b = %d, c = %d\00"
define i32 @main() {
%1 = tail call i32 @f(i32 5, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 5, i32 3, i32 %1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ private_data;
};
typedef TYPE_1__ XExtData;

/* Variables and functions */
void *get_XExtData_private_data(void *_p) {
  return (void *)((XExtData *)_p)->private_data;
}


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

x86 assembly (clang, -O2):
<get_XExtData_private_data>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XExtData_private_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XExtData_private_data(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int divide(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", divide(atoi(argv[1]), atoi(argv[2])));
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <divide@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <divide@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
%14 = call i32 @divide(i32 %9, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\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 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @divide(i32 %5, i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
double centimetresToFeet(double centimetres) { return centimetres * 328.08; }


x86 assembly (clang, -O0):
<centimetresToFeet>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<centimetresToFeet>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @centimetresToFeet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.280800e+02
ret double %4
}

LLVM IR (-O2):
define double @centimetresToFeet(double %0) {
%2 = fmul double %0, 3.280800e+02
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ again();
int /*<<< orphan*/ ithen();
int /*<<< orphan*/ swap();
void repeat() {
  swap();
  again();
  ithen();
}


x86 assembly (clang, -O0):
<repeat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <swap@plt>
mov    $0x0,%al
call   1030 <again@plt>
mov    $0x0,%al
call   1040 <ithen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat>:
push   %rax
xor    %eax,%eax
call   1050 <swap@plt>
xor    %eax,%eax
call   1030 <again@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ithen@plt>

LLVM IR (-O0):
define void @repeat() {
%1 = call i32 (...) @swap()
%2 = call i32 (...) @again()
%3 = call i32 (...) @ithen()
ret void
}

LLVM IR (-O2):
define void @repeat() {
%1 = tail call i32 (...) @swap()
%2 = tail call i32 (...) @again()
%3 = tail call i32 (...) @ithen()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_FLASH_IN_PIN() { clear_io_bit(0x34, 6); }


x86 assembly (clang, -O0):
<TOSH_CLR_FLASH_IN_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x6,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_FLASH_IN_PIN>:
mov    $0x34,%edi
mov    $0x6,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_FLASH_IN_PIN() {
%1 = call i32 @clear_io_bit(i32 52, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_FLASH_IN_PIN() {
%1 = tail call i32 @clear_io_bit(i32 52, i32 6)
ret void
}
void RSA_up_ref(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_up_ref() {
ret void
}
/* Variables and functions */
double __ieee754_remainder(double, double);
double jremainder(double x, double y) { return __ieee754_remainder(x, y); }


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

x86 assembly (clang, -O2):
<jremainder>:
jmp    1030 <__ieee754_remainder@plt>

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

LLVM IR (-O2):
define double @jremainder(double %0, double %1) {
%3 = tail call double @__ieee754_remainder(double %0, double %1)
ret double %3
}
void __attribute__((no, noclone)) fn9(void) {
  long int *volatile d[10][5];
  asm("" : : "r"(&d[10]) : "memory");
  d[8][3] = d[10][0];
}


x86 assembly (clang, -O0):
<fn9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x190(%rbp),%rax
add    $0x190,%rax
mov    0x0(%rbp),%rax
mov    %rax,-0x38(%rbp)
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn9>:
sub    $0x118,%rsp
lea    0x110(%rsp),%rax
mov    0x110(%rsp),%rax
mov    %rax,0xd8(%rsp)
add    $0x118,%rsp
ret

LLVM IR (-O0):
define void @fn9() {
%1 = alloca [10 x [5 x i64*]]
%2 = getelementptr inbounds [10 x [5 x i64*]], [10 x [5 x i64*]]* %1, i64 0, i64 10
%3 = getelementptr inbounds [10 x [5 x i64*]], [10 x [5 x i64*]]* %1, i64 0, i64 10
%4 = getelementptr inbounds [5 x i64*], [5 x i64*]* %3, i64 0, i64 0
%5 = load volatile i64*, i64** %4
%6 = getelementptr inbounds [10 x [5 x i64*]], [10 x [5 x i64*]]* %1, i64 0, i64 8
%7 = getelementptr inbounds [5 x i64*], [5 x i64*]* %6, i64 0, i64 3
store volatile i64* %5, i64** %7
ret void
}

LLVM IR (-O2):
define void @fn9() {
%1 = alloca [10 x [5 x i64*]]
%2 = bitcast [10 x [5 x i64*]]* %1 to i8*
%3 = getelementptr inbounds [10 x [5 x i64*]], [10 x [5 x i64*]]* %1, i64 0, i64 10
%4 = getelementptr inbounds [5 x i64*], [5 x i64*]* %3, i64 0, i64 0
%5 = load volatile i64*, i64** %4
%6 = getelementptr inbounds [10 x [5 x i64*]], [10 x [5 x i64*]]* %1, i64 0, i64 8, i64 3
store volatile i64* %5, i64** %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_jam_comment_entities();
int /*<<< orphan*/ test_jam_comments();
void all_jam_tests() {
  test_jam_comments();
  test_jam_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_jam_tests() {
%1 = call i32 (...) @test_jam_comments()
%2 = call i32 (...) @test_jam_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_jam_tests() {
%1 = tail call i32 (...) @test_jam_comments()
%2 = tail call i32 (...) @test_jam_comment_entities()
ret void
}
int test_imm_E0uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xE0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E0uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xe0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E0uint64_highword_reg>:
movabs $0xe000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E0uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 962072674304
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void INT_Excep_PERIB_INTB181(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB181() {
ret void
}
int pct(n)
int n;
{
  if (ran(100) < n)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<pct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x64,%edi
mov    $0x0,%al
call   1030 <ran@plt>
cmp    -0x8(%rbp),%eax
jge    113c <pct+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <pct+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pct>:
push   %rbx
mov    %edi,%ebx
mov    $0x64,%edi
xor    %eax,%eax
call   1030 <ran@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @ran to i32 (i32, ...)*)(i32 100)
%5 = load i32, i32* %3
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @pct(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @ran to i32 (i32, ...)*)(i32 100)
%3 = icmp slt i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("USAGE: mandelbrot_cli [OPTIONS]\n");
  printf("With [OPTIONS]:\n");
  printf("\t -i --maxiterations INT \t maximum number of series iterations per "
         "pixel\n");
  printf("\t -o --outfile FILE \t filename (without appendix) for output "
         "picture in PPM format\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
lea    0xef0(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"USAGE: mandelbrot_cli [OPTIONS]\0A\00"
@.str.1 = [17 x i8] c"With [OPTIONS]:\0A\00"
@.str.2 = [74 x i8] c"\09 -i --maxiterations INT \09 maximum number of series iterations per pixel\0A\00"
@.str.3 = [84 x i8] c"\09 -o --outfile FILE \09 filename (without appendix) for output picture in PPM format\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"USAGE: mandelbrot_cli [OPTIONS]\00"
@str.5 = [16 x i8] c"With [OPTIONS]:\00"
@str.6 = [73 x i8] c"\09 -i --maxiterations INT \09 maximum number of series iterations per pixel\00"
@str.7 = [83 x i8] c"\09 -o --outfile FILE \09 filename (without appendix) for output picture in PPM format\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char const, int);
void ft_putstr_fd(char const *s, int fd) {
  if (s) {
    while (*s) {
      ft_putchar_fd(*s, fd);
      s++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <ft_putstr_fd+0x53>
jmp    112f <ft_putstr_fd+0x1f>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <ft_putstr_fd+0x4e>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <ft_putchar_fd@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ft_putstr_fd+0x1f>
jmp    1163 <ft_putstr_fd+0x53>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <ft_putstr_fd+0x35>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_putstr_fd(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %20
7: ; preds = %2
br label %8
8: ; preds = %12, %7
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = load i32, i32* %4
%16 = call i32 @ft_putchar_fd(i8 signext %14, i32 %15)
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %8
19: ; preds = %8
br label %20
20: ; preds = %19, %2
ret void
}

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %12, %7 ], [ %5, %4 ]
%9 = phi i8* [ %11, %7 ], [ %0, %4 ]
%10 = tail call i32 @ft_putchar_fd(i8 signext %8, i32 %1)
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_clk_low() {
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (2 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (2 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (1 << 9) | (2 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_clk_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc241,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc241,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xc241,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_clk_low>:
push   %rax
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc241,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc241,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xc241,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_clk_low() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49729)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49729)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 49729)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_clk_low() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49729)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49729)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 49729)
%6 = tail call i32 @delay(i32 100)
ret void
}
int main() {
  int a = 3;
  int b = 2;
  int c = 11;
  int d = -5;
  while (a) {
    b += 5;
    a += b;
    for (d = -5; d < 0; d++) {
      a += c;
    }
    c += 12;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0xb,-0x10(%rbp)
movl   $0xfffffffb,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1179 <main+0x79>
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0xfffffffb,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    116b <main+0x6b>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <main+0x4a>
mov    -0x10(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <main+0x27>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned char *w32mem(unsigned char *mem, unsigned long w32) {
  int i;
  for (i = 0; i < 4; i++)
    *mem++ = (unsigned char)((((w32)&4294967295U) >> (24 - i * 8)) & 0xff);
  return (mem);
}


x86 assembly (clang, -O0):
<w32mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1164 <w32mem+0x64>
movabs $0xffffffff,%rax
and    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edx
shl    $0x3,%edx
mov    $0x18,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <w32mem+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<w32mem>:
bswap  %esi
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @w32mem(i8* writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %8
%12 = trunc i64 %1 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %12, i8* %11
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ invalidateBPMTime();
void setupSettings() { invalidateBPMTime(); }


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

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

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

LLVM IR (-O2):
define void @setupSettings() {
%1 = tail call i32 (...) @invalidateBPMTime()
ret void
}