xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
int honest_payload_size(unsigned char payload_buf[]) {
  return strlen((const char *)&payload_buf[3]) - 16;
}


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

x86 assembly (clang, -O2):
<honest_payload_size>:
push   %rax
add    $0x3,%rdi
call   1030 <strlen@plt>
add    $0xfffffff0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @honest_payload_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @honest_payload_size(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = tail call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ platform_outl(int /*<<< orphan*/, unsigned long);
void __outsl(unsigned long port, const void *src, unsigned long count) {
  const unsigned int *sp = src;
  while (count--)
    platform_outl(*sp++, port);
}


x86 assembly (clang, -O0):
<__outsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1164 <__outsl+0x54>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <platform_outl@plt>
jmp    112c <__outsl+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outsl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1145 <__outsl+0x35>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    %r15,%rsi
call   1030 <platform_outl@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <__outsl+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @__outsl(i64 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i32*
br label %7
7: ; preds = %5, %7
%8 = phi i32* [ %11, %7 ], [ %6, %5 ]
%9 = phi i64 [ %10, %7 ], [ %2, %5 ]
%10 = add i64 %9, -1
%11 = getelementptr inbounds i32, i32* %8, i64 1
%12 = load i32, i32* %8
%13 = tail call i32 @platform_outl(i32 %12, i64 %0)
%14 = icmp eq i64 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t add(int32_t reg1, int32_t reg2) { return (reg1 + reg2); }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add(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 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char const *, char const *, int);
void UTILS_setenv(const char *name, const char *value) {
  setenv(name, value, 1);
}


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

x86 assembly (clang, -O2):
<UTILS_setenv>:
mov    $0x1,%edx
jmp    1030 <setenv@plt>

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

LLVM IR (-O2):
define void @UTILS_setenv(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
ret void
}
int execvp() { return -1; }


x86 assembly (clang, -O0):
<execvp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @execvp() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @execvp() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ PrintChar(char);
void PrintString(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++) {
    PrintChar(str[i]);
  }
}


x86 assembly (clang, -O0):
<PrintString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <PrintString+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <PrintChar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <PrintString+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <PrintString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <PrintChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <PrintString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PrintString(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 i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @PrintChar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int pipe1(char *, int);
int pipecmd(void *v) {
  char *str = v;
  return (pipe1(str, 1));
}


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

x86 assembly (clang, -O2):
<pipecmd>:
mov    $0x1,%esi
jmp    1030 <pipe1@plt>

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

LLVM IR (-O2):
define i32 @pipecmd(i8* %0) {
%2 = tail call i32 @pipe1(i8* %0, i32 1)
ret i32 %2
}
void cm3_add_mpu_region(unsigned long region, unsigned long address,
                        unsigned long control) {
  volatile unsigned long *pmpu = (unsigned long *)0xE000ED90;
  *(pmpu + 2) = region;
  *(pmpu + 3) = address;
  *(pmpu + 4) = control;
  *(pmpu + 4) = control | 0x1;
}


x86 assembly (clang, -O0):
<cm3_add_mpu_region>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xe000ed90,%eax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x18(%rbp),%rcx
or     $0x1,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm3_add_mpu_region>:
mov    $0xe000edb0,%eax
mov    %rdi,-0x10(%rax)
mov    %rsi,-0x8(%rax)
mov    %rdx,(%rax)
or     $0x1,%rdx
mov    %rdx,(%rax)
ret

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

LLVM IR (-O2):
define void @cm3_add_mpu_region(i64 %0, i64 %1, i64 %2) {
store volatile i64 %0, i64* inttoptr (i64 3758157216 to i64*)
store volatile i64 %1, i64* inttoptr (i64 3758157224 to i64*)
store volatile i64 %2, i64* inttoptr (i64 3758157232 to i64*)
%4 = or i64 %2, 1
store volatile i64 %4, i64* inttoptr (i64 3758157232 to i64*)
ret void
}
int extended_gcd(int a, int b) {
  long long unsigned int y, lasty, quotient, temp1, temp2;
  y = 1;
  lasty = 0;
  while (b != 0) {
    quotient = a / b;
    temp1 = a % b;
    a = b;
    b = temp1;
    temp2 = y;
    y = lasty - (quotient * y);
    lasty = temp2;
  }
  return (lasty);
}


x86 assembly (clang, -O0):
<extended_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1175 <extended_gcd+0x75>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cltq
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
movslq %edx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    111a <extended_gcd+0x1a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extended_gcd>:
test   %esi,%esi
je     1130 <extended_gcd+0x30>
mov    %edi,%ecx
mov    $0x1,%r8d
xor    %edi,%edi
xchg   %ax,%ax
mov    %ecx,%eax
cltd
idiv   %esi
mov    %eax,%ecx
mov    %r8,%rax
imul   %r8,%rcx
sub    %rcx,%rdi
mov    %esi,%ecx
mov    %edx,%esi
mov    %rdi,%r8
mov    %rax,%rdi
test   %edx,%edx
jne    1110 <extended_gcd+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @extended_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %1, %2 ]
%7 = phi i64 [ %13, %4 ], [ 1, %2 ]
%8 = phi i64 [ %7, %4 ], [ 0, %2 ]
%9 = sdiv i32 %5, %6
%10 = zext i32 %9 to i64
%11 = srem i32 %5, %6
%12 = mul i64 %7, %10
%13 = sub i64 %8, %12
%14 = icmp eq i32 %11, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i64 [ 0, %2 ], [ %7, %4 ]
%17 = trunc i64 %16 to i32
ret i32 %17
}
void handle_RETRACT(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_RETRACT(i32 %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
int is_type_name(char *s) { return s[0] == '[' && s[strlen(s) - 1] == ']'; }


x86 assembly (clang, -O0):
<is_type_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5b,%ecx
mov    %al,-0x9(%rbp)
jne    115b <is_type_name+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_type_name>:
push   %rbx
xor    %eax,%eax
cmpb   $0x5b,(%rdi)
jne    112d <is_type_name+0x1d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x5d,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_type_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 91
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 93
br label %18
18: ; preds = %8, %1
%19 = phi i1 [ false, %1 ], [ %17, %8 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_type_name(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 91
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 93
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int memtester_pagesize(void) {
  printf("sysconf(_SC_PAGE_SIZE) not supported; using pagesize of 8192\n");
  return 8192;
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"sysconf(_SC_PAGE_SIZE) not supported; using pagesize of 8192\0A\00"
define i32 @memtester_pagesize() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i32 8192
}

LLVM IR (-O2):
@str = [61 x i8] c"sysconf(_SC_PAGE_SIZE) not supported; using pagesize of 8192\00"
define i32 @memtester_pagesize() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret i32 8192
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_error(void *array, const char *variable, const char *function) {
  if (array != (void *)NULL)
    free(array);
}


x86 assembly (clang, -O0):
<free_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <free_error+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_error(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ wborder(int /*<<< orphan*/ *, char, char, char, char, char,
                           char, char, char);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *destroy_win(WINDOW *local_win) {
  wborder(local_win, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
  wrefresh(local_win);
  delwin(local_win);
  return NULL;
}


x86 assembly (clang, -O0):
<destroy_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x20,(%rsp)
movl   $0x20,0x8(%rsp)
movl   $0x20,0x10(%rsp)
call   1030 <wborder@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
call   1050 <delwin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_win>:
push   %rbx
mov    %rdi,%rbx
sub    $0x8,%rsp
mov    $0x20,%esi
mov    $0x20,%edx
mov    $0x20,%ecx
mov    $0x20,%r8d
mov    $0x20,%r9d
push   $0x20
push   $0x20
push   $0x20
call   1030 <wborder@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    %rbx,%rdi
call   1050 <delwin@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @destroy_win(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @wborder(i32* %3, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32)
%5 = load i32*, i32** %2
%6 = call i32 @wrefresh(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @delwin(i32* %7)
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @destroy_win(i32* %0) {
%2 = tail call i32 @wborder(i32* %0, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32)
%3 = tail call i32 @wrefresh(i32* %0)
%4 = tail call i32 @delwin(i32* %0)
ret i32* null
}
/* Variables and functions */
unsigned int getInt(void *, int /*<<< orphan*/);
unsigned int getTCP_type(void *pkg) {
  unsigned int ret = getInt(pkg, 0);
  return ret;
}


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

x86 assembly (clang, -O2):
<getTCP_type>:
xor    %esi,%esi
jmp    1030 <getInt@plt>

LLVM IR (-O0):
define i32 @getTCP_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @getInt(i8* %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @getTCP_type(i8* %0) {
%2 = tail call i32 @getInt(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CPUwfi();
void SysCtlSleep(void) { CPUwfi(); }


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

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

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

LLVM IR (-O2):
define void @SysCtlSleep() {
%1 = tail call i32 (...) @CPUwfi()
ret void
}
/* Variables and functions */
double interp2_k_sinc(double);
double interp2_k_tsinc7(double x) {
  double result = 0.0;
  if ((x >= 0.0) && (x < 3.5)) {
    result = interp2_k_sinc(x);
  }
  return result;
}


x86 assembly (clang, -O0):
<interp2_k_tsinc7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1159 <interp2_k_tsinc7+0x49>
movsd  0xec1(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1159 <interp2_k_tsinc7+0x49>
movsd  -0x8(%rbp),%xmm0
call   1030 <interp2_k_sinc@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp2_k_tsinc7>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112d <interp2_k_tsinc7+0x1d>
movsd  0xede(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112d <interp2_k_tsinc7+0x1d>
jmp    1030 <interp2_k_sinc@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @interp2_k_tsinc7(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 3.500000e+00
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load double, double* %2
%11 = call double @interp2_k_sinc(double %10)
store double %11, double* %3
br label %12
12: ; preds = %9, %6, %1
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @interp2_k_tsinc7(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fcmp olt double %0, 3.500000e+00
%4 = and i1 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call double @interp2_k_sinc(double %0)
br label %7
7: ; preds = %5, %1
%8 = phi double [ %6, %5 ], [ 0.000000e+00, %1 ]
ret double %8
}
int restricted_config_char(char c) {
  if (c == '=' || c == ',' || c == '{' || c == '}' || c == '#')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<restricted_config_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x3d,%eax
je     114b <restricted_config_char+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
je     114b <restricted_config_char+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x7b,%eax
je     114b <restricted_config_char+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x7d,%eax
je     114b <restricted_config_char+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x23,%eax
jne    1157 <restricted_config_char+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <restricted_config_char+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<restricted_config_char>:
mov    $0x1,%eax
cmp    $0x3d,%dil
ja     111f <restricted_config_char+0x1f>
movzbl %dil,%ecx
movabs $0x2000100800000000,%rdx
bt     %rcx,%rdx
jb     112b <restricted_config_char+0x2b>
cmp    $0x7b,%dil
je     112b <restricted_config_char+0x2b>
cmp    $0x7d,%dil
jne    112c <restricted_config_char+0x2c>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @restricted_config_char(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
%6 = icmp eq i32 %5, 61
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 44
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 123
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 125
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 35
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @restricted_config_char(i8 signext %0) {
switch i8 %0, label %2 [
i8 125, label %3
i8 123, label %3
i8 61, label %3
i8 44, label %3
i8 35, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int Button1Mask;
int Button2Mask;
int Button3Mask;
int up_buttonmap(int state) {
  int buttons = 0;
  if ((state & Button1Mask) != 0) {
    buttons |= 1;
  }
  if ((state & Button2Mask) != 0) {
    buttons |= 2;
  }
  if ((state & Button3Mask) != 0) {
    buttons |= 4;
  }
  return buttons;
}


x86 assembly (clang, -O0):
<up_buttonmap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb8(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     112c <up_buttonmap+0x2c>
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     114a <up_buttonmap+0x4a>
mov    -0x8(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e84(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1168 <up_buttonmap+0x68>
mov    -0x8(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<up_buttonmap>:
mov    0x2ec9(%rip),%rax
xor    %ecx,%ecx
test   %edi,(%rax)
setne  %cl
mov    0x2ed3(%rip),%rax
lea    0x2(%rcx),%edx
test   %edi,(%rax)
cmove  %ecx,%edx
mov    0x2eb4(%rip),%rcx
lea    0x4(%rdx),%eax
test   %edi,(%rcx)
cmove  %edx,%eax
ret

LLVM IR (-O0):
@Button1Mask = global i32 0
@Button2Mask = global i32 0
@Button3Mask = global i32 0
define i32 @up_buttonmap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @Button1Mask
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = or i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %2
%13 = load i32, i32* @Button2Mask
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i32, i32* %3
%18 = or i32 %17, 2
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %11
%20 = load i32, i32* %2
%21 = load i32, i32* @Button3Mask
%22 = and i32 %20, %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i32, i32* %3
%26 = or i32 %25, 4
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %19
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@Button1Mask = global i32 0
@Button2Mask = global i32 0
@Button3Mask = global i32 0
define i32 @up_buttonmap(i32 %0) {
%2 = load i32, i32* @Button1Mask
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = load i32, i32* @Button2Mask
%7 = and i32 %6, %0
%8 = icmp eq i32 %7, 0
%9 = or i32 %5, 2
%10 = select i1 %8, i32 %5, i32 %9
%11 = load i32, i32* @Button3Mask
%12 = and i32 %11, %0
%13 = icmp eq i32 %12, 0
%14 = or i32 %10, 4
%15 = select i1 %13, i32 %10, i32 %14
ret i32 %15
}
/* Variables and functions */
int check_cursor_pos(char const *, int const *);
int main(int argc, char **argv) {
  const char *str1 = "This is a test ";
  const int expected_pos1[] = {0, 1, 2, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11};
  return check_cursor_pos(str1, expected_pos1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <check_cursor_pos@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xf21(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeb6(%rip),%rdi
mov    %rsp,%rsi
call   1030 <check_cursor_pos@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"This is a test \00"
@__const.main.expected_pos1 = [15 x i32] [i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 11]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [15 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = bitcast [15 x i32]* %7 to i8*
%9 = load i8*, i8** %6
%10 = getelementptr inbounds [15 x i32], [15 x i32]* %7, i64 0, i64 0
%11 = call i32 @check_cursor_pos(i8* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [16 x i8] c"This is a test \00"
@__const.main.expected_pos1 = [15 x i32] [i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 11]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [15 x i32]
%4 = bitcast [15 x i32]* %3 to i8*
%5 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%6 = call i32 @check_cursor_pos(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %5)
ret i32 %6
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
void main() { int64_t a = 5; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 5, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_ivector(int *data, int nlow) { free((char *)(data + nlow - 1)); }


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

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

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

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ msw(int);
int main() {
  if (msw(1) != 0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <msw@plt>
cmp    $0x0,%rax
je     115a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <msw@plt>
test   %rax,%rax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @msw(i32 1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @msw(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ driverTimer_Init();
void Timer_Init(void) { driverTimer_Init(); }


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

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

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

LLVM IR (-O2):
define void @Timer_Init() {
%1 = tail call i32 (...) @driverTimer_Init()
ret void
}
char (*(*x1())[])() {
  static char *str1[] = {"string1", "str2", "str3"};
  return str1[0];
}


x86 assembly (clang, -O0):
<x1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f25(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@x1.str1 = internal global [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0)]
@.str = [8 x i8] c"string1\00"
@.str.1 = [5 x i8] c"str2\00"
@.str.2 = [5 x i8] c"str3\00"
define [0 x i8 (...)*]* @x1() {
%1 = load i8*, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @x1.str1, i64 0, i64 0)
%2 = bitcast i8* %1 to [0 x i8 (...)*]*
ret [0 x i8 (...)*]* %2
}

LLVM IR (-O2):
@.str = [8 x i8] c"string1\00"
define [0 x i8 (...)*]* @x1() {
ret [0 x i8 (...)*]* bitcast ([8 x i8]* @.str to [0 x i8 (...)*]*)
}
int occampi_mwsync_post_setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @occampi_mwsync_post_setup() {
ret i32 0
}
int test_imm_A6uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xA6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A6uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 166
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo676(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo676(i32 %0) {
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int bigrand(void) { return RAND_MAX * rand() + rand(); }


x86 assembly (clang, -O0):
<bigrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigrand>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ece(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @bigrand() {
%1 = load i32, i32* @RAND_MAX
%2 = call i32 (...) @rand()
%3 = mul nsw i32 %1, %2
%4 = call i32 (...) @rand()
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @bigrand() {
%1 = load i32, i32* @RAND_MAX
%2 = tail call i32 (...) @rand()
%3 = mul nsw i32 %2, %1
%4 = tail call i32 (...) @rand()
%5 = add nsw i32 %3, %4
ret i32 %5
}
void __attribute__((weak)) i2c2_er_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<i2c2_er_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c2_er_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.i2c2_er_isr = [12 x i8] c"i2c2_er_isr\00"
define weak void @i2c2_er_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c2_er_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.i2c2_er_isr = [12 x i8] c"i2c2_er_isr\00"
define weak void @i2c2_er_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c2_er_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setter();
int main(void) {
  setter();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setter()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ factor(int, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int n;
  for (n = 1; n <= 10000; n++) {
    fprintf(stdout, "Factoring %d\n", n);
    factor(n, n, 2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jg     1180 <main+0x60>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0x2,%edx
call   1040 <factor@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
mov    0x2eaf(%rip),%r15
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebx,%edi
mov    %ebx,%esi
mov    $0x2,%edx
call   1040 <factor@plt>
add    $0x1,%ebx
cmp    $0x2711,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Factoring %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %17, %2
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 10000
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* @stdout
%12 = load i32, i32* %6
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @factor(i32 %14, i32 %15, i32 2)
br label %17
17: ; preds = %10
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %7
20: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Factoring %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 1, %2 ], [ %8, %3 ]
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = tail call i32 @factor(i32 %4, i32 %4, i32 2)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 10001
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}
/* Variables and functions */
int host_events_init();
int host_init(void) {
  int rc;
  rc = host_events_init();
  if (rc != 0)
    goto err;
  return 0;
err:
  return rc;
}


x86 assembly (clang, -O0):
<host_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <host_events_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1131 <host_init+0x21>
jmp    113d <host_init+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1143 <host_init+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @host_init() {
%1 = tail call i32 (...) @host_events_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ is_integer(char const *);
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ usage(char *, char const *);
void getopt_port(const char *optarg, int *port) {
  if (!is_integer(optarg))
    usage("Illegal port number '%s'.", optarg);
  *port = (int)strtol(optarg, NULL, 10);
}


x86 assembly (clang, -O0):
<getopt_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_integer@plt>
cmp    $0x0,%eax
jne    1162 <getopt_port+0x32>
mov    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1050 <usage@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_port>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <is_integer@plt>
test   %eax,%eax
jne    1152 <getopt_port+0x22>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1050 <usage@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Illegal port number '%s'.\00"
define void @getopt_port(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = call i32 @is_integer(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @usage(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = call i64 @strtol(i8* %12, i32* null, i32 10)
%14 = trunc i64 %13 to i32
%15 = load i32*, i32** %4
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Illegal port number '%s'.\00"
define void @getopt_port(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @is_integer(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @usage(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
%8 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
ret void
}
__attribute__((no, noclone)) unsigned __int128 t136_3add(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((signed __int128)(1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t136_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0x1,%rdx
adc    $0x0,%rcx
setb   %al
movzbl %al,%eax
mov    %eax,%esi
mov    %rsi,%rdi
neg    %rdi
mov    %rdi,%rax
xor    %rsi,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1172 <t136_3add+0x62>
jmp    1179 <t136_3add+0x69>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t136_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
adc    $0x0,%r14
setb   %al
movzbl %al,%ecx
mov    %rcx,%rax
neg    %rax
xor    %rax,%rcx
or     %rax,%rcx
jne    113b <t136_3add+0x2b>
test   %rax,%rax
jns    1142 <t136_3add+0x32>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t136_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = zext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 1, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t136_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = tail call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %7, i129 1)
%9 = extractvalue { i129, i1 } %8, 1
%10 = extractvalue { i129, i1 } %8, 0
%11 = icmp slt i129 %10, 0
%12 = or i1 %9, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = tail call i32 (...) @bar()
br label %15
15: ; preds = %13, %2
%16 = trunc i129 %10 to i64
%17 = lshr i129 %10, 64
%18 = trunc i129 %17 to i64
%19 = insertvalue { i64, i64 } poison, i64 %16, 0
%20 = insertvalue { i64, i64 } %19, i64 %18, 1
ret { i64, i64 } %20
}