xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isprint(char);
void _fix_non_ascii(char *s, int len) {
  for (; len > 0; len--, s++)
    if (!isprint(*s))
      *s = '?';
}


x86 assembly (clang, -O0):
<_fix_non_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1164 <_fix_non_ascii+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
jne    1145 <_fix_non_ascii+0x35>
mov    -0x8(%rbp),%rax
movb   $0x3f,(%rax)
jmp    114a <_fix_non_ascii+0x3a>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <_fix_non_ascii+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fix_non_ascii>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    114d <_fix_non_ascii+0x3d>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
jmp    113c <_fix_non_ascii+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jle    114d <_fix_non_ascii+0x3d>
movsbl (%rbx),%edi
call   1030 <isprint@plt>
test   %eax,%eax
jne    1130 <_fix_non_ascii+0x20>
movb   $0x3f,(%rbx)
jmp    1130 <_fix_non_ascii+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_fix_non_ascii(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %11
%5 = phi i32 [ %12, %11 ], [ %1, %2 ]
%6 = phi i8* [ %13, %11 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i32 @isprint(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 63, i8* %6
br label %11
11: ; preds = %4, %10
%12 = add nsw i32 %5, -1
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = icmp sgt i32 %5, 1
br i1 %14, label %4, label %15
15: ; preds = %11, %2
ret void
}
/* Type definitions */
struct _rwlock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trie_writelock(struct _rwlock *);
void trie_readlock_upgrd(struct _rwlock *rw) { trie_writelock(rw); }


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

x86 assembly (clang, -O2):
<trie_readlock_upgrd>:
jmp    1030 <trie_writelock@plt>

LLVM IR (-O0):
%struct._rwlock = type { i32 }
define void @trie_readlock_upgrd(%struct._rwlock* %0) {
%2 = alloca %struct._rwlock*
store %struct._rwlock* %0, %struct._rwlock** %2
%3 = load %struct._rwlock*, %struct._rwlock** %2
%4 = call i32 @trie_writelock(%struct._rwlock* %3)
ret void
}

LLVM IR (-O2):
%struct._rwlock = type { i32 }
define void @trie_readlock_upgrd(%struct._rwlock* %0) {
%2 = tail call i32 @trie_writelock(%struct._rwlock* %0)
ret void
}
int sign(float valor) {
  if (valor >= 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1126 <sign+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <sign+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @sign(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @sign(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int A_BOLD;
int COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ attrset(int);
int /*<<< orphan*/ fade_dissolv();
int /*<<< orphan*/ gplot(char *, int, int, int);
int /*<<< orphan*/ refresh();
void gameover(void) {
  fade_dissolv();
  attrset(COLOR_PAIR(COLOR_WHITE) | A_BOLD);
  gplot("gover", 18, 2, 1);
  refresh();
}


x86 assembly (clang, -O0):
<gameover>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fade_dissolv@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2e66(%rip),%rax
or     (%rax),%edi
call   1070 <attrset@plt>
lea    0xe80(%rip),%rdi
mov    $0x12,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <gplot@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gameover>:
push   %rax
xor    %eax,%eax
call   1040 <fade_dissolv@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    0x2e6b(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%edi
call   1070 <attrset@plt>
lea    0xe83(%rip),%rdi
mov    $0x12,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <gplot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <refresh@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
@A_BOLD = global i32 0
@.str = [6 x i8] c"gover\00"
define void @gameover() {
%1 = call i32 (...) @fade_dissolv()
%2 = load i32, i32* @COLOR_WHITE
%3 = call i32 @COLOR_PAIR(i32 %2)
%4 = load i32, i32* @A_BOLD
%5 = or i32 %3, %4
%6 = call i32 @attrset(i32 %5)
%7 = call i32 @gplot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 18, i32 2, i32 1)
%8 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
@A_BOLD = global i32 0
@.str = [6 x i8] c"gover\00"
define void @gameover() {
%1 = tail call i32 (...) @fade_dissolv()
%2 = load i32, i32* @COLOR_WHITE
%3 = tail call i32 @COLOR_PAIR(i32 %2)
%4 = load i32, i32* @A_BOLD
%5 = or i32 %4, %3
%6 = tail call i32 @attrset(i32 %5)
%7 = tail call i32 @gplot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 18, i32 2, i32 1)
%8 = tail call i32 (...) @refresh()
ret void
}
void msg_trigger() {}


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

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

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

LLVM IR (-O2):
define void @msg_trigger() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void cdq(void) { put8(0x99); }


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

x86 assembly (clang, -O2):
<cdq>:
mov    $0x99,%edi
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cdq() {
%1 = call i32 @put8(i32 153)
ret void
}

LLVM IR (-O2):
define void @cdq() {
%1 = tail call i32 @put8(i32 153)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintHelloWorld() {
  printf(" !#$%&'()*+,-./"
         "0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`"
         "abcdefghijklmnopqrstuvwxyz{|}~\n");
  printf("");
  printf("helloworld!\n");
  return;
}


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

x86 assembly (clang, -O2):
<PrintHelloWorld>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [95 x i8] c" !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"helloworld!\0A\00"
define void @PrintHelloWorld() {
%1 = call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [95 x i8] c" !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~\0A\00"
@str = [12 x i8] c"helloworld!\00"
define void @PrintHelloWorld() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo3(int n, int b[n], int a[n][b[0]]) { assert(a[29][7] == 42); }


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
imul   $0x1d,%rcx,%rcx
cmpl   $0x2a,0x1c(%rax,%rcx,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
mov    (%rsi),%eax
imul   $0x74,%rax,%rax
xor    %edi,%edi
cmpl   $0x2a,0x1c(%rdx,%rax,1)
sete   %dil
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @foo3(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 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = zext i32 %13 to i64
%15 = load i32*, i32** %6
%16 = mul nsw i64 29, %14
%17 = getelementptr inbounds i32, i32* %15, i64 %16
%18 = getelementptr inbounds i32, i32* %17, i64 7
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 42
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret void
}

LLVM IR (-O2):
define void @foo3(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = mul nuw nsw i64 %5, 29
%7 = getelementptr inbounds i32, i32* %2, i64 %6
%8 = getelementptr inbounds i32, i32* %7, i64 7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 42
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char *argv[]) {
  float a, b, c;
  a = 1234.567;
  b = 45.67834;
  c = a + b;
  printf("%f\n", c);
  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)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x409400FB40000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ open_url(char *);
int main(int argc, char const *argv[]) {
  open_url("http://www.baidu.com");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"http://www.baidu.com\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @open_url(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"http://www.baidu.com\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @open_url(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int hibernate_on_memory(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hibernate_on_memory() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addnums(int, int, int, int, int, int, int, int, int, int);
void *foo(void *arg) {
  int x = (int)arg;
  addnums(x, x + 1, x + 2, x + 3, x + 4, x + 5, x + 6, x + 7, x + 8, x + 9);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
add    $0x2,%edx
mov    -0x14(%rbp),%ecx
add    $0x3,%ecx
mov    -0x14(%rbp),%r8d
add    $0x4,%r8d
mov    -0x14(%rbp),%r9d
add    $0x5,%r9d
mov    -0x14(%rbp),%ebx
add    $0x6,%ebx
mov    -0x14(%rbp),%r11d
add    $0x7,%r11d
mov    -0x14(%rbp),%r10d
add    $0x8,%r10d
mov    -0x14(%rbp),%eax
add    $0x9,%eax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <addnums@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
lea    0x1(%rdi),%esi
lea    0x2(%rdi),%edx
lea    0x3(%rdi),%ecx
lea    0x4(%rdi),%r8d
lea    0x5(%rdi),%r9d
lea    0x6(%rdi),%r10d
lea    0x7(%rdi),%r11d
lea    0x8(%rdi),%eax
lea    0x9(%rdi),%ebx
push   %rbx
push   %rax
push   %r11
push   %r10
call   1030 <addnums@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 3
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 5
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 6
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 7
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 8
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 9
%25 = call i32 @addnums(i32 %6, i32 %8, i32 %10, i32 %12, i32 %14, i32 %16, i32 %18, i32 %20, i32 %22, i32 %24)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @foo(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
%5 = add nsw i32 %3, 2
%6 = add nsw i32 %3, 3
%7 = add nsw i32 %3, 4
%8 = add nsw i32 %3, 5
%9 = add nsw i32 %3, 6
%10 = add nsw i32 %3, 7
%11 = add nsw i32 %3, 8
%12 = add nsw i32 %3, 9
%13 = tail call i32 @addnums(i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12)
ret i8* null
}
/* Variables and functions */
size_t INT_MAX;
void *calloc(size_t, unsigned int);
int /*<<< orphan*/ die(char *);
void *sysutil_calloc(size_t nmemb, unsigned int size) {
  void *p_ret;
  size_t realsize = nmemb * size;
  if (realsize == 0 || realsize > INT_MAX) {
  }
  p_ret = calloc(nmemb, size);
  if (p_ret == NULL) {
    die("calloc");
  }
  return p_ret;
}


x86 assembly (clang, -O0):
<sysutil_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <sysutil_calloc+0x3d>
mov    -0x20(%rbp),%rax
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
jbe    1162 <sysutil_calloc+0x42>
jmp    1162 <sysutil_calloc+0x42>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1189 <sysutil_calloc+0x69>
lea    0xe7c(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@INT_MAX = global i64 0
@.str = [7 x i8] c"calloc\00"
define i8* @sysutil_calloc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%7 = load i64, i64* %3
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = mul i64 %7, %9
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = icmp eq i64 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = load i64, i64* %6
%15 = load i64, i64* @INT_MAX
%16 = icmp ugt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13, %2
br label %18
18: ; preds = %17, %13
%19 = load i64, i64* %3
%20 = load i32, i32* %4
%21 = call i8* @calloc(i64 %19, i32 %20)
store i8* %21, i8** %5
%22 = load i8*, i8** %5
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24, %18
%27 = load i8*, i8** %5
ret i8* %27
}

LLVM IR (-O2):
@INT_MAX = global i64 0
@.str = [7 x i8] c"calloc\00"
define i8* @sysutil_calloc(i64 %0, i32 %1) {
%3 = tail call i8* @calloc(i64 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fftss_plan_with_nthreads(int);
void DFFTSS_PLAN_WITH_NTHREADS(int *nthreads) {
  fftss_plan_with_nthreads(*nthreads);
}


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

x86 assembly (clang, -O2):
<DFFTSS_PLAN_WITH_NTHREADS>:
mov    (%rdi),%edi
jmp    1030 <fftss_plan_with_nthreads@plt>

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

LLVM IR (-O2):
define void @DFFTSS_PLAN_WITH_NTHREADS(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @fftss_plan_with_nthreads(i32 %2)
ret void
}
/* Type definitions */
typedef int volatile uint8_t;

/* Variables and functions */
void flexram_wait(void) {
  while (!((*(volatile uint8_t *)0x40020001) & ((uint8_t)0x01))) {
  }
}


x86 assembly (clang, -O0):
<flexram_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <flexram_wait+0x9>
mov    $0x40020001,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <flexram_wait+0x28>
jmp    112d <flexram_wait+0x2d>
jmp    1109 <flexram_wait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flexram_wait>:
testl  $0x1,0x40020001
je     1100 <flexram_wait>
ret

LLVM IR (-O0):
define void @flexram_wait() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flexram_wait() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
void yy_1_InternalLinkTransient(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_InternalLinkTransient(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *emalloc(size_t s) {
  void *p;
  p = malloc(s);
  if (p == NULL)
    err(1, "malloc failed");
  return (p);
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <emalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <emalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"malloc failed\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %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 @err(i32 1, 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"malloc failed\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ is_vdi_attr_obj(int /*<<< orphan*/);
int /*<<< orphan*/ is_vdi_obj(int /*<<< orphan*/);
int /*<<< orphan*/ is_vmstate_obj(int /*<<< orphan*/);
int is_data_obj(uint64_t oid) {
  return !is_vdi_obj(oid) && !is_vmstate_obj(oid) && !is_vdi_attr_obj(oid);
}


x86 assembly (clang, -O0):
<is_data_obj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_vdi_obj@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    117e <is_data_obj+0x4e>
mov    -0x4(%rbp),%edi
call   1040 <is_vmstate_obj@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    117e <is_data_obj+0x4e>
mov    -0x4(%rbp),%edi
call   1050 <is_vdi_attr_obj@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_data_obj>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <is_vdi_obj@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    1159 <is_data_obj+0x29>
mov    %ebp,%edi
call   1040 <is_vmstate_obj@plt>
test   %eax,%eax
jne    1159 <is_data_obj+0x29>
mov    %ebp,%edi
call   1050 <is_vdi_attr_obj@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_data_obj(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @is_vdi_obj(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @is_vmstate_obj(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @is_vdi_attr_obj(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_data_obj(i32 %0) {
%2 = tail call i32 @is_vdi_obj(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 @is_vmstate_obj(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @is_vdi_attr_obj(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void get_u32(const unsigned char *buf, uint32_t *up) {
  uint32_t b, u = 0;
  int i;
  for (i = 0; i < 4; i++) {
    b = buf[i];
    u <<= 8;
    u |= b;
  }
  *up = u;
}


x86 assembly (clang, -O0):
<get_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1153 <get_u32+0x53>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <get_u32+0x1a>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @get_u32(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %4, 16
%12 = shl nuw nsw i32 %7, 8
%13 = or i32 %11, %12
%14 = or i32 %13, %10
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %14, 8
%19 = or i32 %18, %17
store i32 %19, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dmmtadd_(int *, int *, double *, double *, int *, double *,
                            double *, int *);
void wcc_dmmtadd_(int *M, int *N, char *ALPHA, char *A, int *LDA, char *BETA,
                  char *B, int *LDB) {
  dmmtadd_(M, N, (double *)ALPHA, (double *)A, LDA, (double *)BETA, (double *)B,
           LDB);
}


x86 assembly (clang, -O0):
<wcc_dmmtadd_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dmmtadd_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_dmmtadd_>:
jmp    1030 <dmmtadd_@plt>

LLVM IR (-O0):
define void @wcc_dmmtadd_(i32* %0, i32* %1, i8* %2, i8* %3, i32* %4, i8* %5, i8* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32* %4, i32** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store i32* %7, i32** %16
%17 = load i32*, i32** %9
%18 = load i32*, i32** %10
%19 = load i8*, i8** %11
%20 = bitcast i8* %19 to double*
%21 = load i8*, i8** %12
%22 = bitcast i8* %21 to double*
%23 = load i32*, i32** %13
%24 = load i8*, i8** %14
%25 = bitcast i8* %24 to double*
%26 = load i8*, i8** %15
%27 = bitcast i8* %26 to double*
%28 = load i32*, i32** %16
%29 = call i32 @dmmtadd_(i32* %17, i32* %18, double* %20, double* %22, i32* %23, double* %25, double* %27, i32* %28)
ret void
}

LLVM IR (-O2):
define void @wcc_dmmtadd_(i32* %0, i32* %1, i8* %2, i8* %3, i32* %4, i8* %5, i8* %6, i32* %7) {
%9 = bitcast i8* %2 to double*
%10 = bitcast i8* %3 to double*
%11 = bitcast i8* %5 to double*
%12 = bitcast i8* %6 to double*
%13 = tail call i32 @dmmtadd_(i32* %0, i32* %1, double* %9, double* %10, i32* %4, double* %11, double* %12, i32* %7)
ret void
}
/* Variables and functions */
double atan(double);
double fn(double x, int k) {
  double d;
  d = atan(x) - x + k * 3.1415926535897932384626433832795;
  return d;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
subsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x8(%rsp)
call   1030 <atan@plt>
cvtsi2sd %ebx,%xmm1
subsd  0x8(%rsp),%xmm0
mulsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fn(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%6 = load double, double* %3
%7 = call double @atan(double %6)
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double %11, double 0x400921FB54442D18, double %9)
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @fn(double %0, i32 %1) {
%3 = tail call double @atan(double %0)
%4 = fsub double %3, %0
%5 = sitofp i32 %1 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x400921FB54442D18, double %4)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "Usage: %s \n", argv[0]);
    exit(EXIT_FAILURE);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116a <main+0x4a>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114c <main+0x2c>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Usage: %s \0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = load i32, i32* @EXIT_SUCCESS
%12 = tail call i32 @exit(i32 %11)
unreachable
}
int test_imm_13uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x13 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_13uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1245184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void um_free(uint32_t *p) { free(p - 1); }


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

x86 assembly (clang, -O2):
<um_free>:
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @um_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = call i32 @free(i32* %4)
ret void
}

LLVM IR (-O2):
define void @um_free(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = tail call i32 @free(i32* %2)
ret void
}
char *strcpyb(char *dest, const char *src) {
  char *cptr = dest;
  while (*src) {
    *cptr++ = *src++;
  }
  *cptr = *src;
  return dest;
}


x86 assembly (clang, -O0):
<strcpyb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpyb+0x48>
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    1114 <strcpyb+0x14>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpyb>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpyb+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpyb+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpyb(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
scalar_t__ fmod(float, int);
int integer(float a) {
  bool result = 0;
  if (fmod(a, 1) == 0)
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <fmod@plt>
cmp    $0x0,%rax
jne    1144 <integer+0x34>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer>:
push   %rax
mov    $0x1,%edi
call   1030 <fmod@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @integer(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
store i32 0, i32* %3
%4 = load float, float* %2
%5 = call i64 @fmod(float %4, i32 1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @integer(float %0) {
%2 = tail call i64 @fmod(float %0, i32 1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void OTG_FS_WKUP_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @OTG_FS_WKUP_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int errno;
int posix_memalign(void **, size_t, size_t);
void *memalign(size_t align, size_t len) {
  void *mem;
  int ret;
  if ((ret = posix_memalign(&mem, align, len))) {
    errno = ret;
    return 0;
  }
  return mem;
}


x86 assembly (clang, -O0):
<memalign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1156 <memalign+0x46>
mov    -0x24(%rbp),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    115e <memalign+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalign>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
test   %eax,%eax
je     1130 <memalign+0x20>
mov    0x2eb6(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i8* @memalign(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i32 @posix_memalign(i8** %6, i64 %8, i64 %9)
store i32 %10, i32* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %7
store i32 %13, i32* @errno
store i8* null, i8** %3
br label %16
14: ; preds = %2
%15 = load i8*, i8** %6
store i8* %15, i8** %3
br label %16
16: ; preds = %14, %12
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @memalign(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @posix_memalign(i8** %3, i64 %0, i64 %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
store i32 %5, i32* @errno
br label %10
8: ; preds = %2
%9 = load i8*, i8** %3
br label %10
10: ; preds = %8, %7
%11 = phi i8* [ null, %7 ], [ %9, %8 ]
ret i8* %11
}
__attribute__((always_)) void __WAIT(void) { __asm volatile("wait"); }


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

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

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

LLVM IR (-O2):
define void @__WAIT() {
tail call void asm sideeffect "wait", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ia_free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<ia_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ia_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_51int8_reg(signed char val) {
  return ((val) & (-0x51 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_51int8_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, -81
%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_51int8_reg(i8 signext %0) {
%2 = and i8 %0, -81
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int max_sum(int *, int);
int max_sum_brute(int *, int);
int test_all_positives() {
  int input[] = {8, 4, 1, 9, 4, 5, 3};
  return 34 == max_sum_brute(input, 7) && 34 == max_sum(input, 7);
  ;
}


x86 assembly (clang, -O0):
<test_all_positives>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1040 <max_sum_brute@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x22,%ecx
cmp    %edx,%ecx
mov    %al,-0x21(%rbp)
jne    1191 <test_all_positives+0x71>
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <max_sum@plt>
mov    %eax,%ecx
mov    $0x22,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_positives>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <max_sum_brute@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x22,%ecx
jne    1168 <test_all_positives+0x48>
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <max_sum@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x22,%ecx
sete   %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_all_positives.input = [7 x i32] [i32 8, i32 4, i32 1, i32 9, i32 4, i32 5, i32 3]
define i32 @test_all_positives() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @max_sum_brute(i32* %3, i32 7)
%5 = icmp eq i32 34, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = call i32 @max_sum(i32* %7, i32 7)
%9 = icmp eq i32 34, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test_all_positives.input = [7 x i32] [i32 8, i32 4, i32 1, i32 9, i32 4, i32 5, i32 3]
define i32 @test_all_positives() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @max_sum_brute(i32* %3, i32 7)
%5 = icmp eq i32 %4, 34
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @max_sum(i32* %3, i32 7)
%8 = icmp eq i32 %7, 34
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
void HPLSTM25PM$USARTControl$setModeSPI(void) {
  HPLUSART0M$USARTControl$setModeSPI();
}


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

x86 assembly (clang, -O2):
<HPLSTM25PM$USARTControl$setModeSPI>:
xor    %eax,%eax
jmp    1030 <HPLUSART0M$USARTControl$setModeSPI@plt>

LLVM IR (-O0):
define void @"HPLSTM25PM$USARTControl$setModeSPI"() {
%1 = call i32 (...) @"HPLUSART0M$USARTControl$setModeSPI"()
ret void
}

LLVM IR (-O2):
define void @"HPLSTM25PM$USARTControl$setModeSPI"() {
%1 = tail call i32 (...) @"HPLUSART0M$USARTControl$setModeSPI"()
ret void
}