xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void handler(int sig) { fprintf(stdout, "SIGNAL: %d\n", sig); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"SIGNAL: %d\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"SIGNAL: %d\0A\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_cmd(int, char *, int);
void send_cmd_i3(int cmd_code, int arg1, int arg2, int arg3) {
  int ibuf[3];
  ibuf[0] = arg1;
  ibuf[1] = arg2;
  ibuf[2] = arg3;
  send_cmd(cmd_code, (char *)ibuf, 3 * sizeof(int));
}


x86 assembly (clang, -O0):
<send_cmd_i3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1c(%rbp),%rsi
mov    $0xc,%edx
call   1030 <send_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd_i3>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0xc,%edx
call   1030 <send_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @send_cmd_i3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %7
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32, i32* %8
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
store i32 %14, i32* %15
%16 = load i32, i32* %5
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%18 = bitcast i32* %17 to i8*
%19 = call i32 @send_cmd(i32 %16, i8* %18, i32 12)
ret void
}

LLVM IR (-O2):
define void @send_cmd_i3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %2, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %3, i32* %9
%10 = call i32 @send_cmd(i32 %0, i8* %6, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
void SetSinWavGenInt(void) {
  RamWrite32A(0x0000 + 0x0334, 0x00000000);
  RamWrite32A(0x0004 + 0x0000 + 0x0334, 0x00000000);
  RamWrite32A(0x0004 + 0x0004 + 0x0000 + 0x0334, 0x00000000);
  RamWrite32A(0x0000 + 0x0348, 0x00000000);
  RamWrite32A(0x0004 + 0x0000 + 0x0348, 0x20000000);
  RamWrite32A(0x0004 + 0x0004 + 0x0000 + 0x0348, 0x00000000);
  RamWrite32A(0x0004 + 0x0000 + 0x0328, 0x00000000);
}


x86 assembly (clang, -O0):
<SetSinWavGenInt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x334,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x338,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x33c,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x348,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x34c,%edi
mov    $0x20000000,%esi
call   1030 <RamWrite32A@plt>
mov    $0x350,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x32c,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetSinWavGenInt>:
push   %rax
mov    $0x334,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x338,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x33c,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x348,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x34c,%edi
mov    $0x20000000,%esi
call   1030 <RamWrite32A@plt>
mov    $0x350,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x32c,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <RamWrite32A@plt>

LLVM IR (-O0):
define void @SetSinWavGenInt() {
%1 = call i32 @RamWrite32A(i32 820, i32 0)
%2 = call i32 @RamWrite32A(i32 824, i32 0)
%3 = call i32 @RamWrite32A(i32 828, i32 0)
%4 = call i32 @RamWrite32A(i32 840, i32 0)
%5 = call i32 @RamWrite32A(i32 844, i32 536870912)
%6 = call i32 @RamWrite32A(i32 848, i32 0)
%7 = call i32 @RamWrite32A(i32 812, i32 0)
ret void
}

LLVM IR (-O2):
define void @SetSinWavGenInt() {
%1 = tail call i32 @RamWrite32A(i32 820, i32 0)
%2 = tail call i32 @RamWrite32A(i32 824, i32 0)
%3 = tail call i32 @RamWrite32A(i32 828, i32 0)
%4 = tail call i32 @RamWrite32A(i32 840, i32 0)
%5 = tail call i32 @RamWrite32A(i32 844, i32 536870912)
%6 = tail call i32 @RamWrite32A(i32 848, i32 0)
%7 = tail call i32 @RamWrite32A(i32 812, i32 0)
ret void
}
/* Variables and functions */
unsigned int exp2(unsigned int);
int log(int);
unsigned int trunc(int);
unsigned int closest_smaller_2exp(unsigned int x) {
  x = (trunc(log(x) / log(2)));
  return exp2(x);
}


x86 assembly (clang, -O0):
<closest_smaller_2exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <log@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1050 <log@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <trunc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exp2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closest_smaller_2exp>:
push   %rbx
call   1050 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1050 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <trunc@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <exp2@plt>

LLVM IR (-O0):
define i32 @closest_smaller_2exp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log(i32 %3)
%5 = call i32 @log(i32 2)
%6 = sdiv i32 %4, %5
%7 = call i32 @trunc(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @exp2(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @closest_smaller_2exp(i32 %0) {
%2 = tail call i32 @log(i32 %0)
%3 = tail call i32 @log(i32 2)
%4 = sdiv i32 %2, %3
%5 = tail call i32 @trunc(i32 %4)
%6 = tail call i32 @exp2(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_vector(float *v, long nl, long nh) { free((void *)(v + nl - 1)); }


x86 assembly (clang, -O0):
<free_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @free_vector(float* %0, i64 %1, i64 %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca i64
store float* %0, float** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load float*, float** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds float, float* %7, i64 %8
%10 = getelementptr inbounds float, float* %9, i64 -1
%11 = bitcast float* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_vector(float* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds float, float* %0, i64 %1
%5 = getelementptr inbounds float, float* %4, i64 -1
%6 = bitcast float* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PI_vminit();
PI_main_init() {
  PI_vminit();
  return (1);
}


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

x86 assembly (clang, -O2):
<PI_main_init>:
push   %rax
xor    %eax,%eax
call   1030 <PI_vminit@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PI_main_init() {
%1 = call i32 (...) @PI_vminit()
ret i32 1
}

LLVM IR (-O2):
define i32 @PI_main_init() {
%1 = tail call i32 (...) @PI_vminit()
ret i32 1
}
void illegal_instruction(void) {
  asm volatile(".long 0x8008ce82; .long 0x00009343;");
}


x86 assembly (clang, -O0):
<illegal_instruction>:
push   %rbp
mov    %rsp,%rbp
(bad)
(bad)
or     %al,0x9343(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<illegal_instruction>:
(bad)
(bad)
or     %al,0x9343(%rax)
ret

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

LLVM IR (-O2):
define void @illegal_instruction() {
tail call void asm sideeffect ".long 0x8008ce82; .long 0x00009343;", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int atoi(char s[]) {
  int i, n;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i)
    n = 10 * n + (s[i] - '0');
  return n;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     113e <atoi+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114e <atoi+0x4e>
jmp    1174 <atoi+0x74>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atoi+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
cmp    $0x9,%dl
ja     112b <atoi+0x2b>
add    $0x1,%rdi
xchg   %ax,%ax
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1110 <atoi+0x10>
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %34, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 48
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 57
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %37
23: ; preds = %21
%24 = load i32, i32* %4
%25 = mul nsw i32 10, %24
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 48
%33 = add nsw i32 %25, %32
store i32 %33, i32* %4
br label %34
34: ; preds = %23
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %5
37: ; preds = %21
%38 = load i32, i32* %4
ret i32 %38
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i64 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8 [ %15, %5 ], [ %2, %1 ]
%8 = phi i32 [ %12, %5 ], [ undef, %1 ]
%9 = zext i8 %7 to i32
%10 = mul nsw i32 %8, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = add nuw nsw i64 %6, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i32 [ undef, %1 ], [ %12, %5 ]
ret i32 %19
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
unsigned long long timespec_to_usecs(struct timespec *time_spec) {
  unsigned long long retval = 0;
  retval = time_spec->tv_sec * 1000000;
  retval += time_spec->tv_nsec / 1000;
  return retval;
}


x86 assembly (clang, -O0):
<timespec_to_usecs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_usecs>:
movslq (%rdi),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usecs(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca i64
store %struct.timespec* %0, %struct.timespec** %2
store i64 0, i64* %3
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load %struct.timespec*, %struct.timespec** %2
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = sext i32 %12 to i64
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usecs(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %5
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ EX_OK;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void printHelpAndExit() {
  printf("Usage: arborealis [switches] <source file>\n");
  printf("Switches:\n");
  printf("  -h, --help    Print this help screen\n");
  printf("  --version     Print version information\n");
  exit(EX_OK);
}


x86 assembly (clang, -O0):
<printHelpAndExit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printHelpAndExit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: arborealis [switches] <source file>\0A\00"
@.str.1 = [11 x i8] c"Switches:\0A\00"
@.str.2 = [40 x i8] c" -h, --help Print this help screen\0A\00"
@.str.3 = [43 x i8] c" --version Print version information\0A\00"
@EX_OK = global i32 0
define void @printHelpAndExit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @EX_OK
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EX_OK = global i32 0
@str = [43 x i8] c"Usage: arborealis [switches] <source file>\00"
@str.4 = [10 x i8] c"Switches:\00"
@str.5 = [39 x i8] c" -h, --help Print this help screen\00"
@str.6 = [42 x i8] c" --version Print version information\00"
define void @printHelpAndExit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
%5 = load i32, i32* @EX_OK
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close(int const);
void close_inet_rx_sock(const int sock_fd) {
  {};
  if (sock_fd != -1) {
    close(sock_fd);
  }
  {};
}


x86 assembly (clang, -O0):
<close_inet_rx_sock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112d <close_inet_rx_sock+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_inet_rx_sock>:
cmp    $0xffffffff,%edi
je     111a <close_inet_rx_sock+0xa>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @close_inet_rx_sock(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
struct argp_state {
  int dummy;
};
typedef int /*<<< orphan*/ error_t;

/* Variables and functions */
int /*<<< orphan*/ ARGP_ERR_UNKNOWN;
error_t parse_opt(int key, char *arg, struct argp_state *state) {
  switch (key) {
  default:
    return ARGP_ERR_UNKNOWN;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_opt>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.argp_state = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* %1, %struct.argp_state* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.argp_state*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.argp_state* %2, %struct.argp_state** %6
%7 = load i32, i32* %4
switch i32 %7, label %8 [
]
8: ; preds = %3
%9 = load i32, i32* @ARGP_ERR_UNKNOWN
ret i32 %9
}

LLVM IR (-O2):
%struct.argp_state = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* nocapture readnone %1, %struct.argp_state* nocapture readnone %2) {
%4 = load i32, i32* @ARGP_ERR_UNKNOWN
ret i32 %4
}
void Rotate_Left(char *str, int size) {
  int c;
  char temp;
  temp = str[0];
  for (c = 0; c < size - 1; c++) {
    str[c] = str[c + 1];
  }
  str[size - 1] = temp;
}


x86 assembly (clang, -O0):
<Rotate_Left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1155 <Rotate_Left+0x55>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111b <Rotate_Left+0x1b>
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rotate_Left>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%r14b
lea    -0x1(%rsi),%ebp
cmp    $0x2,%esi
jl     1130 <Rotate_Left+0x20>
lea    0x1(%rbx),%rsi
mov    %ebp,%edx
mov    %rbx,%rdi
call   1030 <memmove@plt>
movslq %ebp,%rax
mov    %r14b,(%rbx,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Rotate_Left(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = add i32 %1, -1
%5 = icmp sgt i32 %1, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = getelementptr i8, i8* %0, i64 1
%8 = zext i32 %4 to i64
br label %9
9: ; preds = %6, %2
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %3, i8* %11
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *getstr() {
  char *pchar;
  pchar = (char *)malloc(sizeof(char) * 10);
  strcpy(pchar, "my string");
  return pchar;
}


x86 assembly (clang, -O0):
<getstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstr>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"my string\00"
define i8* @getstr() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"my string\00"
define i8* @getstr() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
char *_resposta_padrao(int, int, char *);
char *ComunicarCertificadoICPBRASIL(int sessao, char *codigo_ativacao,
                                    char *certificado) {
  return _resposta_padrao(sessao, 05000, "Certificado transmitido com sucesso");
}


x86 assembly (clang, -O0):
<ComunicarCertificadoICPBRASIL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa00,%esi
lea    0xece(%rip),%rdx
call   1030 <_resposta_padrao@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComunicarCertificadoICPBRASIL>:
lea    0xee9(%rip),%rdx
mov    $0xa00,%esi
jmp    1030 <_resposta_padrao@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Certificado transmitido com sucesso\00"
define i8* @ComunicarCertificadoICPBRASIL(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i8* @_resposta_padrao(i32 %7, i32 2560, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}

LLVM IR (-O2):
@.str = [36 x i8] c"Certificado transmitido com sucesso\00"
define i8* @ComunicarCertificadoICPBRASIL(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* @_resposta_padrao(i32 %0, i32 2560, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
int test_fun(char **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_fun(i8** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ my_err(char *, char *, int, char const *, int const);
void __MY_FREE(void *ptr, const char *filename, const int line_num) {
  if (ptr == NULL) {
    my_err("%s:%d: attempt to free NULL ptr at: %s:%d\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/"
           "memutil.c",
           62, filename, line_num);
  }
  free(ptr);
}


x86 assembly (clang, -O0):
<__MY_FREE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <__MY_FREE+0x3e>
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb3(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x3e,%edx
call   1040 <my_err@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__MY_FREE>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1147 <__MY_FREE+0x27>
mov    %edx,%r8d
mov    %rsi,%rcx
lea    0xeca(%rip),%rdi
lea    0xeee(%rip),%rsi
mov    $0x3e,%edx
call   1040 <my_err@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"%s:%d: attempt to free NULL ptr at: %s:%d\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/memutil.c\00"
define void @__MY_FREE(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @my_err(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 62, i8* %10, i32 %11)
br label %13
13: ; preds = %9, %3
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"%s:%d: attempt to free NULL ptr at: %s:%d\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/memutil.c\00"
define void @__MY_FREE(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @my_err(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 62, i8* %1, i32 %2)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: gonzalez fileroot [subsetfiles]\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"usage: gonzalez fileroot [subsetfiles]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"usage: gonzalez fileroot [subsetfiles]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int crypto_secretbox_xsalsa20poly1305_open(unsigned char *,
                                           unsigned char const *,
                                           unsigned long long,
                                           unsigned char const *,
                                           unsigned char const *);
int crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m,
                                                       const unsigned char *c,
                                                       unsigned long long clen,
                                                       const unsigned char *n,
                                                       const unsigned char *k) {
  return crypto_secretbox_xsalsa20poly1305_open(m, c, clen, n, k);
}


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

x86 assembly (clang, -O2):
<crypto_box_curve25519xsalsa20poly1305_open_afternm>:
jmp    1030 <crypto_secretbox_xsalsa20poly1305_open@plt>

LLVM IR (-O0):
define i32 @crypto_box_curve25519xsalsa20poly1305_open_afternm(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @crypto_secretbox_xsalsa20poly1305_open(i8* %11, i8* %12, i64 %13, i8* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @crypto_box_curve25519xsalsa20poly1305_open_afternm(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = tail call i32 @crypto_secretbox_xsalsa20poly1305_open(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4)
ret i32 %6
}
/* Type definitions */
typedef double uint32_t;

/* Variables and functions */
double sqrt(double);
int isSquare(uint32_t a) {
  double tmp = sqrt((double)a / 2);
  return ((uint32_t)tmp == tmp);
}


x86 assembly (clang, -O0):
<isSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSquare>:
push   %rax
mulsd  0xee7(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1129 <isSquare+0x19>
sqrtsd %xmm0,%xmm0
jmp    112e <isSquare+0x1e>
call   1030 <sqrt@plt>
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setnp  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isSquare(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 2.000000e+00
%6 = call double @sqrt(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fcmp oeq double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isSquare(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = tail call double @sqrt(double %2)
%4 = fcmp ord double %3, 0.000000e+00
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *programname) {
  printf("Usage: %s [-v] <file> <user>@<host>[:port]\n", programname);
  printf("-p for just sending (plan)\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
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>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: %s [-v] <file> <user>@<host>[:port]\0A\00"
@.str.1 = [28 x i8] c"-p for just sending (plan)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: %s [-v] <file> <user>@<host>[:port]\0A\00"
@str = [27 x i8] c"-p for just sending (plan)\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned int hashFunFinal(unsigned int);
unsigned int hashFunIncrement(unsigned int, char);
unsigned hashFun(char *string) {
  unsigned h = 0;
  char *s = string;
  char ch;
  for (ch = *s; ch; ch = *++s)
    h = hashFunIncrement(h, ch);
  h = hashFunFinal(h);
  return h;
}


x86 assembly (clang, -O0):
<hashFun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
cmpb   $0x0,-0x19(%rbp)
je     1177 <hashFun+0x57>
mov    -0xc(%rbp),%edi
movsbl -0x19(%rbp),%esi
call   1030 <hashFunIncrement@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    0x1(%rax),%al
mov    %al,-0x19(%rbp)
jmp    1144 <hashFun+0x24>
mov    -0xc(%rbp),%edi
call   1040 <hashFunFinal@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashFun>:
push   %rbx
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <hashFun+0x27>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %eax,%eax
movsbl %cl,%esi
mov    %eax,%edi
call   1030 <hashFunIncrement@plt>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hashFun+0x10>
jmp    1149 <hashFun+0x29>
xor    %eax,%eax
mov    %eax,%edi
pop    %rbx
jmp    1040 <hashFunFinal@plt>

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

LLVM IR (-O2):
define i32 @hashFun(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %8, %4 ], [ 0, %1 ]
%8 = tail call i32 @hashFunIncrement(i32 %7, i8 signext %5)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %8, %4 ]
%14 = tail call i32 @hashFunFinal(i32 %13)
ret i32 %14
}
/* Variables and functions */
scalar_t__ isspace(int);
char *skipb(char *p) {
  while (isspace((int)*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skipb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipb+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipb+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipb>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipb+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = call i64 @isspace(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %3
12: ; preds = %3
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @skipb(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_add_quaddobl_term(int i, int n, int *exp, double *c) {
  int a[2], fail;
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc4c(386, a, exp, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_add_quaddobl_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x182,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_add_quaddobl_term>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x182,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_add_quaddobl_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %6
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc4c(i32 386, i32* %15, i32* %16, double* %17, i32 0)
store i32 %18, i32* %10
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @syscon_add_quaddobl_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %0, i32* %8
%9 = call i32 @_ada_use_c2phc4c(i32 386, i32* %7, i32* %2, double* %3, i32 0)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ROR_();
int /*<<< orphan*/ c64_memZero();
void ROR_zp(void) {
  c64_memZero();
  ROR_();
}


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

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

LLVM IR (-O0):
define void @ROR_zp() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 (...) @ROR_()
ret void
}

LLVM IR (-O2):
define void @ROR_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @ROR_()
ret void
}
int as30(int a) { return (a >> 30) != 0; }


x86 assembly (clang, -O0):
<as30>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1e,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<as30>:
xor    %eax,%eax
cmp    $0x40000000,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @as30(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 30
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @as30(i32 %0) {
%2 = icmp ugt i32 %0, 1073741823
%3 = zext i1 %2 to i32
ret i32 %3
}
int parser_precedencia(char operador) {
  switch (operador) {
  case '*':
  case '/':
    return 3;
  case '+':
  case '-':
    return 2;
  case '(':
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<parser_precedencia>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1158 <parser_precedencia+0x58>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    115f <parser_precedencia+0x5f>
movl   $0x2,-0x4(%rbp)
jmp    115f <parser_precedencia+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    115f <parser_precedencia+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_precedencia>:
add    $0xffffffd8,%edi
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     111a <parser_precedencia+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @parser_precedencia(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 42, label %6
i32 47, label %6
i32 43, label %7
i32 45, label %7
i32 40, label %8
]
6: ; preds = %1, %1
store i32 3, i32* %2
br label %10
7: ; preds = %1, %1
store i32 2, i32* %2
br label %10
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.parser_precedencia = [8 x i32] [i32 0, i32 -1, i32 3, i32 2, i32 -1, i32 2, i32 -1, i32 3]
define i32 @parser_precedencia(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -40
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.parser_precedencia, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %10
}
void bar(_Bool b) {
  int buf[1];
  while (1) {
    _Bool x = 1;
    if (b)
      baz();
    b = 1;
    baz();
    x = 0;
    unsigned int i;
    while (buf[i] && i)
      i++;
    foo();
    if (!x)
      b = 0;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x9(%rbp)
testb  $0x1,-0x1(%rbp)
je     1145 <bar+0x25>
mov    $0x0,%al
call   1030 <baz@plt>
movb   $0x1,-0x1(%rbp)
mov    $0x0,%al
call   1030 <baz@plt>
movb   $0x0,-0x9(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp,%rcx,4)
mov    %al,-0x11(%rbp)
je     1173 <bar+0x53>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1183 <bar+0x63>
jmp    1191 <bar+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <bar+0x34>
mov    $0x0,%al
call   1040 <foo@plt>
testb  $0x1,-0x9(%rbp)
jne    11a6 <bar+0x86>
movb   $0x0,-0x1(%rbp)
jmp    1130 <bar+0x10>

x86 assembly (clang, -O2):
<bar>:
push   %rax
test   %edi,%edi
je     1130 <bar+0x10>
xor    %eax,%eax
call   1030 <baz@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
call   1040 <foo@plt>
jmp    1130 <bar+0x10>

LLVM IR (-O0):
define void @bar(i1 zeroext %0) {
%2 = alloca i8
%3 = alloca [1 x i32]
%4 = alloca i8
%5 = alloca i32
%6 = zext i1 %0 to i8
store i8 %6, i8* %2
br label %7
7: ; preds = %1, %33
store i8 1, i8* %4
%8 = load i8, i8* %2
%9 = trunc i8 %8 to i1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @baz()
br label %12
12: ; preds = %10, %7
store i8 1, i8* %2
%13 = call i32 (...) @baz()
store i8 0, i8* %4
br label %14
14: ; preds = %25, %12
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %20, %14
%24 = phi i1 [ false, %14 ], [ %22, %20 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i32, i32* %5
%27 = add i32 %26, 1
store i32 %27, i32* %5
br label %14
28: ; preds = %23
%29 = call i32 (...) @foo()
%30 = load i8, i8* %4
%31 = trunc i8 %30 to i1
br i1 %31, label %33, label %32
32: ; preds = %28
store i8 0, i8* %2
br label %33
33: ; preds = %32, %28
br label %7
}

LLVM IR (-O2):
define void @bar(i1 zeroext %0) {
br i1 %0, label %2, label %4
2: ; preds = %1
%3 = tail call i32 (...) @baz()
br label %4
4: ; preds = %2, %1
br label %5
5: ; preds = %4, %5
%6 = tail call i32 (...) @baz()
%7 = tail call i32 (...) @foo()
br label %5
}