xunge/DecIR huggingface dataset:
int findLinear(int *array, int needle, int sz) {
  int i;
  for (i = 0; i < sz - 1; i++)
    if (array[i] == needle)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<findLinear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1158 <findLinear+0x58>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1145 <findLinear+0x45>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <findLinear+0x5f>
jmp    114a <findLinear+0x4a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <findLinear+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findLinear>:
mov    $0xffffffff,%eax
cmp    $0x2,%edx
jl     111e <findLinear+0x1e>
add    $0xffffffff,%edx
xor    %ecx,%ecx
nop
cmp    %esi,(%rdi,%rcx,4)
je     111f <findLinear+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <findLinear+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findLinear(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = add nsw i32 %2, -1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %13
%9 = phi i64 [ 0, %5 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %1
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %18, label %8
16: ; preds = %8
%17 = trunc i64 %9 to i32
br label %18
18: ; preds = %13, %16, %3
%19 = phi i32 [ -1, %3 ], [ %17, %16 ], [ -1, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(unsigned char);
void put_word(unsigned short w) {
  put_byte((unsigned char)w);
  put_byte((unsigned char)(w >> 8));
}


x86 assembly (clang, -O0):
<put_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movzbl %al,%edi
call   1030 <put_byte@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%edi
call   1030 <put_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_word>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <put_byte@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put_byte@plt>

LLVM IR (-O0):
define void @put_word(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = trunc i16 %3 to i8
%5 = call i32 @put_byte(i8 zeroext %4)
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = call i32 @put_byte(i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @put_word(i16 zeroext %0) {
%2 = trunc i16 %0 to i8
%3 = tail call i32 @put_byte(i8 zeroext %2)
%4 = lshr i16 %0, 8
%5 = trunc i16 %4 to i8
%6 = tail call i32 @put_byte(i8 zeroext %5)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t EPIWriteFIFOCountGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000204))));
}


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

x86 assembly (clang, -O2):
<EPIWriteFIFOCountGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x204(%rax),%rax
ret

LLVM IR (-O0):
define i64 @EPIWriteFIFOCountGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 516
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @EPIWriteFIFOCountGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 516
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7U;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 690137161UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jae    1151 <RandomFunc+0x51>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%eax
and    $0x2922a849,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x120a000,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = zext i32 %9 to i64
%11 = and i64 %10, 914778474
%12 = shl i64 %11, 7
%13 = trunc i64 %12 to i32
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %13, i32* %14
store i32 0, i32* %6
br label %15
15: ; preds = %21, %2
%16 = load i32, i32* %6
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = icmp ult i32 %16, %19
br i1 %20, label %21, label %31
21: ; preds = %15
%22 = load i32, i32* %6
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%27 = load i32, i32* %26
%28 = and i32 %27, %25
store i32 %28, i32* %26
%29 = load i32, i32* %6
%30 = add i32 %29, 1
store i32 %30, i32* %6
br label %15
31: ; preds = %15
%32 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%33 = load i32, i32* %32
%34 = zext i32 %33 to i64
%35 = and i64 %34, 690137161
%36 = trunc i64 %35 to i32
%37 = load i32*, i32** %4
%38 = getelementptr inbounds i32, i32* %37, i64 0
store i32 %36, i32* %38
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 7
%5 = and i32 %4, 18915328
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
char *allocate(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strallocate(char const *str) {
  char *copy;
  size_t size;
  size = strlen(str) + 1;
  copy = allocate(size);
  memcpy(copy, str, size);
  return copy;
}


x86 assembly (clang, -O0):
<strallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strallocate>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strallocate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i8* @allocate(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strallocate(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @allocate(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
__attribute__((always_)) size_t min_size_t(size_t a, size_t b) {
  return a < b ? a : b;
}


x86 assembly (clang, -O0):
<min_size_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <min_size_t+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_size_t+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_size_t>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min_size_t(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void anetSockName(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               43, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<anetSockName>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2b,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetSockName>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x2b,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetSockName = [13 x i8] c"anetSockName\00"
define void @anetSockName() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.anetSockName, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetSockName = [13 x i8] c"anetSockName\00"
define void @anetSockName() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.anetSockName, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void test99_Test_pollen__run__E() { exit(0); }


x86 assembly (clang, -O0):
<test99_Test_pollen__run__E>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<test99_Test_pollen__run__E>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @test99_Test_pollen__run__E() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test99_Test_pollen__run__E() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
extern void int_handler(int signum) {
  printf("Received signal %d .. wating\n", signum);
  sleep(2);
  printf("Leaving int_handler\n");
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Received signal %d .. wating\0A\00"
@.str.1 = [21 x i8] c"Leaving int_handler\0A\00"
define void @int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 2)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Received signal %d .. wating\0A\00"
@str = [20 x i8] c"Leaving int_handler\00"
define void @int_handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x2_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x2_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x2_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x2_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x2_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ CNameOf(int /*<<< orphan*/);
int /*<<< orphan*/ Log(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ Me();
int /*<<< orphan*/ TextOf(int /*<<< orphan*/);
void Act_Typo(void) {
  Log("Typo: %s - %s\n", CNameOf(Me()), TextOf(ArgText()));
}


x86 assembly (clang, -O0):
<Act_Typo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <Me@plt>
mov    %eax,%edi
call   1030 <CNameOf@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ArgText@plt>
mov    %eax,%edi
call   1070 <TextOf@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xe7d(%rip),%rdi
call   1050 <Log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Typo>:
push   %rbx
xor    %eax,%eax
call   1060 <Me@plt>
mov    %eax,%edi
call   1030 <CNameOf@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ArgText@plt>
mov    %eax,%edi
call   1070 <TextOf@plt>
lea    0xe8a(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1050 <Log@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Typo: %s - %s\0A\00"
define void @Act_Typo() {
%1 = call i32 (...) @Me()
%2 = call i32 @CNameOf(i32 %1)
%3 = call i32 (...) @ArgText()
%4 = call i32 @TextOf(i32 %3)
%5 = call i32 @Log(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Typo: %s - %s\0A\00"
define void @Act_Typo() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 @CNameOf(i32 %1)
%3 = tail call i32 (...) @ArgText()
%4 = tail call i32 @TextOf(i32 %3)
%5 = tail call i32 @Log(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret void
}
void fd212(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  a : {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  p02C:
    goto p02C;
    goto a;
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


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

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

LLVM IR (-O0):
define void @fd212(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = zext i32 %27 to i64
br label %29
29: ; preds = %29, %26
br label %29
30: ; preds = %30
br label %30
31: ; No predecessors!
%32 = load i32, i32* %2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %34, %31
br label %34
35: ; preds = %35
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd212(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rotate_left(int, int);
uint32_t L_trans(uint32_t x) {
  return (x ^ rotate_left(x, 2) ^ rotate_left(x, 10) ^ rotate_left(x, 18) ^
          rotate_left(x, 24));
}


x86 assembly (clang, -O0):
<L_trans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <rotate_left@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1030 <rotate_left@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x12,%esi
call   1030 <rotate_left@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x18,%esi
call   1030 <rotate_left@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L_trans>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <rotate_left@plt>
mov    %eax,%r15d
xor    %ebx,%r15d
mov    %ebx,%edi
mov    $0xa,%esi
call   1030 <rotate_left@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x12,%esi
call   1030 <rotate_left@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
xor    %r15d,%ebp
mov    %ebx,%edi
mov    $0x18,%esi
call   1030 <rotate_left@plt>
xor    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @L_trans(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @rotate_left(i32 %4, i32 2)
%6 = xor i32 %3, %5
%7 = load i32, i32* %2
%8 = call i32 @rotate_left(i32 %7, i32 10)
%9 = xor i32 %6, %8
%10 = load i32, i32* %2
%11 = call i32 @rotate_left(i32 %10, i32 18)
%12 = xor i32 %9, %11
%13 = load i32, i32* %2
%14 = call i32 @rotate_left(i32 %13, i32 24)
%15 = xor i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @L_trans(i32 %0) {
%2 = tail call i32 @rotate_left(i32 %0, i32 2)
%3 = xor i32 %2, %0
%4 = tail call i32 @rotate_left(i32 %0, i32 10)
%5 = xor i32 %3, %4
%6 = tail call i32 @rotate_left(i32 %0, i32 18)
%7 = xor i32 %5, %6
%8 = tail call i32 @rotate_left(i32 %0, i32 24)
%9 = xor i32 %7, %8
ret i32 %9
}
int test_imm_17uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x17 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_17uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 23
%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_17uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 98784247808
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int getch(void) {
  char chx;
  __asm__ __volatile__("xor %%ah, %%ah\n"
                       "int $0x16\n"
                       "mov %%al, %0\n"
                       : "=r"(chx)
                       :);
  return chx;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
xor    %ah,%ah
int    $0x16
mov    %al,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
xor    %ah,%ah
int    $0x16
mov    %al,%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @getch() {
%1 = alloca i8
%2 = call i8 asm sideeffect "xor %ah, %ah\0Aint $$0x16\0Amov %al, $0\0A", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @getch() {
%1 = tail call i8 asm sideeffect "xor %ah, %ah\0Aint $$0x16\0Amov %al, $0\0A", "=r,~{dirflag},~{fpsr},~{flags}"()
%2 = sext i8 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fn0800_0222();
void fn0800_0245() {
  fn0800_0222();
  fn0800_0222();
  fn0800_0222();
  fn0800_0222();
  fn0800_0222();
  fn0800_0222();
  fn0800_0222();
  fn0800_0222();
  fn0800_0222();
  return;
}


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

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

LLVM IR (-O0):
define void @fn0800_0245() {
%1 = call i32 (...) @fn0800_0222()
%2 = call i32 (...) @fn0800_0222()
%3 = call i32 (...) @fn0800_0222()
%4 = call i32 (...) @fn0800_0222()
%5 = call i32 (...) @fn0800_0222()
%6 = call i32 (...) @fn0800_0222()
%7 = call i32 (...) @fn0800_0222()
%8 = call i32 (...) @fn0800_0222()
%9 = call i32 (...) @fn0800_0222()
ret void
}

LLVM IR (-O2):
define void @fn0800_0245() {
%1 = tail call i32 (...) @fn0800_0222()
%2 = tail call i32 (...) @fn0800_0222()
%3 = tail call i32 (...) @fn0800_0222()
%4 = tail call i32 (...) @fn0800_0222()
%5 = tail call i32 (...) @fn0800_0222()
%6 = tail call i32 (...) @fn0800_0222()
%7 = tail call i32 (...) @fn0800_0222()
%8 = tail call i32 (...) @fn0800_0222()
%9 = tail call i32 (...) @fn0800_0222()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ norm2(double, double, double, double);
double sqrt(int /*<<< orphan*/);
double norm(double x1, double y1, double x2, double y2) {
  return sqrt(norm2(x1, y1, x2, y2));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <norm2@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
push   %rax
call   1030 <norm2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @norm(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @norm2(double %9, double %10, double %11, double %12)
%14 = call double @sqrt(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @norm(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @norm2(double %0, double %1, double %2, double %3)
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
/* Variables and functions */
int fn5(int, int);
int fn6(int x) { return fn5(x, 2); }


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

x86 assembly (clang, -O2):
<fn6>:
mov    $0x2,%esi
jmp    1030 <fn5@plt>

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

LLVM IR (-O2):
define i32 @fn6(i32 %0) {
%2 = tail call i32 @fn5(i32 %0, i32 2)
ret i32 %2
}
void TWI1_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @TWI1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
float *vec3_multiply(float *result, float *a, float *b) {
  result[0] = a[0] * b[0];
  result[1] = a[1] * b[1];
  result[2] = a[2] * b[2];
  return result;
}


x86 assembly (clang, -O0):
<vec3_multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_multiply>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
mulss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
mulss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
mulss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define float* @vec3_multiply(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fmul float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fmul float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fmul float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
%34 = load float*, float** %4
ret float* %34
}

LLVM IR (-O2):
define float* @vec3_multiply(float* returned writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fmul float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fmul float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret float* %0
}
int isPrime(int n) {
  int i;
  if (n < 2)
    return 0;
  for (i = 2; i * i <= n; i++) {
    if (!(n % i))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <isPrime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    116a <isPrime+0x6a>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1163 <isPrime+0x63>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <isPrime+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <isPrime+0x6a>
jmp    1155 <isPrime+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <isPrime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <isPrime+0xa>
mov    %ecx,%eax
ret
cmp    $0x4,%edi
jae    1115 <isPrime+0x15>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <isPrime+0x7>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1120 <isPrime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = mul nsw i32 %12, %12
%7 = icmp sgt i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %12, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %8 ], [ 1, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void nrerror2(char error_text[]) {
  fprintf(stderr, "Numerical Recipes run-time error...\n");
  fprintf(stderr, "%s\n", error_text);
  fprintf(stderr, "...now exiting to system...\n");
  exit(13);
}


x86 assembly (clang, -O0):
<nrerror2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0xd,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nrerror2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedc(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xd,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nrerror2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 13)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nrerror2(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 13)
unreachable
}
void bitvector_set(void *vec, long index) {
  int offset = index / 8;
  ((char *)vec)[offset] |= 1 << (index % 8);
}


x86 assembly (clang, -O0):
<bitvector_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitvector_set>:
mov    %rsi,%rcx
lea    0x7(%rsi),%rax
test   %rsi,%rsi
cmovns %rsi,%rax
sar    $0x3,%rax
lea    0x0(,%rax,8),%edx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bitvector_set(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = sdiv i64 %6, 8
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i64, i64* %4
%10 = srem i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = shl i32 1, %11
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = or i32 %18, %12
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @bitvector_set(i8* nocapture %0, i64 %1) {
%3 = sdiv i64 %1, 8
%4 = srem i64 %1, 8
%5 = trunc i64 %4 to i32
%6 = shl nuw nsw i32 1, %5
%7 = shl i64 %3, 32
%8 = ashr exact i64 %7, 32
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = trunc i32 %6 to i8
%12 = or i8 %10, %11
store i8 %12, i8* %9
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/warn.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/warn.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/warn.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printSpanArray(int *, int);
int main() {
  int arr[] = {45, 56, 78, 34, 110, 120, 80, 140};
  printSpanArray(arr, sizeof(arr) / sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <printSpanArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <printSpanArray@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i32] [i32 45, i32 56, i32 78, i32 34, i32 110, i32 120, i32 80, i32 140]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @printSpanArray(i32* %4, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [8 x i32] [i32 45, i32 56, i32 78, i32 34, i32 110, i32 120, i32 80, i32 140]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @printSpanArray(i32* %3, i32 8)
ret i32 0
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ SOL_IP;
int /*<<< orphan*/ SO_ORIGINAL_DST;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
               struct sockaddr_storage *, int *);
int getorigdest(int fd, struct sockaddr_storage *addr) {
  socklen_t len = sizeof(*addr);
  return getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, addr, &len);
}


x86 assembly (clang, -O0):
<getorigdest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <getsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getorigdest>:
push   %rax
mov    %rsi,%rcx
movl   $0x4,0x4(%rsp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%esi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
@SOL_IP = global i32 0
@SO_ORIGINAL_DST = global i32 0
define i32 @getorigdest(i32 %0, %struct.sockaddr_storage* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_storage*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.sockaddr_storage* %1, %struct.sockaddr_storage** %4
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_IP
%8 = load i32, i32* @SO_ORIGINAL_DST
%9 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %4
%10 = call i32 @getsockopt(i32 %6, i32 %7, i32 %8, %struct.sockaddr_storage* %9, i32* %5)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
@SOL_IP = global i32 0
@SO_ORIGINAL_DST = global i32 0
define i32 @getorigdest(i32 %0, %struct.sockaddr_storage* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%5 = load i32, i32* @SOL_IP
%6 = load i32, i32* @SO_ORIGINAL_DST
%7 = call i32 @getsockopt(i32 %0, i32 %5, i32 %6, %struct.sockaddr_storage* %1, i32* %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ inc_cinc();
int /*<<< orphan*/ inc_vinc();
void incincs(void) {
  inc_vinc();
  inc_cinc();
}


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

x86 assembly (clang, -O2):
<incincs>:
push   %rax
xor    %eax,%eax
call   1030 <inc_vinc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <inc_cinc@plt>

LLVM IR (-O0):
define void @incincs() {
%1 = call i32 (...) @inc_vinc()
%2 = call i32 (...) @inc_cinc()
ret void
}

LLVM IR (-O2):
define void @incincs() {
%1 = tail call i32 (...) @inc_vinc()
%2 = tail call i32 (...) @inc_cinc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void RET_() {
  ;
  _c_setbyte(0xc3);
  ;
}


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

x86 assembly (clang, -O2):
<RET_>:
mov    $0xc3,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @RET_() {
%1 = call i32 @_c_setbyte(i32 195)
ret void
}

LLVM IR (-O2):
define void @RET_() {
%1 = tail call i32 @_c_setbyte(i32 195)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exit_fun(void) { printf("I am in exit_fun\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"I am in exit_fun\0A\00"
define void @exit_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"I am in exit_fun\00"
define void @exit_fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}