xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fail(char *, int);
void check(int x) {
  if (x) {
    fail("pthread", x);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <check+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1122 <check+0x12>
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <fail@plt>
ret

LLVM IR (-O0):
@.str = [8 x i8] c"pthread\00"
define void @check(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @fail(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"pthread\00"
define void @check(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fail(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int is_prime(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char inp_num[55];
  fgets(inp_num, 11, stdin);
  printf("%d", is_prime(inp_num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0xb,%esi
call   1040 <fgets@plt>
lea    -0x40(%rbp),%rdi
call   1050 <is_prime@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <is_prime@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [55 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [55 x i8], [55 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 11, i32 %4)
%6 = getelementptr inbounds [55 x i8], [55 x i8]* %2, i64 0, i64 0
%7 = call i32 @is_prime(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [55 x i8]
%2 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 11, i32 %3)
%5 = call i32 @is_prime(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int min(int a, int b) { return ((a < b) ? a : b); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned int get32bit(unsigned char *b) {
  return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
}


x86 assembly (clang, -O0):
<get32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get32bit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get32bit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
char *strstr(char const *, char const *);
int search_pattern(const char *s, const char *pattern) {
  char *srch;
  srch = strstr(s, pattern);
  if (srch == NULL)
    return -1;
  else
    return (int)(srch - s);
}


x86 assembly (clang, -O0):
<search_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1148 <search_pattern+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <search_pattern+0x46>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_pattern>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @search_pattern(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @search_pattern(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
scalar_t__ dup2(int, int);
int /*<<< orphan*/ err_exit(char *);
void _movefd(int fd1, int fd2) {
  if (dup2(fd1, fd2) < 0)
    err_exit("dup2");
  (void)close(fd1);
}


x86 assembly (clang, -O0):
<_movefd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
cmp    $0x0,%rax
jge    115f <_movefd+0x2f>
lea    0xea6(%rip),%rdi
call   1050 <err_exit@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_movefd>:
push   %rbx
mov    %edi,%ebx
call   1030 <dup2@plt>
test   %rax,%rax
jns    1149 <_movefd+0x19>
lea    0xebc(%rip),%rdi
call   1050 <err_exit@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"dup2\00"
define void @_movefd(i32 %0, i32 %1) {
%3 = tail call i64 @dup2(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_exit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @close(i32 %0)
ret void
}
int gcd(int a, int b) {
  int temp;
  while (b > 0) {
    temp = a;
    a = b;
    b = temp % b;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
size_t unserialize_uint16(unsigned char const *in, size_t in_size,
                          unsigned short *v) {
  if (in_size < 2)
    return 0;
  if (v != NULL)
    *v = (in[0] | (in[1] << 8));
  return 2;
}


x86 assembly (clang, -O0):
<unserialize_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x2,-0x18(%rbp)
jae    1128 <unserialize_uint16+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1159 <unserialize_uint16+0x59>
cmpq   $0x0,-0x20(%rbp)
je     1151 <unserialize_uint16+0x51>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x20(%rbp),%rax
mov    %cx,(%rax)
movq   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unserialize_uint16>:
cmp    $0x2,%rsi
jae    1109 <unserialize_uint16+0x9>
xor    %eax,%eax
ret
mov    $0x2,%eax
test   %rdx,%rdx
je     1119 <unserialize_uint16+0x19>
movzwl (%rdi),%ecx
mov    %cx,(%rdx)
ret

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

LLVM IR (-O2):
define i64 @unserialize_uint16(i8* nocapture %0, i64 %1, i16* writeonly %2) {
%4 = icmp ult i64 %1, 2
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = icmp eq i16* %2, null
br i1 %6, label %15, label %7
7: ; preds = %5
%8 = load i8, i8* %0
%9 = zext i8 %8 to i16
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = shl nuw i16 %12, 8
%14 = or i16 %13, %9
store i16 %14, i16* %2
br label %15
15: ; preds = %5, %7, %3
%16 = phi i64 [ 0, %3 ], [ 2, %7 ], [ 2, %5 ]
ret i64 %16
}
void pthread_getconcurrency() {}


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

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

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

LLVM IR (-O2):
define void @pthread_getconcurrency() {
ret void
}
int __attribute__((const)) my_sqrt(unsigned char i) {
  int j, k;
  for (j = 0, k = 0; j++ <= i; j += ++k << 1)
    ;
  return k;
}


x86 assembly (clang, -O0):
<my_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jg     114b <my_sqrt+0x4b>
jmp    1134 <my_sqrt+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
shl    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <my_sqrt+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sqrt>:
xor    %eax,%eax
mov    $0x2,%ecx
xor    %edx,%edx
nopl   0x0(%rax)
add    $0x1,%eax
add    %ecx,%edx
add    $0x1,%edx
add    $0x2,%ecx
cmp    %edi,%edx
jle    1110 <my_sqrt+0x10>
ret

LLVM IR (-O0):
define i32 @my_sqrt(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %6, %9
br i1 %10, label %11, label %18
11: ; preds = %5
br label %12
12: ; preds = %11
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = shl i32 %14, 1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @my_sqrt(i8 zeroext %0) {
%2 = zext i8 %0 to i32
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %7, %3 ]
%5 = phi i32 [ 0, %1 ], [ %9, %3 ]
%6 = add nsw i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = shl nuw i32 %7, 1
%9 = add nsw i32 %6, %8
%10 = icmp sgt i32 %9, %2
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 %7
}
int handle_post(int socket) {}


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

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

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

LLVM IR (-O2):
define i32 @handle_post(i32 %0) {
ret i32 undef
}
void RTFileToNative(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileToNative() {
ret void
}
int cal3(float a) {
  float b = 1.2;
  float c = 2.2;
  if ((a + b) != c)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<cal3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1142 <cal3+0x42>
jp     1142 <cal3+0x42>
jmp    114e <cal3+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <cal3+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal3>:
addss  0xef8(%rip),%xmm0
cmpeqss 0xef3(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cal3(float %0) {
%2 = fadd float %0, 0x3FF3333340000000
%3 = fcmp oeq float %2, 0x40019999A0000000
%4 = zext i1 %3 to i32
ret i32 %4
}
void av_opt_set_image_size() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_set_image_size() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(281, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x119,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_target_system_to_container>:
mov    $0x119,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_multprec_target_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 281, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 281, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int memcmp(char *, char *, int);
int keycmp(char *a1, char *a2) {
  int result;
  result = memcmp(a1, a2, 2);
  return result;
}


x86 assembly (clang, -O0):
<keycmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keycmp>:
mov    $0x2,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @keycmp(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 2)
ret i32 %3
}
int pinmux_check_ops(const struct pinmux_ops *ops) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pinmux_ops = type opaque
define i32 @pinmux_check_ops(%struct.pinmux_ops* nocapture readnone %0) {
ret i32 0
}
void td_minus(double *a) {
  a[0] = -a[0];
  a[1] = -a[1];
  a[2] = -a[2];
}


x86 assembly (clang, -O0):
<td_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_minus>:
movups (%rdi),%xmm0
movaps 0xef6(%rip),%xmm1
xorps  %xmm1,%xmm0
movups %xmm0,(%rdi)
movsd  0x10(%rdi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @td_minus(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fneg double %5
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 0
store double %6, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fneg double %11
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = fneg double %17
%19 = load double*, double** %2
%20 = getelementptr inbounds double, double* %19, i64 2
store double %18, double* %20
ret void
}

LLVM IR (-O2):
define void @td_minus(double* nocapture %0) {
%2 = bitcast double* %0 to <2 x double>*
%3 = load <2 x double>, <2 x double>* %2
%4 = fneg <2 x double> %3
%5 = bitcast double* %0 to <2 x double>*
store <2 x double> %4, <2 x double>* %5
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = fneg double %7
store double %8, double* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(int);
int /*<<< orphan*/ i2cWrite(int, int, int);
void ms5611_reset(void) {
  i2cWrite(0x77, 0x1E, 1);
  delayMicroseconds(2800);
}


x86 assembly (clang, -O0):
<ms5611_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77,%edi
mov    $0x1e,%esi
mov    $0x1,%edx
call   1040 <i2cWrite@plt>
mov    $0xaf0,%edi
call   1030 <delayMicroseconds@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms5611_reset>:
push   %rax
mov    $0x77,%edi
mov    $0x1e,%esi
mov    $0x1,%edx
call   1040 <i2cWrite@plt>
mov    $0xaf0,%edi
pop    %rax
jmp    1030 <delayMicroseconds@plt>

LLVM IR (-O0):
define void @ms5611_reset() {
%1 = call i32 @i2cWrite(i32 119, i32 30, i32 1)
%2 = call i32 @delayMicroseconds(i32 2800)
ret void
}

LLVM IR (-O2):
define void @ms5611_reset() {
%1 = tail call i32 @i2cWrite(i32 119, i32 30, i32 1)
%2 = tail call i32 @delayMicroseconds(i32 2800)
ret void
}
/* Variables and functions */
void HardFault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HardFault_Handler+0x9>
jmp    1109 <HardFault_Handler+0x9>

x86 assembly (clang, -O2):
<HardFault_Handler>:
jmp    1100 <HardFault_Handler>

LLVM IR (-O0):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void gentrunc_w_s() {}


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

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

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

LLVM IR (-O2):
define void @gentrunc_w_s() {
ret void
}
short QCC_Short(short l) { return l; }


x86 assembly (clang, -O0):
<QCC_Short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @QCC_Short(i16 returned signext %0) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ RAND_cleanup();
void seed_prng_cleanup(void) { RAND_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @seed_prng_cleanup() {
%1 = tail call i32 (...) @RAND_cleanup()
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_20(uint64_t x) {
  __asm__("rolq $20, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_20>:
mov    %rdi,%rax
rol    $0x14,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_20(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$20, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_20(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$20, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_block_comment_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_block_comment(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_block_comment_rec(lexbuf, 18); });
}


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

x86 assembly (clang, -O2):
<Cyc_block_comment>:
mov    $0x12,%esi
jmp    1030 <Cyc_block_comment_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_block_comment(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_block_comment_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 18)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_block_comment(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_block_comment_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 18)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ funca();
void funcb(int j) {
  struct foo {
    int a;
    int b;
  };
  struct foo bar;
  bar.a = 42;
  bar.b = 84;
  funca();
  return;
}


x86 assembly (clang, -O0):
<funcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2a,-0x10(%rbp)
movl   $0x54,-0xc(%rbp)
mov    $0x0,%al
call   1030 <funca@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.foo = type { i32, i32 }
define void @funcb(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.foo
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.foo, %struct.foo* %3, i32 0, i32 0
store i32 42, i32* %4
%5 = getelementptr inbounds %struct.foo, %struct.foo* %3, i32 0, i32 1
store i32 84, i32* %5
%6 = call i32 (...) @funca()
ret void
}

LLVM IR (-O2):
define void @funcb(i32 %0) {
%2 = tail call i32 (...) @funca()
ret void
}
/* Variables and functions */
int ls(char *);
int main(int argc, char *argval[]) {
  if (argc < 2)
    return ls(".");
  else
    return ls(argval[1]);
}


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    1144 <main+0x34>
lea    0xec9(%rip),%rdi
call   1030 <ls@plt>
mov    %eax,-0x4(%rbp)
jmp    1154 <main+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ls@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jge    1121 <main+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <ls@plt>
mov    0x8(%rsi),%rdi
jmp    1030 <ls@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @ls(i8* %8)
ret i32 %9
}
void discrete_world_2D_testbench_apply_function_unit_square(
    struct discrete_world_2D *world, unsigned int selected_world,
    unsigned int param_index, unsigned int x, unsigned int y, void *new_unit) {
  *(long *)new_unit = (*(long *)new_unit) * (*(long *)new_unit);
}


x86 assembly (clang, -O0):
<discrete_world_2D_testbench_apply_function_unit_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x20(%rbp),%rax
imul   (%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<discrete_world_2D_testbench_apply_function_unit_square>:
mov    (%r9),%rax
imul   %rax,%rax
mov    %rax,(%r9)
ret

LLVM IR (-O0):
%struct.discrete_world_2D = type opaque
define void @discrete_world_2D_testbench_apply_function_unit_square(%struct.discrete_world_2D* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca %struct.discrete_world_2D*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store %struct.discrete_world_2D* %0, %struct.discrete_world_2D** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i8*, i8** %12
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %12
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = mul nsw i64 %15, %18
%20 = load i8*, i8** %12
%21 = bitcast i8* %20 to i64*
store i64 %19, i64* %21
ret void
}

LLVM IR (-O2):
%struct.discrete_world_2D = type opaque
define void @discrete_world_2D_testbench_apply_function_unit_square(%struct.discrete_world_2D* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* nocapture %5) {
%7 = bitcast i8* %5 to i64*
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, %8
store i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bench_free(void *);
void bench_free0(void *p) {
  if (p)
    bench_free(p);
}


x86 assembly (clang, -O0):
<bench_free0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <bench_free0+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <bench_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_free0>:
test   %rdi,%rdi
je     111a <bench_free0+0xa>
jmp    1030 <bench_free@plt>
ret

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

LLVM IR (-O2):
define void @bench_free0(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @bench_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out_line_count(char const *);
int /*<<< orphan*/ printf(char const *, char const *, int);
void out_str_dec(const char *fmt, const char *str, int n) {
  printf(fmt, str, n);
  out_line_count(fmt);
  out_line_count(str);
}


x86 assembly (clang, -O0):
<out_str_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <out_line_count@plt>
mov    -0x10(%rbp),%rdi
call   1040 <out_line_count@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_str_dec>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <out_line_count@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <out_line_count@plt>

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

LLVM IR (-O2):
define void @out_str_dec(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* %0, i8* %1, i32 %2)
%5 = tail call i32 @out_line_count(i8* %0)
%6 = tail call i32 @out_line_count(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void _print_int(void *d) {
  if (d == NULL)
    printf("0");
  else
    printf("%d", *(int *)d);
}


x86 assembly (clang, -O0):
<_print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113a <_print_int+0x2a>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114e <_print_int+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_int>:
test   %rdi,%rdi
je     1135 <_print_int+0x15>
mov    (%rdi),%esi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
mov    $0x30,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [3 x i8] c"%d\00"
define void @_print_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
define void @_print_int(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putchar(i32 48)
br label %9
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}
void av_get_picture_type_char() {}


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

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

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

LLVM IR (-O2):
define void @av_get_picture_type_char() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ override_redirect;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
int get_XSetWindowAttributes_override_redirect(void *_p) {
  return (int)((XSetWindowAttributes *)_p)->override_redirect;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XSetWindowAttributes_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int api_error_translate(int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int api_tcp_nodelay(int fd, int enable) {
  int result =
      setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&enable, sizeof(int));
  if (result == 0)
    return 0;
  return api_error_translate(result);
}


x86 assembly (clang, -O0):
<api_tcp_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116b <api_tcp_nodelay+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1176 <api_tcp_nodelay+0x56>
mov    -0x10(%rbp),%edi
call   1040 <api_error_translate@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_tcp_nodelay>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %eax,%eax
je     1154 <api_tcp_nodelay+0x34>
mov    %eax,%edi
call   1040 <api_error_translate@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @api_tcp_nodelay(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @IPPROTO_TCP
%9 = load i32, i32* @TCP_NODELAY
%10 = bitcast i32* %5 to i8*
%11 = call i32 @setsockopt(i32 %7, i32 %8, i32 %9, i8* %10, i32 4)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %18
15: ; preds = %2
%16 = load i32, i32* %6
%17 = call i32 @api_error_translate(i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @api_tcp_nodelay(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = bitcast i32* %3 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %6, i32 4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @api_error_translate(i32 %7)
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ %10, %9 ], [ 0, %2 ]
ret i32 %12
}
void vportRefresh() {}


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

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

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

LLVM IR (-O2):
define void @vportRefresh() {
ret void
}
/* Variables and functions */
size_t left(size_t i) { return 2 * i + 1; }


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @left(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 2, %3
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @left(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ parse_tokens();
int main() {
  parse_tokens();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @parse_tokens()
ret i32 0
}
int test_imm_C7uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xC7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C7uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 854698491904
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct pollfd {
  int dummy;
};
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int poll(struct pollfd *fds, nfds_t nfds, int timeout) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<poll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pollfd*
%5 = alloca i32
%6 = alloca i32
store %struct.pollfd* %0, %struct.pollfd** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @poll(%struct.pollfd* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ bitmap_size(int);
unsigned long *calloc(int, int /*<<< orphan*/);
unsigned long *bitmap_alloc(int nr_bits) {
  return calloc(1, bitmap_size(nr_bits));
}


x86 assembly (clang, -O0):
<bitmap_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bitmap_size@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_alloc>:
push   %rax
call   1040 <bitmap_size@plt>
mov    $0x1,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i64* @bitmap_alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bitmap_size(i32 %3)
%5 = call i64* @calloc(i32 1, i32 %4)
ret i64* %5
}

LLVM IR (-O2):
define noalias i64* @bitmap_alloc(i32 %0) {
%2 = tail call i32 @bitmap_size(i32 %0)
%3 = tail call i64* @calloc(i32 1, i32 %2)
ret i64* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GENERAL_NAME;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_dup(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ GENERAL_NAME_it;
GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a) {
  return ASN1_item_dup(&GENERAL_NAME_it, a);
}


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

x86 assembly (clang, -O2):
<GENERAL_NAME_dup>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rdi
jmp    1030 <ASN1_item_dup@plt>

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

LLVM IR (-O2):
@GENERAL_NAME_it = global i32 0
define i32* @GENERAL_NAME_dup(i32* %0) {
%2 = tail call i32* @ASN1_item_dup(i32* @GENERAL_NAME_it, i32* %0)
ret i32* %2
}
unsigned long DRV_GET_GSM_PLL_STATUS(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @DRV_GET_GSM_PLL_STATUS() {
ret i64 0
}

LLVM IR (-O2):
define i64 @DRV_GET_GSM_PLL_STATUS() {
ret i64 0
}