xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) { printf("%p\n", getenv("SHELLCODE")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <getenv@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [10 x i8] c"SHELLCODE\00"
define i32 @main() {
%1 = call i32 @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [10 x i8] c"SHELLCODE\00"
define i32 @main() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
char icharor(char x, char y) {
  x |= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<icharor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x18,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1141 <icharor+0x31>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icharor>:
mov    %edi,%eax
or     $0x18,%al
ret

LLVM IR (-O0):
define signext i8 @icharor(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = or i32 %6, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = icmp ne i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @foo(i8* null)
br label %13
13: ; preds = %11, %2
%14 = load i8, i8* %3
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @icharor(i8 signext %0, i8 signext %1) {
%3 = or i8 %0, 24
ret i8 %3
}
/* Variables and functions */
int count_set_bits(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", count_set_bits(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <count_set_bits@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <count_set_bits@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @count_set_bits(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setState(char *);
void __attribute__((constructor)) initC() { setState("initC"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"initC\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initC, i8* null }]
define void @initC() {
%1 = call i32 @setState(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"initC\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initC, i8* null }]
define void @initC() {
%1 = tail call i32 @setState(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void test_isprint(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isprint(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_isprint+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <isprint@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_isprint+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isprint>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1040 <isprint@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_isprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isprint = [13 x i8] c"test_isprint\00"
define void @test_isprint() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @isprint(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isprint, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isprint = [13 x i8] c"test_isprint\00"
define void @test_isprint() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @isprint(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isprint, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Error(int, char *, char *);
scalar_t__ calloc(size_t, unsigned int);
void *Pcalloc(size_t Number, unsigned int Size) {
  void *p = 0;
  if (!Number || (p = (void *)calloc(Number, Size))) {
    return p;
  }
  Error(11, "", "");
  return 0;
}


x86 assembly (clang, -O0):
<Pcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <Pcalloc+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1169 <Pcalloc+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <Pcalloc+0x65>
mov    $0xb,%edi
lea    0xe8b(%rip),%rdx
mov    %rdx,%rsi
call   1030 <Error@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pcalloc>:
push   %rax
test   %rdi,%rdi
je     1146 <Pcalloc+0x26>
call   1040 <calloc@plt>
test   %rax,%rax
je     1132 <Pcalloc+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdx
mov    $0xb,%edi
mov    %rdx,%rsi
call   1030 <Error@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @Pcalloc(i64 %0, i32 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i64 @calloc(i64 %0, i32 %1)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @Error(i32 11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %2, %4, %8
%11 = phi i8* [ null, %8 ], [ %6, %4 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ pushop2(int, int /*<<< orphan*/);
void pushop(int v) { pushop2(v, 0); }


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

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

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

LLVM IR (-O2):
define void @pushop(i32 %0) {
%2 = tail call i32 @pushop2(i32 %0, i32 0)
ret void
}
long sas_file_format_version(long format_code) {
  if ((format_code & 0x200000))
    return 5;
  if ((format_code & 0x400000))
    return 8;
  if ((format_code & (0x010000 | 0x020000)))
    return 8;
  return 9;
}


x86 assembly (clang, -O0):
<sas_file_format_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x200000,%rax
cmp    $0x0,%rax
je     1129 <sas_file_format_version+0x29>
movq   $0x5,-0x8(%rbp)
jmp    1173 <sas_file_format_version+0x73>
mov    -0x10(%rbp),%rax
and    $0x400000,%rax
cmp    $0x0,%rax
je     114a <sas_file_format_version+0x4a>
movq   $0x8,-0x8(%rbp)
jmp    1173 <sas_file_format_version+0x73>
mov    -0x10(%rbp),%rax
and    $0x30000,%rax
cmp    $0x0,%rax
je     116b <sas_file_format_version+0x6b>
movq   $0x8,-0x8(%rbp)
jmp    1173 <sas_file_format_version+0x73>
movq   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_file_format_version>:
mov    $0x5,%eax
test   $0x200000,%edi
jne    1129 <sas_file_format_version+0x29>
mov    $0x8,%eax
test   $0x400000,%edi
jne    1129 <sas_file_format_version+0x29>
xor    %eax,%eax
test   $0x30000,%edi
sete   %al
or     $0x8,%rax
ret

LLVM IR (-O0):
define i64 @sas_file_format_version(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 2097152
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 5, i64* %2
br label %19
8: ; preds = %1
%9 = load i64, i64* %3
%10 = and i64 %9, 4194304
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i64 8, i64* %2
br label %19
13: ; preds = %8
%14 = load i64, i64* %3
%15 = and i64 %14, 196608
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i64 8, i64* %2
br label %19
18: ; preds = %13
store i64 9, i64* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @sas_file_format_version(i64 %0) {
%2 = and i64 %0, 2097152
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = and i64 %0, 4194304
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i64 %0, 196608
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i64 9, i64 8
br label %11
11: ; preds = %7, %4, %1
%12 = phi i64 [ 5, %1 ], [ 8, %4 ], [ %10, %7 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setjmp(int /*<<< orphan*/);
int main(void) {
  do {
    jmp_buf exce_buf;
    if (!setjmp(exce_buf)) {
      {
        printf("In TRY statment.\n");
        longjmp(exce_buf, 1);
        printf("Here will not be printed.\n");
      }
    } else {
      { printf("Exception handling.\n"); }
    }
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <setjmp@plt>
cmp    $0x0,%eax
jne    1169 <main+0x39>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1050 <longjmp@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x4a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <setjmp@plt>
test   %eax,%eax
je     114a <main+0x1a>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%esi
call   1050 <longjmp@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"In TRY statment.\0A\00"
@.str.1 = [21 x i8] c"Exception handling.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0
%4 = load i32, i32* %2
%5 = call i32 @setjmp(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 @longjmp(i32 %9, i32 1)
unreachable
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11
br label %14
14: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"In TRY statment.\00"
@str.2 = [20 x i8] c"Exception handling.\00"
define i32 @main() {
%1 = call i32 @setjmp(i32 undef)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%5 = call i32 @longjmp(i32 undef, i32 1)
unreachable
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void _Z16_Jv_GCFreeMemoryv(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z16_Jv_GCFreeMemoryv() {
ret void
}
void gdk_window_end_paint() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_end_paint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_file(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    print_file("./puz014.c");
  } else {
    print_file(argv[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <print_file@plt>
jmp    114e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <print_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    111f <main+0xf>
lea    0xee3(%rip),%rdi
jmp    1123 <main+0x13>
mov    0x8(%rsi),%rdi
call   1030 <print_file@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"./puz014.c\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @print_file(i8* %8)
ret i32 0
}
void EXTIT_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @EXTIT_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xa7() {
  Assert_real((isalnum(167) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              840, ("isalnum should be 0 for 0xa7"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa7\00"
define void @t_isalnum_0xa7() {
%1 = tail call i64 @isalnum(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int socket(int, int, int);
int orion_socket(int domain, int type, int protocol) {
  int sockfd = socket(domain, type, protocol);
  if (sockfd < 0) {
    return -1;
  }
  return sockfd;
}


x86 assembly (clang, -O0):
<orion_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1148 <orion_socket+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <orion_socket+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orion_socket>:
push   %rax
call   1030 <socket@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @orion_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
int test_imm_23int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x23 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_23int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2293760
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
main() {
  char *s;
  read(0, s, 8);
  write(1, s, 8);
  write(1, "test", 8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
mov    $0x8,%edx
call   1040 <read@plt>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x8,%edx
call   1040 <read@plt>
mov    $0x1,%edi
mov    $0x8,%edx
call   1030 <write@plt>
lea    0xebd(%rip),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @read(i32 0, i8* %2, i32 8)
%4 = load i8*, i8** %1
%5 = call i32 @write(i32 1, i8* %4, i32 8)
%6 = call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 @read(i32 0, i8* undef, i32 8)
%2 = tail call i32 @write(i32 1, i8* undef, i32 8)
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int EXIT_FAILURE;
scalar_t__ EXIT_SUCCESS;
scalar_t__ ft_putchar_fd(char, int);
int ft_putnbr_fd(int, int);
int ft_putnbrl_fd(int n, int fd) {
  int ret;
  ret = ft_putnbr_fd(n, fd);
  ret = ft_putchar_fd('\n', fd) == EXIT_SUCCESS ? ret : EXIT_FAILURE;
  return (ret);
}


x86 assembly (clang, -O0):
<ft_putnbrl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ft_putnbr_fd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1040 <ft_putchar_fd@plt>
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    1164 <ft_putnbrl_fd+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1170 <ft_putnbrl_fd+0x50>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbrl_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <ft_putnbr_fd@plt>
mov    %eax,%ebx
mov    $0xa,%edi
mov    %ebp,%esi
call   1040 <ft_putchar_fd@plt>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
je     114d <ft_putnbrl_fd+0x2d>
mov    0x2e95(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putnbrl_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @ft_putnbr_fd(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = call i64 @ft_putchar_fd(i8 signext 10, i32 %9)
%11 = load i64, i64* @EXIT_SUCCESS
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %5
br label %17
15: ; preds = %2
%16 = load i32, i32* @EXIT_FAILURE
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putnbrl_fd(i32 %0, i32 %1) {
%3 = tail call i32 @ft_putnbr_fd(i32 %0, i32 %1)
%4 = tail call i64 @ft_putchar_fd(i8 signext 10, i32 %1)
%5 = load i64, i64* @EXIT_SUCCESS
%6 = icmp eq i64 %4, %5
%7 = load i32, i32* @EXIT_FAILURE
%8 = select i1 %6, i32 %3, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void template_free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<template_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @template_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int fossil_isalnum(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
         (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<fossil_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <fossil_isalnum+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <fossil_isalnum+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <fossil_isalnum+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <fossil_isalnum+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <fossil_isalnum+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fossil_isalnum>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @fossil_isalnum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @fossil_isalnum(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ squared_length(float *);
float length(float *v) { return sqrtf(squared_length(v)); }


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <squared_length@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @squared_length(float* %3)
%5 = call float @sqrtf(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @length(float* %0) {
%2 = tail call i32 @squared_length(float* %0)
%3 = tail call float @sqrtf(i32 %2)
ret float %3
}
void TestC() {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @TestC() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ st_pop(struct forth_instance *);
void close_func(struct forth_instance *fi) { close(st_pop(fi)); }


x86 assembly (clang, -O0):
<close_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <st_pop@plt>
mov    %eax,%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @close_func(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = call i32 @st_pop(%struct.forth_instance* %3)
%5 = call i32 @close(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @close_func(%struct.forth_instance* %0) {
%2 = tail call i32 @st_pop(%struct.forth_instance* %0)
%3 = tail call i32 @close(i32 %2)
ret void
}
void skype_init() {}


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

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

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

LLVM IR (-O2):
define void @skype_init() {
ret void
}
/* Variables and functions */
scalar_t__ mkdir(char *, int);
int /*<<< orphan*/ mkstemp(char *);
char *rr_mkdtemp(char *template) {
  if (!mkstemp(template) || mkdir(template, 0700))
    return NULL;
  return template;
}


x86 assembly (clang, -O0):
<rr_mkdtemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mkstemp@plt>
cmp    $0x0,%eax
je     1156 <rr_mkdtemp+0x36>
mov    -0x10(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     1163 <rr_mkdtemp+0x43>
movq   $0x0,-0x8(%rbp)
jmp    116b <rr_mkdtemp+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rr_mkdtemp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mkstemp@plt>
test   %eax,%eax
je     1148 <rr_mkdtemp+0x28>
mov    %rbx,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @rr_mkdtemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @mkstemp(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @mkdir(i8* %8, i32 448)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8* null, i8** %2
br label %14
12: ; preds = %7
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %11
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @rr_mkdtemp(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @mkdir(i8* %0, i32 448)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* %0, i8* null
br label %8
8: ; preds = %4, %1
%9 = phi i8* [ null, %1 ], [ %7, %4 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ _GPIOIntNumberGet(int /*<<< orphan*/);
void GPIOIntRegister(uint32_t ui32Port, void (*pfnIntHandler)(void)) {
  uint32_t ui32Int;
  ;
  ui32Int = _GPIOIntNumberGet(ui32Port);
  ;
  IntRegister(ui32Int, pfnIntHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<GPIOIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_GPIOIntNumberGet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x14(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <_GPIOIntNumberGet@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @GPIOIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
%5 = alloca i32
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%6 = load i32, i32* %3
%7 = call i32 @_GPIOIntNumberGet(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load void ()*, void ()** %4
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i32 %8, void (...)* %10)
%12 = load i32, i32* %5
%13 = call i32 @IntEnable(i32 %12)
ret void
}

LLVM IR (-O2):
define void @GPIOIntRegister(i32 %0, void ()* %1) {
%3 = tail call i32 @_GPIOIntNumberGet(i32 %0)
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @IntRegister(i32 %3, void (...)* %4)
%6 = tail call i32 @IntEnable(i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t ivory_hw_io_read_u16(uint32_t addr) {
  return *((volatile uint16_t *)addr);
}


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

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

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

LLVM IR (-O2):
define i32 @ivory_hw_io_read_u16(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
char *eat_space_end(const char *p, const char *pend) {
  for (; (p < pend) && (*p == ' ' || *p == '\t'); p++)
    ;
  return (char *)p;
}


x86 assembly (clang, -O0):
<eat_space_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
jae    114a <eat_space_end+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x12(%rbp)
je     1144 <eat_space_end+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <eat_space_end+0x5a>
jmp    1170 <eat_space_end+0x70>
jmp    115f <eat_space_end+0x5f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <eat_space_end+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_space_end>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    1127 <eat_space_end+0x27>
mov    %rsi,%rcx
sub    %rax,%rcx
jmp    111a <eat_space_end+0x1a>
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
je     1128 <eat_space_end+0x28>
movzbl (%rax),%edx
cmp    $0x20,%dl
je     1110 <eat_space_end+0x10>
cmp    $0x9,%dl
je     1110 <eat_space_end+0x10>
ret
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @eat_space_end(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %24, %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp ult i8* %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 32
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 9
br label %19
19: ; preds = %14, %9
%20 = phi i1 [ true, %9 ], [ %18, %14 ]
br label %21
21: ; preds = %19, %5
%22 = phi i1 [ false, %5 ], [ %20, %19 ]
br i1 %22, label %23, label %27
23: ; preds = %21
br label %24
24: ; preds = %23
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
br label %5
27: ; preds = %21
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
define i8* @eat_space_end(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %4, %12
%10 = phi i8* [ %13, %12 ], [ %0, %4 ]
%11 = load i8, i8* %10
switch i8 %11, label %15 [
i8 32, label %12
i8 9, label %12
]
12: ; preds = %9, %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = icmp eq i8* %13, %8
br i1 %14, label %15, label %9
15: ; preds = %12, %9, %2
%16 = phi i8* [ %0, %2 ], [ %10, %9 ], [ %8, %12 ]
ret i8* %16
}
/* Type definitions */
struct msg_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct msg_buff *);
void msg_free(struct msg_buff *m) { free(m); }


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

x86 assembly (clang, -O2):
<msg_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define void @msg_free(%struct.msg_buff* %0) {
%2 = alloca %struct.msg_buff*
store %struct.msg_buff* %0, %struct.msg_buff** %2
%3 = load %struct.msg_buff*, %struct.msg_buff** %2
%4 = call i32 @free(%struct.msg_buff* %3)
ret void
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define void @msg_free(%struct.msg_buff* nocapture %0) {
%2 = tail call i32 @free(%struct.msg_buff* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_uart();
int /*<<< orphan*/ load_program();
int /*<<< orphan*/ put_string(char *);
int boot_main() {
  init_uart();
  put_string("Bootloader waiting...\r\n");
  load_program();
  return 0;
}


x86 assembly (clang, -O0):
<boot_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_uart@plt>
lea    0xebe(%rip),%rdi
call   1040 <put_string@plt>
mov    $0x0,%al
call   1050 <load_program@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<boot_main>:
push   %rax
xor    %eax,%eax
call   1030 <init_uart@plt>
lea    0xec1(%rip),%rdi
call   1040 <put_string@plt>
xor    %eax,%eax
call   1050 <load_program@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Bootloader waiting...\0D\0A\00"
define i32 @boot_main() {
%1 = call i32 (...) @init_uart()
%2 = call i32 @put_string(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @load_program()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Bootloader waiting...\0D\0A\00"
define i32 @boot_main() {
%1 = tail call i32 (...) @init_uart()
%2 = tail call i32 @put_string(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @load_program()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int util_claim_root(void) {
  if (setuid(0) < 0) {
    fprintf(stderr, "Error: this program must be run as root.\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<util_claim_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <setuid@plt>
cmp    $0x0,%rax
jge    115a <util_claim_root+0x3a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <util_claim_root+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_claim_root>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <setuid@plt>
test   %rax,%rax
jns    1149 <util_claim_root+0x29>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Error: this program must be run as root.\0A\00"
define i32 @util_claim_root() {
%1 = alloca i32
%2 = call i64 @setuid(i32 0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Error: this program must be run as root.\0A\00"
define i32 @util_claim_root() {
%1 = tail call i64 @setuid(i32 0)
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %7
}
char *field(p)
register char *p;
{
  while (*p && *p != ':')
    ++p;
  if (*p)
    *p++ = 0;
  return (p);
}


x86 assembly (clang, -O0):
<field>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <field+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <field+0x3d>
jmp    114e <field+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <field+0x8>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <field+0x6d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<field>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1129 <field+0x29>
cmp    $0x3a,%cl
je     1122 <field+0x22>
add    $0x1,%rax
jmp    1110 <field+0x10>
movb   $0x0,(%rax)
add    $0x1,%rax
ret

LLVM IR (-O0):
define i8* @field(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 58
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = icmp ne i8 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %2
store i8 0, i8* %23
br label %25
25: ; preds = %22, %18
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @field(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %9
i8 58, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
br label %9
9: ; preds = %2, %7
%10 = phi i8* [ %8, %7 ], [ %3, %2 ]
ret i8* %10
}
OP(ed, f6) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}