xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _dictPanic(char *);
void *malloc(int);
void *_dictAlloc(int size) {
  void *p = malloc(size);
  if (p == NULL)
    _dictPanic("Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<_dictAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <_dictAlloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <_dictPanic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dictAlloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <_dictAlloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <_dictPanic@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @_dictAlloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @_dictPanic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @_dictAlloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @_dictPanic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void null_doall2(int a, int b) {}


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

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

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

LLVM IR (-O2):
define void @null_doall2(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nl();
int /*<<< orphan*/ write(int, int *, int);
void var(int a, ...) {
  int *l;
  l = &a + 1;
  while (a) {
    int tmp = a + '0';
    write(1, &tmp, 1);
    nl();
    a = *l;
    l++;
  }
}


x86 assembly (clang, -O0):
<var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     117b <var+0x5b>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%edx
lea    -0x14(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <var+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     115d <var+0x3d>
lea    0x8(%rsp),%rbx
mov    %rsp,%r14
add    $0x30,%edi
mov    %edi,(%rsp)
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <nl@plt>
mov    (%rbx),%edi
mov    %edi,0x4(%rsp)
add    $0x4,%rbx
test   %edi,%edi
jne    1130 <var+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @var(i32 %0, ...) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = getelementptr inbounds i32, i32* %2, i64 1
store i32* %5, i32** %3
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 48
store i32 %11, i32* %4
%12 = call i32 @write(i32 1, i32* %4, i32 1)
%13 = call i32 (...) @nl()
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
store i32 %15, i32* %2
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %3
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @var(i32 %0, ...) {
%2 = alloca i32
%3 = alloca i32
%4 = icmp eq i32 %0, 0
br i1 %4, label %16, label %5
5: ; preds = %1
%6 = bitcast i32* %3 to i8*
br label %7
7: ; preds = %5, %7
%8 = phi i32* [ %2, %5 ], [ %10, %7 ]
%9 = phi i32 [ %0, %5 ], [ %14, %7 ]
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = add nsw i32 %9, 48
store i32 %11, i32* %3
%12 = call i32 @write(i32 1, i32* %3, i32 1)
%13 = tail call i32 (...) @nl()
%14 = load i32, i32* %10
store i32 %14, i32* %2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %1
ret void
}
unsigned same_r(unsigned r) { return (r); }


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

x86 assembly (clang, -O2):
<same_r>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @same_r(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void version() {
  printf("\n%s, ver. %s (%s)\n\n", "WPABF", "1.1", "November, 2013");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xee2(%rip),%rsi
lea    0xee1(%rip),%rdx
lea    0xede(%rip),%rcx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xee4(%rip),%rdx
lea    0xee1(%rip),%rcx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\0A%s, ver. %s (%s)\0A\0A\00"
@.str.1 = [6 x i8] c"WPABF\00"
@.str.2 = [4 x i8] c"1.1\00"
@.str.3 = [15 x i8] c"November, 2013\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0A%s, ver. %s (%s)\0A\0A\00"
@.str.1 = [6 x i8] c"WPABF\00"
@.str.2 = [4 x i8] c"1.1\00"
@.str.3 = [15 x i8] c"November, 2013\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Exported();
int main() {
  Exported();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Exported()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ putc(char);
void HariMain(void) {
  for (;;)
    putc('a');
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <HariMain+0x9>
mov    $0x61,%edi
call   1030 <putc@plt>
jmp    1119 <HariMain+0x9>

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x61,%edi
call   1030 <putc@plt>
jmp    1120 <HariMain+0x10>

LLVM IR (-O0):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @putc(i8 signext 97)
br label %1
}

LLVM IR (-O2):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @putc(i8 signext 97)
br label %1
}
void rcu_read_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_read_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
unsigned int zipEntryEncoding(unsigned char *p) {
  unsigned char b = p[0] & 0xc0;
  if (b < 0xc0) {
    return b;
  } else {
    return p[0] & 0xf0;
  }
  assert(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<zipEntryEncoding>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
and    $0xc0,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0xc0,%eax
jge    1132 <zipEntryEncoding+0x32>
movzbl -0x11(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <zipEntryEncoding+0x41>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
and    $0xf0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipEntryEncoding>:
mov    (%rdi),%al
cmp    $0xc0,%al
mov    $0xc0,%ecx
mov    $0xf0,%edx
cmovb  %ecx,%edx
and    %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @zipEntryEncoding(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, -64
%4 = select i1 %3, i8 -64, i8 -16
%5 = and i8 %4, %2
%6 = zext i8 %5 to i32
ret i32 %6
}
void rop3_101_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_101_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_101_1_0>:
not    %dl
or     %sil,%dl
mov    (%rdi),%al
xor    %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_101_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = or i8 %4, %1
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %6, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
short smax(short a, short b) { return (short)(((a) > (b)) ? (a) : (b)); }


x86 assembly (clang, -O0):
<smax>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <smax+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <smax+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @smax(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @smax(i16 signext %0, i16 signext %1) {
%3 = icmp sgt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ EF_Exit(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stringErrorReport();
void mprotectFailed(void) {
  EF_Exit("mprotect() failed: %s", stringErrorReport());
}


x86 assembly (clang, -O0):
<mprotectFailed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <stringErrorReport@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <EF_Exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mprotectFailed>:
push   %rax
xor    %eax,%eax
call   1030 <stringErrorReport@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <EF_Exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"mprotect() failed: %s\00"
define void @mprotectFailed() {
%1 = call i32 (...) @stringErrorReport()
%2 = call i32 @EF_Exit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"mprotect() failed: %s\00"
define void @mprotectFailed() {
%1 = tail call i32 (...) @stringErrorReport()
%2 = tail call i32 @EF_Exit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int dll_close(int);
int __wrap_close(int fd) { return dll_close(fd); }


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

x86 assembly (clang, -O2):
<__wrap_close>:
jmp    1030 <dll_close@plt>

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

LLVM IR (-O2):
define i32 @__wrap_close(i32 %0) {
%2 = tail call i32 @dll_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ f1();
void f2(int a) {
  f1();
  f1();
  f1();
}


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

x86 assembly (clang, -O2):
<f2>:
push   %rax
xor    %eax,%eax
call   1030 <f1@plt>
xor    %eax,%eax
call   1030 <f1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <f1@plt>

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @f1()
%4 = call i32 (...) @f1()
%5 = call i32 (...) @f1()
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = tail call i32 (...) @f1()
%3 = tail call i32 (...) @f1()
%4 = tail call i32 (...) @f1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
fuu() {
  echo("aaa");
  echo("aaa");
  echo("aaa");
}


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

x86 assembly (clang, -O2):
<fuu>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <echo@plt>
mov    %rbx,%rdi
call   1030 <echo@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <echo@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"aaa\00"
define i32 @fuu() {
%1 = alloca i32
%2 = call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"aaa\00"
define i32 @fuu() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double cos(double);
double cosh(double);
double sqrt(double);
double c0(double z) {
  if (z < 0) {
    double sqrtz = sqrt(-z);
    return cosh(sqrtz);
  } else {
    double sqrtz = sqrt(z);
    return cos(sqrtz);
  }
}


x86 assembly (clang, -O0):
<c0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1185 <c0+0x55>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cosh@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11a3 <c0+0x73>
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c0>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1162 <c0+0x32>
movapd 0xebd(%rip),%xmm1
xorpd  %xmm0,%xmm1
movsd  0xec1(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     1172 <c0+0x42>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
pop    %rax
jmp    1030 <cosh@plt>
ucomisd %xmm1,%xmm0
jb     1181 <c0+0x51>
sqrtsd %xmm0,%xmm0
pop    %rax
jmp    1040 <cos@plt>
movapd %xmm1,%xmm0
call   1050 <sqrt@plt>
pop    %rax
jmp    1030 <cosh@plt>
call   1050 <sqrt@plt>
pop    %rax
jmp    1040 <cos@plt>

LLVM IR (-O0):
define double @c0(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load double, double* %3
%10 = fneg double %9
%11 = call double @sqrt(double %10)
store double %11, double* %4
%12 = load double, double* %4
%13 = call double @cosh(double %12)
store double %13, double* %2
br label %19
14: ; preds = %1
%15 = load double, double* %3
%16 = call double @sqrt(double %15)
store double %16, double* %5
%17 = load double, double* %5
%18 = call double @cos(double %17)
store double %18, double* %2
br label %19
19: ; preds = %14, %8
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @c0(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @sqrt(double %4)
%6 = tail call double @cosh(double %5)
br label %10
7: ; preds = %1
%8 = tail call double @sqrt(double %0)
%9 = tail call double @cos(double %8)
br label %10
10: ; preds = %7, %3
%11 = phi double [ %6, %3 ], [ %9, %7 ]
ret double %11
}
int keynote_sigverify_assertion(struct assertion *as) { return 1; }


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

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

LLVM IR (-O0):
%struct.assertion = type opaque
define i32 @keynote_sigverify_assertion(%struct.assertion* %0) {
%2 = alloca %struct.assertion*
store %struct.assertion* %0, %struct.assertion** %2
ret i32 1
}

LLVM IR (-O2):
%struct.assertion = type opaque
define i32 @keynote_sigverify_assertion(%struct.assertion* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ aleatorio();
int main() {
  aleatorio();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @aleatorio()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
long double __infer_nondet_long_double();
long double wcstold(const wchar_t *nptr, wchar_t **endptr) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<wcstold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @wcstold(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @wcstold(i32* nocapture readnone %0, i32** nocapture readnone %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
void wcnss_unregister_thermal_mitigation(void *tm_notify) {}


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

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

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

LLVM IR (-O2):
define void @wcnss_unregister_thermal_mitigation(i8* nocapture %0) {
ret void
}
int execute_putpmsg() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_putpmsg() {
ret i32 0
}
void serial_start() { return; }


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

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

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

LLVM IR (-O2):
define void @serial_start() {
ret void
}
/* Variables and functions */
float lerp(float, float, float);
float bilinear_interp(float tl, float tr, float bl, float br, float x_amount,
                      float y_amount) {
  float left = lerp(tl, bl, y_amount);
  float right = lerp(tr, br, y_amount);
  return lerp(right, left, x_amount);
}


x86 assembly (clang, -O0):
<bilinear_interp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1030 <lerp@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1030 <lerp@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <lerp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bilinear_interp>:
sub    $0x18,%rsp
movss  %xmm5,0x4(%rsp)
movss  %xmm4,0x14(%rsp)
movss  %xmm3,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movaps %xmm2,%xmm1
movaps %xmm5,%xmm2
call   1030 <lerp@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1030 <lerp@plt>
movss  0x8(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
add    $0x18,%rsp
jmp    1030 <lerp@plt>

LLVM IR (-O0):
define float @bilinear_interp(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%15 = load float, float* %7
%16 = load float, float* %9
%17 = load float, float* %12
%18 = call float @lerp(float %15, float %16, float %17)
store float %18, float* %13
%19 = load float, float* %8
%20 = load float, float* %10
%21 = load float, float* %12
%22 = call float @lerp(float %19, float %20, float %21)
store float %22, float* %14
%23 = load float, float* %14
%24 = load float, float* %13
%25 = load float, float* %11
%26 = call float @lerp(float %23, float %24, float %25)
ret float %26
}

LLVM IR (-O2):
define float @bilinear_interp(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call float @lerp(float %0, float %2, float %5)
%8 = tail call float @lerp(float %1, float %3, float %5)
%9 = tail call float @lerp(float %8, float %7, float %4)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ find(int *, int, int, int);
int test_not_found() {
  int array[] = {12, 32, 45, 61, 78, 15, 34, 47, 79, 81,
                 21, 42, 51, 82, 87, 33, 54, 63, 94, 99};
  return !find(array, 4, 5, 13);
}


x86 assembly (clang, -O0):
<test_not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x50,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0xd,%ecx
call   1040 <find@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_not_found>:
sub    $0x58,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0xd,%ecx
call   1030 <find@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.test_not_found.array = [20 x i32] [i32 12, i32 32, i32 45, i32 61, i32 78, i32 15, i32 34, i32 47, i32 79, i32 81, i32 21, i32 42, i32 51, i32 82, i32 87, i32 33, i32 54, i32 63, i32 94, i32 99]
define i32 @test_not_found() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 4, i32 5, i32 13)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@__const.test_not_found.array = [20 x i32] [i32 12, i32 32, i32 45, i32 61, i32 78, i32 15, i32 34, i32 47, i32 79, i32 81, i32 21, i32 42, i32 51, i32 82, i32 87, i32 33, i32 54, i32 63, i32 94, i32 99]
define i32 @test_not_found() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 4, i32 5, i32 13)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint16_t;

/* Variables and functions */
uint16_t copy_uint16_t(const uint16_t _val) { return _val; }


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

x86 assembly (clang, -O2):
<copy_uint16_t>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @copy_uint16_t(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
char *check_malloc(int size) {
  char *the_block;
  the_block = malloc(size);
  if (the_block == NULL) {
    printf("\nERROR: unable to allocate sufficient memory!\n");
    exit(-1);
  }
  return (the_block);
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <check_malloc+0x38>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <check_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\0AERROR: unable to allocate sufficient memory!\0A\00"
define i8* @check_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@str = [46 x i8] c"\0AERROR: unable to allocate sufficient memory!\00"
define noalias i8* @check_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
__attribute__((regparm(3))) void c_fun(int a, int b, int c) {
  printf("%x %x %x\n", a, b, c);
}


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

x86 assembly (clang, -O2):
<c_fun>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%x %x %x\0A\00"
define void @c_fun(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 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%x %x %x\0A\00"
define void @c_fun(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
int test_imm_E2int8_reg(signed char val) {
  return ((val) & (0xE2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E2int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E2int8_reg>:
test   $0xe2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E2int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 226
%6 = icmp ne i32 %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_E2int8_reg(i8 signext %0) {
%2 = and i8 %0, -30
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int f(int a, int b, int c) {
  a += (b >> 16) * (c >> 16);
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sar    $0x10,%esi
sar    $0x10,%edx
imul   %esi,%edx
lea    (%rdx,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(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* %5
%8 = ashr i32 %7, 16
%9 = load i32, i32* %6
%10 = ashr i32 %9, 16
%11 = mul nsw i32 %8, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, 16
%5 = ashr i32 %2, 16
%6 = mul nsw i32 %5, %4
%7 = add nsw i32 %6, %0
ret i32 %7
}
int fn1(int p1, char p2) { return p1 || p2 ? 0 : p2; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1124 <fn1+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     112e <fn1+0x2e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <fn1+0x35>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
xor    %eax,%eax
test   %sil,%sil
cmovne %eax,%esi
test   %edi,%edi
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn1(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %2
br label %15
12: ; preds = %7
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
br label %15
15: ; preds = %12, %11
%16 = phi i32 [ 0, %11 ], [ %14, %12 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i8 signext %1) {
%3 = icmp ne i32 %0, 0
%4 = sext i8 %1 to i32
%5 = icmp ne i8 %1, 0
%6 = or i1 %3, %5
%7 = select i1 %6, i32 0, i32 %4
ret i32 %7
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int update_flags_katcp(struct katcp_dispatch *, int, int /*<<< orphan*/);
int expose_cmd_katcp(struct katcp_dispatch *d, int argc) {
  return update_flags_katcp(d, argc, 0);
}


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

x86 assembly (clang, -O2):
<expose_cmd_katcp>:
xor    %edx,%edx
jmp    1030 <update_flags_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i32 @expose_cmd_katcp(%struct.katcp_dispatch* %0, i32 %1) {
%3 = alloca %struct.katcp_dispatch*
%4 = alloca i32
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %3
store i32 %1, i32* %4
%5 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %3
%6 = load i32, i32* %4
%7 = call i32 @update_flags_katcp(%struct.katcp_dispatch* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @expose_cmd_katcp(%struct.katcp_dispatch* %0, i32 %1) {
%3 = tail call i32 @update_flags_katcp(%struct.katcp_dispatch* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lapic_write(int, int /*<<< orphan*/);
void _lapic_eoi(void) { lapic_write(0xB0, 0); }


x86 assembly (clang, -O0):
<_lapic_eoi>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
xor    %esi,%esi
call   1030 <lapic_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lapic_eoi>:
mov    $0xb0,%edi
xor    %esi,%esi
jmp    1030 <lapic_write@plt>

LLVM IR (-O0):
define void @_lapic_eoi() {
%1 = call i32 @lapic_write(i32 176, i32 0)
ret void
}

LLVM IR (-O2):
define void @_lapic_eoi() {
%1 = tail call i32 @lapic_write(i32 176, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void debug(const char *str) { write(2, str, strlen(str)); }


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @debug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @debug(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
unsigned long decodeIRCode();
unsigned long readIRCode() {
  unsigned long code = decodeIRCode();
  if (code == 0) {
    return 0;
  }
  while (decodeIRCode() == code) {
    ;
  }
  return code;
}


x86 assembly (clang, -O0):
<readIRCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <decodeIRCode@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113b <readIRCode+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    115e <readIRCode+0x4e>
jmp    1140 <readIRCode+0x30>
mov    $0x0,%al
call   1030 <decodeIRCode@plt>
cmp    -0x10(%rbp),%rax
jne    1156 <readIRCode+0x46>
jmp    1140 <readIRCode+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readIRCode>:
push   %rbx
xor    %eax,%eax
call   1030 <decodeIRCode@plt>
mov    %rax,%rbx
test   %rax,%rax
je     112c <readIRCode+0x1c>
xor    %eax,%eax
call   1030 <decodeIRCode@plt>
cmp    %rbx,%rax
je     1120 <readIRCode+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @readIRCode() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @decodeIRCode()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i64 0, i64* %1
br label %15
7: ; preds = %0
br label %8
8: ; preds = %12, %7
%9 = call i64 (...) @decodeIRCode()
%10 = load i64, i64* %2
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
%14 = load i64, i64* %2
store i64 %14, i64* %1
br label %15
15: ; preds = %13, %6
%16 = load i64, i64* %1
ret i64 %16
}

LLVM IR (-O2):
define i64 @readIRCode() {
%1 = tail call i64 (...) @decodeIRCode()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @decodeIRCode()
%5 = icmp eq i64 %4, %1
br i1 %5, label %3, label %6
6: ; preds = %3, %0
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ address;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int main(int argc, const char *argv[]) {
  FILE *f = fopen("address", "wb");
  int address = 0xffffdc38;
  fwrite(&address, sizeof(address), 1, f);
  fclose(f);
  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)
lea    0xeb3(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0xffffdc38,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@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
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
movl   $0xffffdc38,0xc(%rsp)
ff
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"address\00"
@.str.1 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %6
store i32 -9160, i32* %7
%9 = load i32*, i32** %6
%10 = call i32 @fwrite(i32* %7, i32 4, i32 1, i32* %9)
%11 = load i32*, i32** %6
%12 = call i32 @fclose(i32* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"address\00"
@.str.1 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = bitcast i32* %3 to i8*
store i32 -9160, i32* %3
%6 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %4)
%7 = tail call i32 @fclose(i32* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int beholddb_exec(int /*<<< orphan*/ *, char *);
int beholddb_commit(sqlite3 *db) { return beholddb_exec(db, "commit;"); }


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

x86 assembly (clang, -O2):
<beholddb_commit>:
lea    0xee9(%rip),%rsi
jmp    1030 <beholddb_exec@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"commit;\00"
define i32 @beholddb_commit(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @beholddb_exec(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"commit;\00"
define i32 @beholddb_commit(i32* %0) {
%2 = tail call i32 @beholddb_exec(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
size_t find(int, int *);
void join(int x, int y, int *parents) {
  parents[find(x, parents)] = find(y, parents);
}


x86 assembly (clang, -O0):
<join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <find@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <find@plt>
mov    -0x1c(%rbp),%edx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %edi,%r14d
mov    %esi,%edi
mov    %rdx,%rsi
call   1030 <find@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %rbx,%rsi
call   1030 <find@plt>
mov    %ebp,(%rbx,%rax,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @join(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* %5
%8 = load i32*, i32** %6
%9 = call i64 @find(i32 %7, i32* %8)
%10 = trunc i64 %9 to i32
%11 = load i32*, i32** %6
%12 = load i32, i32* %4
%13 = load i32*, i32** %6
%14 = call i64 @find(i32 %12, i32* %13)
%15 = getelementptr inbounds i32, i32* %11, i64 %14
store i32 %10, i32* %15
ret void
}

LLVM IR (-O2):
define void @join(i32 %0, i32 %1, i32* %2) {
%4 = tail call i64 @find(i32 %1, i32* %2)
%5 = trunc i64 %4 to i32
%6 = tail call i64 @find(i32 %0, i32* %2)
%7 = getelementptr inbounds i32, i32* %2, i64 %6
store i32 %5, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kfree(void *, int);
void free_page(void *v) { kfree(v, 12); }


x86 assembly (clang, -O0):
<free_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xc,%esi
call   1030 <kfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_page>:
mov    $0xc,%esi
jmp    1030 <kfree@plt>

LLVM IR (-O0):
define void @free_page(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @kfree(i8* %3, i32 12)
ret void
}

LLVM IR (-O2):
define void @free_page(i8* %0) {
%2 = tail call i32 @kfree(i8* %0, i32 12)
ret void
}
int fle(float x, float y) {
  if (x <= y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     112d <fle+0x2d>
movl   $0xd,-0x4(%rbp)
jmp    1134 <fle+0x34>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fle>:
ucomiss %xmm0,%xmm1
mov    $0x8c,%ecx
mov    $0xd,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fle(float %0, float %1) {
%3 = fcmp ugt float %0, %1
%4 = select i1 %3, i32 140, i32 13
ret i32 %4
}
int pathcon_nm6_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathcon_nm6_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathcon_nm6_n_in() {
ret i32 2
}