xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ width;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_width(void *_p) {
  return (int)((XWindowAttributes *)_p)->width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowAttributes_width(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_XWindowAttributes_width(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*/ sapi_unix_tcp_client_destroy(int);
void sapi_close_syslog(int syslog_sock) {
  sapi_unix_tcp_client_destroy(syslog_sock);
}


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

x86 assembly (clang, -O2):
<sapi_close_syslog>:
jmp    1030 <sapi_unix_tcp_client_destroy@plt>

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

LLVM IR (-O2):
define void @sapi_close_syslog(i32 %0) {
%2 = tail call i32 @sapi_unix_tcp_client_destroy(i32 %0)
ret void
}
int f5(int i) { return i ? i << 10 : 0; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <f5+0x1f>
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <f5+0x29>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <f5+0x29>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %edi,%eax
shl    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @f5(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 = shl i32 %6, 10
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @f5(i32 %0) {
%2 = shl i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("please input a number  bigger then 999\n");
  scanf("%d", &number);
  printf("%d", number / 100 % 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"please input a number bigger then 999\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 100
%7 = srem i32 %6, 10
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [39 x i8] c"please input a number bigger then 999\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sdiv i32 %5, 100
%7 = srem i32 %6, 10
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x72() {
  Assert_real((isalpha(114)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              575, ("isalpha should be 1 for r"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x72>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x23f,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x72>:
push   %rax
mov    $0x72,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x23f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for r\00"
define void @t_isalpha_0x72() {
%1 = call i32 @isalpha(i32 114)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for r\00"
define void @t_isalpha_0x72() {
%1 = tail call i32 @isalpha(i32 114)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("usage:\t./arp-poison <interface> <gateway ip> <mac addr>");
  puts("ex:\t./arp-poison eth0 10.1.1.1 aa:bb:cc:dd:ee:ff");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"usage:\09./arp-poison <interface> <gateway ip> <mac addr>\00"
@.str.1 = [49 x i8] c"ex:\09./arp-poison eth0 10.1.1.1 aa:bb:cc:dd:ee:ff\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [56 x i8] c"usage:\09./arp-poison <interface> <gateway ip> <mac addr>\00"
@.str.1 = [49 x i8] c"ex:\09./arp-poison eth0 10.1.1.1 aa:bb:cc:dd:ee:ff\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_40int32_mem(int *val) {
  return ((*val) & (0x40 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_40int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 64
%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_40int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 64
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x4b() {
  Assert_real((isspace(75) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              380, ("isspace should be 0 for K"));
}


x86 assembly (clang, -O0):
<t_isspace_0x4b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4b,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x17c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x4b>:
push   %rax
mov    $0x4b,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x17c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for K\00"
define void @t_isspace_0x4b() {
%1 = call i64 @isspace(i32 75)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for K\00"
define void @t_isspace_0x4b() {
%1 = tail call i64 @isspace(i32 75)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int a = 0;
L1:
  if (a == 1) {
    goto L2;
  }
  a++;
  goto L1;
  if (1 == 2) {
    if (1 == 2) {
    L2:
      return a;
    }
  }
  abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1121 <main+0x21>
jmp    112f <main+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %3
br label %13
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; No predecessors!
br i1 false, label %11, label %16
11: ; preds = %10
br i1 false, label %12, label %15
12: ; preds = %11
br label %13
13: ; preds = %12, %6
%14 = load i32, i32* %2
ret i32 %14
15: ; preds = %11
br label %16
16: ; preds = %15, %10
%17 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
fatal(str) char *str;
{
  printf("%s\n", str);
  exit(-1);
}


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

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
unreachable
}

LLVM IR (-O2):
define i32 @fatal(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
tail call void @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
long sysconf(int /*<<< orphan*/);
int hardware_concurrency() {
  long numCPU = sysconf(_SC_NPROCESSORS_ONLN);
  if (numCPU <= 0)
    return 1;
  if (numCPU >= 4)
    return 4;
  return (int)numCPU;
}


x86 assembly (clang, -O0):
<hardware_concurrency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1141 <hardware_concurrency+0x31>
movl   $0x1,-0x4(%rbp)
jmp    115f <hardware_concurrency+0x4f>
cmpq   $0x4,-0x10(%rbp)
jl     1158 <hardware_concurrency+0x48>
movl   $0x4,-0x4(%rbp)
jmp    115f <hardware_concurrency+0x4f>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hardware_concurrency>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
cmp    $0x4,%rax
mov    $0x4,%ecx
cmovl  %eax,%ecx
test   %rax,%rax
mov    $0x1,%eax
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @hardware_concurrency() {
%1 = alloca i32
%2 = alloca i64
%3 = load i32, i32* @_SC_NPROCESSORS_ONLN
%4 = call i64 @sysconf(i32 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp sle i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %15
8: ; preds = %0
%9 = load i64, i64* %2
%10 = icmp sge i64 %9, 4
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 4, i32* %1
br label %15
12: ; preds = %8
%13 = load i64, i64* %2
%14 = trunc i64 %13 to i32
store i32 %14, i32* %1
br label %15
15: ; preds = %12, %11, %7
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @hardware_concurrency() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i64 @sysconf(i32 %1)
%3 = icmp slt i64 %2, 1
%4 = icmp sgt i64 %2, 3
%5 = trunc i64 %2 to i32
%6 = select i1 %4, i32 4, i32 %5
%7 = select i1 %3, i32 1, i32 %6
ret i32 %7
}
/* Variables and functions */
int check_name(const char *str, size_t sz) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @check_name(i8* nocapture readnone %0, i64 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mtp3cli [-h host] [-p port] cmd ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: mtp3cli [-h host] [-p port] cmd ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: mtp3cli [-h host] [-p port] cmd ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int HadTu_hdrSize();
void *HadTu_data(const void *my) {
  return (void *)((char *)my + HadTu_hdrSize());
}


x86 assembly (clang, -O0):
<HadTu_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <HadTu_hdrSize@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HadTu_data>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <HadTu_hdrSize@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @HadTu_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @HadTu_hdrSize()
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
ret i8* %6
}

LLVM IR (-O2):
define i8* @HadTu_data(i8* readnone %0) {
%2 = tail call i32 (...) @HadTu_hdrSize()
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
int main() {
  int a, b, c;
  if (a) {
    b = 0;
    c = 0;
  } else {
    b = 0;
    c = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1136 <main+0x36>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int npu_has_flash(void) {
  return ((*(volatile unsigned long *)((0xfaff8000 + 0x0a00) | 0x18)) &
          ((1 << 1)));
}


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

x86 assembly (clang, -O2):
<npu_has_flash>:
mov    $0xfaff8a18,%eax
mov    (%rax),%rax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @npu_has_flash() {
%1 = load volatile i64, i64* inttoptr (i64 4211051032 to i64*)
%2 = and i64 %1, 2
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @npu_has_flash() {
%1 = load volatile i64, i64* inttoptr (i64 4211051032 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 2
ret i32 %3
}
/* Type definitions */
struct t_creature {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ entity_train4(struct t_creature *, int, int, int);
void entity_train(struct t_creature *e, int trainedskill, int experience) {
  entity_train4(e, trainedskill, experience, 99);
}


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

x86 assembly (clang, -O2):
<entity_train>:
mov    $0x63,%ecx
jmp    1030 <entity_train4@plt>

LLVM IR (-O0):
%struct.t_creature = type { i32 }
define void @entity_train(%struct.t_creature* %0, i32 %1, i32 %2) {
%4 = alloca %struct.t_creature*
%5 = alloca i32
%6 = alloca i32
store %struct.t_creature* %0, %struct.t_creature** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.t_creature*, %struct.t_creature** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @entity_train4(%struct.t_creature* %7, i32 %8, i32 %9, i32 99)
ret void
}

LLVM IR (-O2):
%struct.t_creature = type { i32 }
define void @entity_train(%struct.t_creature* %0, i32 %1, i32 %2) {
%4 = tail call i32 @entity_train4(%struct.t_creature* %0, i32 %1, i32 %2, i32 99)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *appName) {
  printf("%s -h        # For help\n", appName);
  printf("%s widthBytes inputFilename outputFilename      # Rotate bits in a "
         "file\n",
         appName);
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s -h # For help\0A\00"
@.str.1 = [73 x i8] c"%s widthBytes inputFilename outputFilename # Rotate bits in a file\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s -h # For help\0A\00"
@.str.1 = [73 x i8] c"%s widthBytes inputFilename outputFilename # Rotate bits in a file\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void nrf_drv_radio802154_timer_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_drv_radio802154_timer_deinit() {
ret void
}
/* Variables and functions */
double exp(double);
double pow(unsigned int, unsigned int);
double sqrt(int);
double factorial(unsigned int n) {
  return sqrt((2 * n + 1 / 3.0) * 3.1415926) * pow(n, n) * exp(-(double)n);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    %eax,%eax
cvtsi2sd %rax,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%eax
cvtsi2sd %rax,%xmm0
addsd  0xeb9(%rip),%xmm0
mulsd  0xeb9(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorpd  0xe8b(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @factorial(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 2, %3
%5 = uitofp i32 %4 to double
%6 = fadd double %5, 0x3FD5555555555555
%7 = fmul double %6, 0x400921FB4D12D84A
%8 = fptosi double %7 to i32
%9 = call double @sqrt(i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = call double @pow(i32 %10, i32 %11)
%13 = fmul double %9, %12
%14 = load i32, i32* %2
%15 = uitofp i32 %14 to double
%16 = fneg double %15
%17 = call double @exp(double %16)
%18 = fmul double %13, %17
ret double %18
}

LLVM IR (-O2):
define double @factorial(i32 %0) {
%2 = shl i32 %0, 1
%3 = uitofp i32 %2 to double
%4 = fadd double %3, 0x3FD5555555555555
%5 = fmul double %4, 0x400921FB4D12D84A
%6 = fptosi double %5 to i32
%7 = tail call double @sqrt(i32 %6)
%8 = tail call double @pow(i32 %0, i32 %0)
%9 = fmul double %7, %8
%10 = uitofp i32 %0 to double
%11 = fneg double %10
%12 = tail call double @exp(double %11)
%13 = fmul double %9, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex4array_(void *x, unsigned int *n) {
  popNarray((char *)x, (*n * 4));
}


x86 assembly (clang, -O0):
<popcomplex4array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x2,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcomplex4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <popNarray@plt>

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

LLVM IR (-O2):
define void @popcomplex4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
void foo595(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo595(i32 %0) {
ret void
}
char is_esc_seq(char ch) {
  switch (ch) {
  case 'a':
    return '\a';
  case 'b':
    return '\b';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case 'v':
    return '\v';
  default:
    return -1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<is_esc_seq>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1173 <is_esc_seq+0x73>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x7,-0x1(%rbp)
jmp    1177 <is_esc_seq+0x77>
movb   $0x8,-0x1(%rbp)
jmp    1177 <is_esc_seq+0x77>
movb   $0xc,-0x1(%rbp)
jmp    1177 <is_esc_seq+0x77>
movb   $0xa,-0x1(%rbp)
jmp    1177 <is_esc_seq+0x77>
movb   $0xd,-0x1(%rbp)
jmp    1177 <is_esc_seq+0x77>
movb   $0x9,-0x1(%rbp)
jmp    1177 <is_esc_seq+0x77>
movb   $0xb,-0x1(%rbp)
jmp    1177 <is_esc_seq+0x77>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_esc_seq>:
add    $0xffffff9f,%edi
cmp    $0x15,%edi
ja     111d <is_esc_seq+0x1d>
mov    $0x7,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x8,%al
ret
mov    $0xff,%al
ret
mov    $0xc,%al
ret
mov    $0xa,%al
ret
mov    $0x9,%al
ret
mov    $0xb,%al
ret
mov    $0xd,%al
ret

LLVM IR (-O0):
define signext i8 @is_esc_seq(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 97, label %6
i32 98, label %7
i32 102, label %8
i32 110, label %9
i32 114, label %10
i32 116, label %11
i32 118, label %12
]
6: ; preds = %1
store i8 7, i8* %2
br label %14
7: ; preds = %1
store i8 8, i8* %2
br label %14
8: ; preds = %1
store i8 12, i8* %2
br label %14
9: ; preds = %1
store i8 10, i8* %2
br label %14
10: ; preds = %1
store i8 13, i8* %2
br label %14
11: ; preds = %1
store i8 9, i8* %2
br label %14
12: ; preds = %1
store i8 11, i8* %2
br label %14
13: ; preds = %1
store i8 -1, i8* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @is_esc_seq(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 97, label %10
i32 98, label %3
i32 102, label %4
i32 110, label %5
i32 114, label %6
i32 116, label %7
i32 118, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i8 [ -1, %9 ], [ 11, %8 ], [ 9, %7 ], [ 13, %6 ], [ 10, %5 ], [ 12, %4 ], [ 8, %3 ], [ 7, %1 ]
ret i8 %11
}
/* Variables and functions */
int nonreplen(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int num;
  int count;
  for (count = 0, num = 0; num < 1000000; ++num) {
    if (nonreplen(num) == 60)
      count++;
  }
  printf("%d\n", count);
  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)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4240,-0x14(%rbp)
jge    117e <main+0x5e>
mov    -0x14(%rbp),%edi
call   1040 <nonreplen@plt>
cmp    $0x3c,%eax
jne    116b <main+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1170 <main+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x18(%rbp),%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <nonreplen@plt>
xor    %ecx,%ecx
cmp    $0x3c,%eax
sete   %cl
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0xf4240,%ebp
jne    1130 <main+0x10>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %6
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 1000000
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %6
%13 = call i32 @nonreplen(i32 %12)
%14 = icmp eq i32 %13, 60
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
br label %18
18: ; preds = %15, %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %8
22: ; preds = %8
%23 = load i32, i32* %7
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %9, %3 ]
%5 = phi i32 [ 0, %2 ], [ %10, %3 ]
%6 = tail call i32 @nonreplen(i32 %5)
%7 = icmp eq i32 %6, 60
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 1000000
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
void free_submatrix(b, nrl, nrh, ncl, nch) double **b;
int nrl, nrh, ncl, nch;
{ free((char *)(b + nrl)); }


x86 assembly (clang, -O0):
<free_submatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_submatrix>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_submatrix(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store double** %0, double*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double*, double** %11, i64 %13
%15 = bitcast double** %14 to i8*
ret void
}

LLVM IR (-O2):
define void @free_submatrix(double** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double*, double** %0, i64 %6
%8 = bitcast double** %7 to i8*
tail call void @free(i8* %8)
ret void
}
void _exit(int status __attribute__((unused))) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

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

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
unsigned long SwapWW(unsigned long i) {
  unsigned int result = (i >> 16) & 0xffff;
  result |= (i << 16) & 0xffff0000;
  return (result);
}


x86 assembly (clang, -O0):
<SwapWW>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xffff,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
shl    $0x10,%rcx
movabs $0xffff0000,%rax
and    %rax,%rcx
mov    -0xc(%rbp),%eax
or     %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapWW>:
mov    %rdi,%rax
rol    $0x10,%eax
ret

LLVM IR (-O0):
define i64 @SwapWW(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 16
%6 = and i64 %5, 65535
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i64, i64* %2
%9 = shl i64 %8, 16
%10 = and i64 %9, 4294901760
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = or i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = zext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
define i64 @SwapWW(i64 %0) {
%2 = lshr i64 %0, 16
%3 = shl i64 %0, 16
%4 = and i64 %2, 65535
%5 = and i64 %3, 4294901760
%6 = or i64 %4, %5
ret i64 %6
}
int test_imm_CCint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xCC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CCint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 204
%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_CCint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13369344
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("       X\n      XXX\n     XXXXX\n    XXXXXXX\n   XXXXXXXXX\n  "
         "XXXXXXXXXXX\n XXXXXXXXXXXXX\nXXXXXXXXXXXXXXX\n      XX\n      XX\n   "
         "  XXXX\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [129 x i8] c" X\0A XXX\0A XXXXX\0A XXXXXXX\0A XXXXXXXXX\0A XXXXXXXXXXX\0A XXXXXXXXXXXXX\0AXXXXXXXXXXXXXXX\0A XX\0A XX\0A XXXX\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [128 x i8] c" X\0A XXX\0A XXXXX\0A XXXXXXX\0A XXXXXXXXX\0A XXXXXXXXXXX\0A XXXXXXXXXXXXX\0AXXXXXXXXXXXXXXX\0A XX\0A XX\0A XXXX\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void gtk_clipboard_store() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_store() {
ret void
}
void input_null(void) { return; }


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

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

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

LLVM IR (-O2):
define void @input_null() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int somefun(int u) {
  int v = 5 * u + 2;
  printf("somefun u=%d gives v=%d\n", u, v);
  return v;
}


x86 assembly (clang, -O0):
<somefun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<somefun>:
push   %rbx
mov    %edi,%esi
lea    (%rsi,%rsi,4),%ebx
add    $0x2,%ebx
lea    0xee0(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"somefun u=%d gives v=%d\0A\00"
define i32 @somefun(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 5, %4
%6 = add nsw i32 %5, 2
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [25 x i8] c"somefun u=%d gives v=%d\0A\00"
define i32 @somefun(i32 %0) {
%2 = mul nsw i32 %0, 5
%3 = add nsw i32 %2, 2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3)
ret i32 %3
}
/* Variables and functions */
char *bson_find_field(char *, char *, int);
int bson_find_field_as_document(char *buffer, char *field, char **data) {
  char *tmp = bson_find_field(buffer, field, 0x03);
  if (tmp) {
    *data = tmp + 4;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bson_find_field_as_document>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x3,%edx
call   1030 <bson_find_field@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <bson_find_field_as_document+0x50>
mov    -0x28(%rbp),%rcx
add    $0x4,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1167 <bson_find_field_as_document+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_find_field_as_document>:
push   %rbx
mov    %rdx,%rbx
mov    $0x3,%edx
call   1030 <bson_find_field@plt>
test   %rax,%rax
je     1131 <bson_find_field_as_document+0x21>
add    $0x4,%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bson_find_field_as_document(i8* %0, i8* %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @bson_find_field(i8* %0, i8* %1, i32 3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 4
store i8* %7, i8** %2
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strpbrk(char *, char *);
void uninitvar_strpbrk(void) {
  char *cs;
  char *ct;
  (void)strpbrk(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninitvar_strpbrk>:
jmp    1030 <strpbrk@plt>

LLVM IR (-O0):
define void @uninitvar_strpbrk() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strpbrk(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strpbrk() {
%1 = tail call i32 @strpbrk(i8* undef, i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putch(char const);
unsigned int strlen(char const *);
void kprintf(const char *str) {
  unsigned int i = 0;
  unsigned int len = strlen(str);
  for (i = 0; i < len; i++) {
    putch(str[i]);
  }
}


x86 assembly (clang, -O0):
<kprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1170 <kprintf+0x50>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <putch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <kprintf+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprintf>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
je     1153 <kprintf+0x33>
mov    %eax,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <putch@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <kprintf+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @kprintf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putch(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
double sqrt(double);
double hypot2(double *a) {
  double r;
  r = *a * *a;
  a++;
  r += *a * *a;
  return sqrt(r);
}


x86 assembly (clang, -O0):
<hypot2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypot2>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <hypot2+0x24>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @hypot2(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = load double, double* %6
%8 = fmul double %5, %7
store double %8, double* %3
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i32 1
store double* %10, double** %2
%11 = load double*, double** %2
%12 = load double, double* %11
%13 = load double*, double** %2
%14 = load double, double* %13
%15 = load double, double* %3
%16 = call double @llvm.fmuladd.f64(double %12, double %14, double %15)
store double %16, double* %3
%17 = load double, double* %3
%18 = call double @sqrt(double %17)
ret double %18
}

LLVM IR (-O2):
define double @hypot2(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, %2
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %3)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("cruntime tests\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"cruntime tests\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}