xunge/DecIR huggingface dataset:
void multiply(int ar, int aj, int br, int bj, int *cr, int *cj) {
  *cr = ar * br - aj * bj;
  *cj = aj * br + ar * bj;
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
sub    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%eax
add    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mov    %edx,%r10d
imul   %edi,%r10d
mov    %ecx,%eax
imul   %esi,%eax
sub    %eax,%r10d
mov    %r10d,(%r8)
imul   %esi,%edx
imul   %edi,%ecx
add    %edx,%ecx
mov    %ecx,(%r9)
ret

LLVM IR (-O0):
define void @multiply(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %9
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %10
%18 = mul nsw i32 %16, %17
%19 = sub nsw i32 %15, %18
%20 = load i32*, i32** %11
store i32 %19, i32* %20
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %7
%25 = load i32, i32* %10
%26 = mul nsw i32 %24, %25
%27 = add nsw i32 %23, %26
%28 = load i32*, i32** %12
store i32 %27, i32* %28
ret void
}

LLVM IR (-O2):
define void @multiply(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = mul nsw i32 %2, %0
%8 = mul nsw i32 %3, %1
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %4
%10 = mul nsw i32 %2, %1
%11 = mul nsw i32 %3, %0
%12 = add nsw i32 %11, %10
store i32 %12, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
scalar_t__ ioctl(int, int /*<<< orphan*/, unsigned char);
int Set_slave_addr(int fd, unsigned char slave_addr) {
  if (ioctl(fd, I2C_SLAVE, slave_addr) < 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Set_slave_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
movzbl -0x9(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    114c <Set_slave_addr+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <Set_slave_addr+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Set_slave_addr>:
push   %rax
mov    %esi,%edx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
define i32 @Set_slave_addr(i32 %0, i8 zeroext %1) {
%3 = load i32, i32* @I2C_SLAVE
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i8 zeroext %1)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
void giveMeUnsafeMutablePointer(int *param) {}


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

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

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

LLVM IR (-O2):
define void @giveMeUnsafeMutablePointer(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlFmtError(char *);
void seqdummy_restore(void) {
  xlFmtError("shouldn't happen -- seqdummy_restore");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"shouldn't happen -- seqdummy_restore\00"
define void @seqdummy_restore() {
%1 = call i32 @xlFmtError(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"shouldn't happen -- seqdummy_restore\00"
define void @seqdummy_restore() {
%1 = tail call i32 @xlFmtError(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
void htsmsg_store_init(const char *programname, const char *path) {}


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

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

LLVM IR (-O0):
define void @htsmsg_store_init(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @htsmsg_store_init(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADC0_SEQA_DriverIRQHandler();
__attribute__((weak)) void ADC0_SEQA_IRQHandler(void) {
  ADC0_SEQA_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @ADC0_SEQA_IRQHandler() {
%1 = call i32 (...) @ADC0_SEQA_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ADC0_SEQA_IRQHandler() {
%1 = tail call i32 (...) @ADC0_SEQA_DriverIRQHandler()
ret void
}
char *strcat(char *dest, const char *str) {
  char *tmp = dest;
  while (*tmp)
    ++tmp;
  while (*str)
    *(tmp++) = *(str++);
  *tmp = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <strcat+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rdi
add    $0x1,%rcx
cmpb   $0x0,(%rdi)
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1146 <strcat+0x46>
mov    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x2(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <strcat+0x30>
add    %rdi,%rcx
mov    %rcx,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %4, %8 ]
%14 = phi i8* [ %15, %11 ], [ %1, %8 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %13
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ hello_message(char *);
int main() {
  hello_message("Vasya");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Vasya\00"
define i32 @main() {
%1 = tail call i32 @hello_message(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned xrop3_98_0_1(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 = T | D;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_98_0_1>:
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    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_98_0_1(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* %7
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and 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 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_98_0_1(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 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = and i32 %8, %4
%10 = xor i32 %9, 255
%11 = xor i32 %9, %3
%12 = xor i32 %7, -1
%13 = and i32 %10, %12
%14 = xor i32 %4, -1
%15 = and i32 %14, %5
%16 = or i32 %11, %15
%17 = or i32 %16, %13
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("Usage: %s <-d data_file_name> <-r rnd_file_name> "
         "<-m rnd_count> <-p count> <-o file_name>\n",
         name);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [91 x i8] c"Usage: %s <-d data_file_name> <-r rnd_file_name> <-m rnd_count> <-p count> <-o file_name>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [91 x i8] c"Usage: %s <-d data_file_name> <-r rnd_file_name> <-m rnd_count> <-p count> <-o file_name>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
Action() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Action() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ ENGINE_add(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_rsax();
int /*<<< orphan*/ ERR_clear_error();
void ENGINE_load_rsax(void) {
  ENGINE *toadd = ENGINE_rsax();
  if (!toadd)
    return;
  ENGINE_add(toadd);
  ENGINE_free(toadd);
  ERR_clear_error();
}


x86 assembly (clang, -O0):
<ENGINE_load_rsax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ENGINE_rsax@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <ENGINE_load_rsax+0x23>
jmp    117c <ENGINE_load_rsax+0x3c>
mov    -0x8(%rbp),%rdi
call   1040 <ENGINE_add@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ENGINE_free@plt>
mov    $0x0,%al
call   1060 <ERR_clear_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENGINE_load_rsax>:
push   %rbx
xor    %eax,%eax
call   1050 <ENGINE_rsax@plt>
test   %rax,%rax
je     1168 <ENGINE_load_rsax+0x28>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <ENGINE_add@plt>
mov    %rbx,%rdi
call   1030 <ENGINE_free@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <ERR_clear_error@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ENGINE_load_rsax() {
%1 = tail call i32* (...) @ENGINE_rsax()
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @ENGINE_add(i32* %1)
%5 = tail call i32 @ENGINE_free(i32* %1)
%6 = tail call i32 (...) @ERR_clear_error()
br label %7
7: ; preds = %0, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char *getword(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *name;
  FILE *f = fopen("tmp.txt", "r");
  printf("%s\n", getword(f));
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <getword@plt>
mov    %rax,%rsi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <getword@plt>
lea    0xea4(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i8* @getword(i32* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i8* @getword(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
int LZ4_sizeofState() {
  return (((1 << (14 - 3)) + 4 + ((sizeof(void *) == 16) ? 4 : 0)) *
          sizeof(unsigned long long));
}


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofState() {
ret i32 16416
}

LLVM IR (-O2):
define i32 @LZ4_sizeofState() {
ret i32 16416
}
int sys_sysctl(tcp)
struct tcb *tcp;
{
  return printargs(tcp);
}


x86 assembly (clang, -O0):
<sys_sysctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printargs@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_sysctl(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @printargs to i32 (%struct.tcb*, ...)*)(%struct.tcb* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_sysctl(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @printargs to i32 (%struct.tcb*, ...)*)(%struct.tcb* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ MultM(double **, double **, double **);
int /*<<< orphan*/ genXRotMatrix(double, double **);
void ViewRotX(double theta, double m[3][3]) {
  double a[3][3];
  genXRotMatrix(theta, a);
  MultM(a, m, m);
}


x86 assembly (clang, -O0):
<ViewRotX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x60(%rbp),%rdi
call   1040 <genXRotMatrix@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <MultM@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ViewRotX>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <genXRotMatrix@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <MultM@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ViewRotX(double %0, [3 x double]* %1) {
%3 = alloca double
%4 = alloca [3 x double]*
%5 = alloca [3 x [3 x double]]
store double %0, double* %3
store [3 x double]* %1, [3 x double]** %4
%6 = load double, double* %3
%7 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%8 = bitcast [3 x double]* %7 to double**
%9 = call i32 @genXRotMatrix(double %6, double** %8)
%10 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%11 = bitcast [3 x double]* %10 to double**
%12 = load [3 x double]*, [3 x double]** %4
%13 = bitcast [3 x double]* %12 to double**
%14 = load [3 x double]*, [3 x double]** %4
%15 = bitcast [3 x double]* %14 to double**
%16 = call i32 @MultM(double** %11, double** %13, double** %15)
ret void
}

LLVM IR (-O2):
define void @ViewRotX(double %0, [3 x double]* %1) {
%3 = alloca [3 x [3 x double]]
%4 = bitcast [3 x [3 x double]]* %3 to i8*
%5 = bitcast [3 x [3 x double]]* %3 to double**
%6 = call i32 @genXRotMatrix(double %0, double** %5)
%7 = bitcast [3 x double]* %1 to double**
%8 = call i32 @MultM(double** %5, double** %7, double** %7)
ret void
}
/* Variables and functions */
unsigned int UARTRegConfigModeEnable(unsigned int, int);
unsigned int UARTCharsAvail(unsigned int baseAdd) {
  unsigned int lcrRegValue = 0;
  unsigned int retVal = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x007F));
  if ((*((volatile unsigned int *)(baseAdd + (0x14)))) & (0x00000001u)) {
    retVal = 1;
  }
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
  return retVal;
}


x86 assembly (clang, -O0):
<UARTCharsAvail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x7f,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1156 <UARTCharsAvail+0x46>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharsAvail>:
push   %rbx
mov    %edi,%ebx
mov    $0x7f,%esi
call   1030 <UARTRegConfigModeEnable@plt>
lea    0x14(%rbx),%ecx
mov    (%rcx),%ecx
and    $0x1,%ecx
add    $0xc,%ebx
mov    %eax,(%rbx)
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTCharsAvail(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @UARTRegConfigModeEnable(i32 %5, i32 127)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = add i32 %7, 20
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %4
br label %15
15: ; preds = %14, %1
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add i32 %17, 12
%19 = zext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @UARTCharsAvail(i32 %0) {
%2 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 127)
%3 = add i32 %0, 20
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 1
%8 = add i32 %0, 12
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %2, i32* %10
ret i32 %7
}
/* Variables and functions */
scalar_t__ _is_accessor_char(char);
unsigned char _is_numeric_char(char c) {
  return (c >= '0' && c <= '9') || _is_accessor_char(c);
}


x86 assembly (clang, -O0):
<_is_numeric_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     113d <_is_numeric_char+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1150 <_is_numeric_char+0x40>
movsbl -0x1(%rbp),%edi
call   1030 <_is_accessor_char@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_numeric_char>:
lea    -0x30(%rdi),%ecx
mov    $0x1,%al
cmp    $0xa,%cl
jb     112e <_is_numeric_char+0x1e>
push   %rax
movsbl %dil,%edi
call   1030 <_is_accessor_char@plt>
test   %rax,%rax
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define zeroext i8 @_is_numeric_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = call i64 @_is_accessor_char(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @_is_numeric_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @_is_accessor_char(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i8
br label %8
8: ; preds = %1, %4
%9 = phi i8 [ %7, %4 ], [ 1, %1 ]
ret i8 %9
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_max(float *, float *, float *);
__attribute__((always_)) struct vec2 *
psvec2_max(struct vec2 *result, struct vec2 *a, struct vec2 *b) {
  vec2_max((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2_max>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_max@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_max(%struct.vec2* %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = alloca %struct.vec2*
%5 = alloca %struct.vec2*
%6 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %4
store %struct.vec2* %1, %struct.vec2** %5
store %struct.vec2* %2, %struct.vec2** %6
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = load %struct.vec2*, %struct.vec2** %5
%10 = bitcast %struct.vec2* %9 to float*
%11 = load %struct.vec2*, %struct.vec2** %6
%12 = bitcast %struct.vec2* %11 to float*
%13 = call i32 @vec2_max(float* %8, float* %10, float* %12)
%14 = load %struct.vec2*, %struct.vec2** %4
ret %struct.vec2* %14
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_max(%struct.vec2* returned %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = bitcast %struct.vec2* %0 to float*
%5 = bitcast %struct.vec2* %1 to float*
%6 = bitcast %struct.vec2* %2 to float*
%7 = tail call i32 @vec2_max(float* %4, float* %5, float* %6)
ret %struct.vec2* %0
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main(void) {
  if (dlopen("nodlopenmod2.so", RTLD_LAZY) != NULL) {
    puts("opening \"nodlopenmod2.so\" succeeded, FAIL");
    return 1;
  }
  puts("opening \"nodlopenmod2.so\" failed, OK");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1040 <dlopen@plt>
cmp    $0x0,%rax
je     1166 <main+0x46>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1179 <main+0x59>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <dlopen@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xef5(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"nodlopenmod2.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [42 x i8] c"opening \22nodlopenmod2.so\22 succeeded, FAIL\00"
@.str.2 = [37 x i8] c"opening \22nodlopenmod2.so\22 failed, OK\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @RTLD_LAZY
%3 = call i32* @dlopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"nodlopenmod2.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [42 x i8] c"opening \22nodlopenmod2.so\22 succeeded, FAIL\00"
@.str.2 = [37 x i8] c"opening \22nodlopenmod2.so\22 failed, OK\00"
define i32 @main() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i32* @dlopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0)
%5 = xor i1 %3, true
%6 = zext i1 %5 to i32
%7 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 %6
}
void foo_2_1_1_1_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_2_2_1_2() {
ret void
}
int fun102() { return 102; }


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

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

LLVM IR (-O0):
define i32 @fun102() {
ret i32 102
}

LLVM IR (-O2):
define i32 @fun102() {
ret i32 102
}
/* Variables and functions */
int pm8xxx_mpp_cfg(unsigned int, int, unsigned int, unsigned int);
int pm8xxx_mpp_config_analog_output(unsigned mpp, unsigned level,
                                    unsigned control) {
  return pm8xxx_mpp_cfg(mpp, 4, level, control);
}


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

x86 assembly (clang, -O2):
<pm8xxx_mpp_config_analog_output>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <pm8xxx_mpp_cfg@plt>

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

LLVM IR (-O2):
define i32 @pm8xxx_mpp_config_analog_output(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8xxx_mpp_cfg(i32 %0, i32 4, i32 %1, i32 %2)
ret i32 %4
}
void dropbox_queue_event_empty(char *name) {}


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

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

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

LLVM IR (-O2):
define void @dropbox_queue_event_empty(i8* nocapture %0) {
ret void
}
int floatViewRestore(struct LSD_SceneNodeInst const *inst, void *instData) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.LSD_SceneNodeInst = type opaque
define i32 @floatViewRestore(%struct.LSD_SceneNodeInst* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
size_t balign_down(size_t x, size_t n) { return (x - (x % n)); }


x86 assembly (clang, -O0):
<balign_down>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<balign_down>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <balign_down+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <balign_down+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @balign_down(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
%9 = sub i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @balign_down(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = sub i64 %0, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ add(int, int);
int /*<<< orphan*/ mul(int, int);
int /*<<< orphan*/ sub(int, int);
int /*<<< orphan*/ triple(int, int);
int main(void) {
  int a = 0xABCD, b = 0x1234;
  add(a, b);
  sub(a, b);
  mul(a, b);
  triple(a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xabcd,-0x8(%rbp)
movl   $0x1234,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <add@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <sub@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <mul@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <triple@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xabcd,%edi
mov    $0x1234,%esi
call   1030 <add@plt>
mov    $0xabcd,%edi
mov    $0x1234,%esi
call   1060 <sub@plt>
mov    $0xabcd,%edi
mov    $0x1234,%esi
call   1040 <mul@plt>
mov    $0xabcd,%edi
mov    $0x1234,%esi
call   1050 <triple@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 43981, i32* %2
store i32 4660, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @add(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @sub(i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @mul(i32 %10, i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @triple(i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 43981, i32 4660)
%2 = tail call i32 @sub(i32 43981, i32 4660)
%3 = tail call i32 @mul(i32 43981, i32 4660)
%4 = tail call i32 @triple(i32 43981, i32 4660)
ret i32 0
}
void debug_stack_enumeration() {}


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

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

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

LLVM IR (-O2):
define void @debug_stack_enumeration() {
ret void
}
/* Type definitions */
struct Pipe {
  int dummy;
};
struct Fd {
  int dummy;
};

/* Variables and functions */
int _pipeisclosed(struct Fd *, struct Pipe *);
scalar_t__ fd2data(struct Fd *);
int fd_lookup(int, struct Fd **);
int pipeisclosed(int fdnum) {
  struct Fd *fd;
  struct Pipe *p;
  int r;
  if ((r = fd_lookup(fdnum, &fd)) < 0)
    return r;
  p = (struct Pipe *)fd2data(fd);
  return _pipeisclosed(fd, p);
}


x86 assembly (clang, -O0):
<pipeisclosed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <fd_lookup@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115e <pipeisclosed+0x2e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <pipeisclosed+0x4b>
mov    -0x10(%rbp),%rdi
call   1050 <fd2data@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_pipeisclosed@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipeisclosed>:
push   %rax
mov    %rsp,%rsi
call   1030 <fd_lookup@plt>
test   %eax,%eax
js     1152 <pipeisclosed+0x22>
mov    (%rsp),%rdi
call   1050 <fd2data@plt>
mov    (%rsp),%rdi
mov    %rax,%rsi
call   1040 <_pipeisclosed@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.Fd = type { i32 }
%struct.Pipe = type { i32 }
define i32 @pipeisclosed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.Fd*
%5 = alloca %struct.Pipe*
%6 = alloca i32
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @fd_lookup(i32 %7, %struct.Fd** %4)
store i32 %8, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %6
store i32 %11, i32* %2
br label %19
12: ; preds = %1
%13 = load %struct.Fd*, %struct.Fd** %4
%14 = call i64 @fd2data(%struct.Fd* %13)
%15 = inttoptr i64 %14 to %struct.Pipe*
store %struct.Pipe* %15, %struct.Pipe** %5
%16 = load %struct.Fd*, %struct.Fd** %4
%17 = load %struct.Pipe*, %struct.Pipe** %5
%18 = call i32 @_pipeisclosed(%struct.Fd* %16, %struct.Pipe* %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %12, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.Fd = type { i32 }
%struct.Pipe = type { i32 }
define i32 @pipeisclosed(i32 %0) {
%2 = alloca %struct.Fd*
%3 = bitcast %struct.Fd** %2 to i8*
%4 = call i32 @fd_lookup(i32 %0, %struct.Fd** %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load %struct.Fd*, %struct.Fd** %2
%8 = call i64 @fd2data(%struct.Fd* %7)
%9 = inttoptr i64 %8 to %struct.Pipe*
%10 = load %struct.Fd*, %struct.Fd** %2
%11 = call i32 @_pipeisclosed(%struct.Fd* %10, %struct.Pipe* %9)
br label %12
12: ; preds = %1, %6
%13 = phi i32 [ %11, %6 ], [ %4, %1 ]
ret i32 %13
}
/* Variables and functions */
int check_prime(int);
int /*<<< orphan*/ disp_prime(int);
void process(int n1, int n2) {
  int i, c;
  for (i = n1; i <= n2; i++) {
    c = check_prime(i);
    if (c != 0)
      disp_prime(i);
  }
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1170 <process+0x50>
mov    -0xc(%rbp),%edi
call   1030 <check_prime@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115d <process+0x3d>
mov    -0xc(%rbp),%edi
call   1040 <disp_prime@plt>
jmp    1162 <process+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <process+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jle    112e <process+0xe>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
jmp    1147 <process+0x27>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    %ebp,%ebx
je     1127 <process+0x7>
mov    %ebp,%edi
call   1030 <check_prime@plt>
test   %eax,%eax
je     1140 <process+0x20>
mov    %ebp,%edi
call   1040 <disp_prime@plt>
jmp    1140 <process+0x20>

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

LLVM IR (-O2):
define void @process(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ %0, %2 ]
%6 = tail call i32 @check_prime(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @disp_prime(i32 %5)
br label %10
10: ; preds = %4, %8
%11 = add i32 %5, 1
%12 = icmp eq i32 %5, %1
br i1 %12, label %13, label %4
13: ; preds = %10, %2
ret void
}
/* Type definitions */
struct RNAaliduplex_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNAaliduplex_cmdline_parser_required(
    struct RNAaliduplex_args_info *args_info, const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<RNAaliduplex_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNAaliduplex_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAaliduplex_cmdline_parser_required(%struct.RNAaliduplex_args_info* %0, i8* %1) {
%3 = alloca %struct.RNAaliduplex_args_info*
%4 = alloca i8*
store %struct.RNAaliduplex_args_info* %0, %struct.RNAaliduplex_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNAaliduplex_args_info*, %struct.RNAaliduplex_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNAaliduplex_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAaliduplex_cmdline_parser_required(%struct.RNAaliduplex_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgindw(void) { gen("movq\t(%rax),%rax"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"movq\09(%rax),%rax\00"
define void @cgindw() {
%1 = call i32 @gen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"movq\09(%rax),%rax\00"
define void @cgindw() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
float fmaftest(float a, float b, float c) { return __builtin_fmaf(a, b, c); }


x86 assembly (clang, -O0):
<fmaftest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaftest>:
jmp    1030 <fmaf@plt>

LLVM IR (-O0):
define float @fmaftest(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fma.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @fmaftest(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
ret float %4
}
int intpcmp(const void *ap, const void *bp) { return *(int *)ap - *(int *)bp; }


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

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

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

LLVM IR (-O2):
define i32 @intpcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(void) {
  fprintf(stdout, "Hello world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}