xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
void cat_button(char *dst, const char *src) {
  if (*dst != '\0')
    strcat(dst, ", ");
  strcat(dst, src);
}


x86 assembly (clang, -O0):
<cat_button>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <cat_button+0x30>
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat_button>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     112e <cat_button+0x1e>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
define void @cat_button(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* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
define void @cat_button(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
void sig_not_set(int x) {}


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

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

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

LLVM IR (-O2):
define void @sig_not_set(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You are %d miles away.\n");
  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   $0x64,-0x14(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"You are %d miles away.\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 100, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"You are %d miles away.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
void CloseImageFile(FILE *fp, char fpType) {
  switch (fpType) {
  case 'p':
    pclose(fp);
    break;
  case 'f':
    fclose(fp);
    break;
  }
}


x86 assembly (clang, -O0):
<CloseImageFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x66,%eax
je     1166 <CloseImageFile+0x46>
jmp    1147 <CloseImageFile+0x27>
mov    -0x10(%rbp),%eax
sub    $0x70,%eax
jne    116f <CloseImageFile+0x4f>
jmp    1158 <CloseImageFile+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <pclose@plt>
jmp    116f <CloseImageFile+0x4f>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseImageFile>:
cmp    $0x66,%esi
je     112f <CloseImageFile+0xf>
cmp    $0x70,%esi
jne    1134 <CloseImageFile+0x14>
jmp    1040 <pclose@plt>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @CloseImageFile(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %13 [
i32 112, label %7
i32 102, label %10
]
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = call i32 @pclose(i32* %8)
br label %13
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %2, %10, %7
ret void
}

LLVM IR (-O2):
define void @CloseImageFile(i32* nocapture %0, i8 signext %1) {
%3 = sext i8 %1 to i32
switch i32 %3, label %8 [
i32 112, label %4
i32 102, label %6
]
4: ; preds = %2
%5 = tail call i32 @pclose(i32* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @fclose(i32* %0)
br label %8
8: ; preds = %2, %6, %4
ret void
}
int az_imin(int a, int b) { return a <= b ? a : b; }


x86 assembly (clang, -O0):
<az_imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1121 <az_imin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <az_imin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_imin>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @az_imin(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @az_imin(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
int main() {
  printf("invoking 3rd party lib call\n");
  test();
  printf("end of main\n");
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"invoking 3rd party lib call\0A\00"
@.str.1 = [13 x i8] c"end of main\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test()
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"invoking 3rd party lib call\00"
@str.2 = [12 x i8] c"end of main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret i32 0
}
unsigned long num_fibonacci(int n) {
  if (n < 2) {
    return (unsigned long)n;
  }
  return num_fibonacci(n - 1) + num_fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<num_fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1132 <num_fibonacci+0x22>
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <num_fibonacci+0x4a>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <num_fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <num_fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_fibonacci>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
cmp    $0x2,%edi
jl     1135 <num_fibonacci+0x25>
mov    %edi,%ebx
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <num_fibonacci@plt>
lea    -0x2(%rbx),%edi
add    %rax,%r14
cmp    $0x4,%ebx
mov    %edi,%ebx
jae    1120 <num_fibonacci+0x10>
movslq %edi,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @num_fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i64 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ %13, %8 ]
%6 = sext i32 %5 to i64
%7 = add i64 %4, %6
ret i64 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i64 [ %14, %8 ], [ 0, %1 ]
%11 = add nsw i32 %9, -1
%12 = tail call i64 @num_fibonacci(i32 %11)
%13 = add nsw i32 %9, -2
%14 = add i64 %12, %10
%15 = icmp ult i32 %9, 4
br i1 %15, label %3, label %8
}
/* Variables and functions */
int putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int outc(int c) { return (putc(c, stderr)); }


x86 assembly (clang, -O0):
<outc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outc>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i32 @outc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stderr
%5 = call i32 @putc(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @outc(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @putc(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
union bpf_attr {
  int target_fd;
  int attach_type;
};
typedef enum bpf_attach_type {
  ____Placeholder_bpf_attach_type
} bpf_attach_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_DETACH;
int /*<<< orphan*/ __NR_bpf;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_detach(int target_fd, enum bpf_attach_type type) {
  union bpf_attr attr = {
      .target_fd = target_fd,
      .attach_type = type,
  };
  return syscall(__NR_bpf, BPF_PROG_DETACH, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_detach>:
push   %rax
mov    %esi,(%rsp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast %union.bpf_attr* %5 to i32*
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* @__NR_bpf
%9 = load i32, i32* @BPF_PROG_DETACH
%10 = call i32 @syscall(i32 %8, i32 %9, %union.bpf_attr* %5, i32 4)
ret i32 %10
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach(i32 %0, i32 %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = load i32, i32* @__NR_bpf
%7 = load i32, i32* @BPF_PROG_DETACH
%8 = call i32 @syscall(i32 %6, i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}
void inclass_ext_unit2inclass_unit_inclass_ext_unit() {}


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

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

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

LLVM IR (-O2):
define void @inclass_ext_unit2inclass_unit_inclass_ext_unit() {
ret void
}
void rop3_66_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ *D;
  stk2 = T ^ *D;
  stk1 = stk1 & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_66_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_66_0_1>:
mov    (%rdi),%al
mov    %eax,%r8d
xor    %sil,%r8b
mov    %edx,%ecx
not    %cl
or     %sil,%cl
not    %sil
and    %dl,%sil
and    %al,%sil
xor    %dl,%al
and    %al,%cl
and    %r8b,%cl
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_66_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = xor i32 %10, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %7
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %17, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %7
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = and i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = or i32 %33, %39
%41 = load i8, i8* %6
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = and i32 %46, %49
%51 = or i32 %40, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
store i8 %52, i8* %53
ret void
}

LLVM IR (-O2):
define void @rop3_66_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %4, %2
%7 = xor i8 %2, -1
%8 = or i8 %7, %1
%9 = and i8 %6, %8
%10 = and i8 %9, %5
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
void *slab_alloc();
int /*<<< orphan*/ slab_destroy();
int /*<<< orphan*/ slab_free(void *);
int /*<<< orphan*/ slab_init(int);
int main() {
  slab_init(40);
  void *obj0;
  int i;
  for (i = 0; i < 500000; i++) {
    obj0 = slab_alloc();
    slab_free(obj0);
  }
  slab_destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1040 <slab_init@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x7a120,-0x14(%rbp)
jge    118f <main+0x4f>
mov    $0x0,%al
call   1050 <slab_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <slab_free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1160 <main+0x20>
mov    $0x0,%al
call   1060 <slab_destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1040 <slab_init@plt>
mov    $0x7a120,%ebx
xor    %eax,%eax
call   1050 <slab_alloc@plt>
mov    %rax,%rdi
call   1030 <slab_free@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x10>
xor    %eax,%eax
call   1060 <slab_destroy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @slab_init(i32 40)
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 500000
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = call i8* (...) @slab_alloc()
store i8* %9, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @slab_free(i8* %10)
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = call i32 (...) @slab_destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @slab_init(i32 40)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i8* (...) @slab_alloc()
%5 = tail call i32 @slab_free(i8* %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 500000
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = tail call i32 (...) @slab_destroy()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void percentm(void) { printf("%m"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%m\00"
define void @percentm() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%m\00"
define void @percentm() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int op_zalloc2(int, int /*<<< orphan*/);
int op_zallocate(int timeout) { return (op_zalloc2(timeout, 0)); }


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

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

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

LLVM IR (-O2):
define i32 @op_zallocate(i32 %0) {
%2 = tail call i32 @op_zalloc2(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x10() {
  Assert_real((isxdigit(16) == 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_isxdigit.c",
              85, ("isxdigit should be 0 for 0x10"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x10>:
push   %rax
mov    $0x10,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x55,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x10\00"
define void @t_isxdigit_0x10() {
%1 = call i64 @isxdigit(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x10\00"
define void @t_isxdigit_0x10() {
%1 = tail call i64 @isxdigit(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushpointer8array(char *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 8));
}


x86 assembly (clang, -O0):
<pushpointer8array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x3,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushpointer8array>:
shl    $0x3,%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushpointer8array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Config_StressTest();
int /*<<< orphan*/ InitSQLconnection();
int /*<<< orphan*/ ReadConfigFile(int /*<<< orphan*/);
int /*<<< orphan*/ chdir(char *);
char *my_GetTFTPdir();
int main(void) {
  char *tftp_dir;
  ReadConfigFile(0);
  InitSQLconnection();
  tftp_dir = my_GetTFTPdir();
  chdir(tftp_dir);
  Config_StressTest();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <ReadConfigFile@plt>
mov    $0x0,%al
call   1070 <InitSQLconnection@plt>
mov    $0x0,%al
call   1030 <my_GetTFTPdir@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <chdir@plt>
mov    $0x0,%al
call   1040 <Config_StressTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <ReadConfigFile@plt>
xor    %eax,%eax
call   1070 <InitSQLconnection@plt>
xor    %eax,%eax
call   1030 <my_GetTFTPdir@plt>
mov    %rax,%rdi
call   1050 <chdir@plt>
xor    %eax,%eax
call   1040 <Config_StressTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @ReadConfigFile(i32 0)
%4 = call i32 (...) @InitSQLconnection()
%5 = call i8* (...) @my_GetTFTPdir()
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @chdir(i8* %6)
%8 = call i32 (...) @Config_StressTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ReadConfigFile(i32 0)
%2 = tail call i32 (...) @InitSQLconnection()
%3 = tail call i8* (...) @my_GetTFTPdir()
%4 = tail call i32 @chdir(i8* %3)
%5 = tail call i32 (...) @Config_StressTest()
ret i32 0
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
size_t kernel_size(const char *filename) {
  struct stat fs;
  stat(filename, &fs);
  return fs.st_size;
}


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

x86 assembly (clang, -O2):
<kernel_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @kernel_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @kernel_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ singSonfFor(int);
int main(int argc, const char *argv[]) { singSonfFor(4); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <singSonfFor@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @singSonfFor(i32 4)
ret i32 0
}
void f_omp_parallel(void) {
#pragma omp parallel
  {
#pragma omp parallel
    ;
#pragma omp target
    ;
#pragma omp target data map(i)
    ;
#pragma omp target update to(i)
#pragma omp target data map(i)
    {
#pragma omp parallel
      ;
#pragma omp target
      ;
#pragma omp target data map(i)
      ;
#pragma omp target update to(i)
    }
  }
}


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

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

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

LLVM IR (-O2):
define void @f_omp_parallel() {
ret void
}
void foo189() {}


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

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

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

LLVM IR (-O2):
define void @foo189() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void color_def(const char *name, int value) {
  printf("   %-8s : constant Color_Number := %d;\n", name, value);
}


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

x86 assembly (clang, -O2):
<color_def>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c" %-8s : constant Color_Number := %d;\0A\00"
define void @color_def(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c" %-8s : constant Color_Number := %d;\0A\00"
define void @color_def(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
int ascii_hexa_to_int(char src) {
  int dst;
  dst = 0;
  if (src >= '0' && src <= '9') {
    dst = src - '0';
  }
  if (src >= 'A' && src <= 'F') {
    dst = src - 'A' + 10;
  }
  return dst;
}


x86 assembly (clang, -O0):
<ascii_hexa_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1135 <ascii_hexa_to_int+0x35>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1135 <ascii_hexa_to_int+0x35>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     115c <ascii_hexa_to_int+0x5c>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
jg     115c <ascii_hexa_to_int+0x5c>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_hexa_to_int>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
xor    %edx,%edx
cmp    $0xa,%al
cmovb  %ecx,%edx
lea    -0x41(%rdi),%ecx
lea    -0x37(%rdi),%eax
cmp    $0x6,%cl
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ascii_hexa_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add nsw i32 %2, -48
%6 = select i1 %4, i32 %5, i32 0
%7 = add i8 %0, -65
%8 = icmp ult i8 %7, 6
%9 = add nsw i32 %2, -55
%10 = select i1 %8, i32 %9, i32 %6
ret i32 %10
}
short callback3_short_short_short(short (*f)(short)) { return f(3); }


x86 assembly (clang, -O0):
<callback3_short_short_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   *-0x8(%rbp)
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_short_short_short>:
mov    %rdi,%rax
mov    $0x3,%edi
jmp    *%rax

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

LLVM IR (-O2):
define signext i16 @callback3_short_short_short(i16 (i16)* nocapture %0) {
%2 = tail call signext i16 %0(i16 signext 3)
ret i16 %2
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t ROR(uint32_t x, unsigned n) { return ((x >> n) | (x << (32 - n))); }


x86 assembly (clang, -O0):
<ROR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROR>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ROR(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ROR(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: sigs [-hs] [-D <dtr>] [-R <rts>] [-d <device>]\n"
         "\t-h\t\tprint this help\n"
         "\t-s\t\tuse TIOCM_SET instead of TIOCM_MBIS/TIOCM_MBIC\n"
         "\t-D\t\tset DTR to <dtr> value\n"
         "\t-R\t\tset RTS to <rts> value\n"
         "\t-d <device>\tuse <device> as port\n");
}


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

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

LLVM IR (-O0):
@.str = [218 x i8] c"usage: sigs [-hs] [-D <dtr>] [-R <rts>] [-d <device>]\0A\09-h\09\09print this help\0A\09-s\09\09use TIOCM_SET instead of TIOCM_MBIS/TIOCM_MBIC\0A\09-D\09\09set DTR to <dtr> value\0A\09-R\09\09set RTS to <rts> value\0A\09-d <device>\09use <device> as port\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [217 x i8] c"usage: sigs [-hs] [-D <dtr>] [-R <rts>] [-d <device>]\0A\09-h\09\09print this help\0A\09-s\09\09use TIOCM_SET instead of TIOCM_MBIS/TIOCM_MBIC\0A\09-D\09\09set DTR to <dtr> value\0A\09-R\09\09set RTS to <rts> value\0A\09-d <device>\09use <device> as port\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([217 x i8], [217 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
short util_sin(int);
signed short util_cos(int x) { return util_sin(x + 128); }


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

x86 assembly (clang, -O2):
<util_cos>:
sub    $0xffffff80,%edi
jmp    1030 <util_sin@plt>

LLVM IR (-O0):
define signext i16 @util_cos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 128
%5 = call signext i16 @util_sin(i32 %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @util_cos(i32 %0) {
%2 = add nsw i32 %0, 128
%3 = tail call signext i16 @util_sin(i32 %2)
ret i16 %3
}
int lseek(int fd, int offset, int whence) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void addToFile(const char *text) {
  FILE *fp = fopen("todo", "a");
  if (fp != NULL)
    fprintf(fp, "%s\n", text);
  fclose(fp);
}


x86 assembly (clang, -O0):
<addToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <addToFile+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addToFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <addToFile+0x34>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"todo\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @addToFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"todo\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @addToFile(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cwrapper_q_sortrev_int_with_indices(int *, int *,
                                                       int /*<<< orphan*/, int);
void quicksortrev_int_with_indices_(int numbers[], int indices[],
                                    int *array_size) {
  cwrapper_q_sortrev_int_with_indices(numbers, indices, 0, (*array_size) - 1);
}


x86 assembly (clang, -O0):
<quicksortrev_int_with_indices_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <cwrapper_q_sortrev_int_with_indices@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksortrev_int_with_indices_>:
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
xor    %edx,%edx
jmp    1030 <cwrapper_q_sortrev_int_with_indices@plt>

LLVM IR (-O0):
define void @quicksortrev_int_with_indices_(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @cwrapper_q_sortrev_int_with_indices(i32* %7, i32* %8, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @quicksortrev_int_with_indices_(i32* %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
%6 = tail call i32 @cwrapper_q_sortrev_int_with_indices(i32* %0, i32* %1, i32 0, i32 %5)
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int stat(char const *, struct stat *);
int getFileSize(const char *filename) {
  struct stat fileStat;
  int result = stat(filename, &fileStat);
  if (result != 0) {
    perror(filename);
    exit(1);
  }
  return fileStat.st_size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1169 <getFileSize+0x39>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %eax,%eax
jne    1150 <getFileSize+0x20>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @getFileSize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @perror(i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getFileSize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
/* Variables and functions */
int getint(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int num1, num2, max;
  num1 = getint("Introduce el primer numero: ");
  num2 = getint("Introduce el primer numero: ");
  (max = ((num1) > (num2))) ? (num1) : (num2);
  printf("EL mayor es: %d\n", max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <getint@plt>
mov    %eax,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1040 <getint@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    116e <main+0x4e>
jmp    1176 <main+0x56>
mov    -0x8(%rbp),%eax
jmp    1179 <main+0x59>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
mov    %rbx,%rdi
call   1040 <getint@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <getint@plt>
xor    %esi,%esi
cmp    %eax,%ebp
setg   %sil
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Introduce el primer numero: \00"
@.str.1 = [17 x i8] c"EL mayor es: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @getint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %2
%6 = call i32 @getint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %4
br i1 %9, label %11, label %13
11: ; preds = %0
%12 = load i32, i32* %2
br label %15
13: ; preds = %0
%14 = load i32, i32* %3
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [29 x i8] c"Introduce el primer numero: \00"
@.str.1 = [17 x i8] c"EL mayor es: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @getint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @getint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void ConfigurarSonido() {}


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

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

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

LLVM IR (-O2):
define void @ConfigurarSonido() {
ret void
}
double(ceil)(double x) {
  return ((x - ((long)x)) > 0.0) ? (((long)x) + 1.0) : x;
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114b <ceil+0x4b>
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1155 <ceil+0x55>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm2
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
addsd  0xee6(%rip),%xmm2
xorpd  %xmm1,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
%6 = sitofp i64 %5 to double
%7 = fsub double %3, %6
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load double, double* %2
%11 = fptosi double %10 to i64
%12 = sitofp i64 %11 to double
%13 = fadd double %12, 1.000000e+00
br label %16
14: ; preds = %1
%15 = load double, double* %2
br label %16
16: ; preds = %14, %9
%17 = phi double [ %13, %9 ], [ %15, %14 ]
ret double %17
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp ogt double %4, 0.000000e+00
%6 = fadd double %3, 1.000000e+00
%7 = select i1 %5, double %6, double %0
ret double %7
}
/* Variables and functions */
int FE_ALL_EXCEPT;
int feraiseexcept(int excepts) {
  excepts &= FE_ALL_EXCEPT;
  return (excepts != 0);
}


x86 assembly (clang, -O0):
<feraiseexcept>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feraiseexcept>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
test   %edi,(%rcx)
setne  %al
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @feraiseexcept(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @FE_ALL_EXCEPT
%4 = load i32, i32* %2
%5 = and i32 %4, %3
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @feraiseexcept(i32 %0) {
%2 = load i32, i32* @FE_ALL_EXCEPT
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void gdk_x11_screen_supports_net_wm_hint() {}


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

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

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

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