xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int st_mode;
};
typedef int mode_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
mode_t fsop_path_mode(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return st.st_mode;
}


x86 assembly (clang, -O0):
<fsop_path_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <fsop_path_mode+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <fsop_path_mode+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_mode>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1129 <fsop_path_mode+0x19>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fsop_path_mode(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stderr;
void Read_n(int *n_p) {
  printf("What's the order of the vectors?\n");
  scanf("%d", n_p);
  if (*n_p <= 0) {
    fprintf(stderr, "Order should be positive\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<Read_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jg     1194 <Read_n+0x54>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_n>:
push   %rbx
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,(%rbx)
jle    1166 <Read_n+0x26>
pop    %rbx
ret
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"What's the order of the vectors?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.2 = [26 x i8] c"Order should be positive\0A\00"
define void @Read_n(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.2 = [26 x i8] c"Order should be positive\0A\00"
@str = [33 x i8] c"What's the order of the vectors?\00"
define void @Read_n(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int myexec(char *, char *, char *, char *, char *, int /*<<< orphan*/ *);
int dpkg_divert_add(char *pkg, char *file) {
  return myexec("/usr/sbin/dpkg-divert", "--package", pkg, "--add", file, NULL);
}


x86 assembly (clang, -O0):
<dpkg_divert_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xee3(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <myexec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpkg_divert_add>:
mov    %rsi,%r8
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xef5(%rip),%rcx
xor    %r9d,%r9d
jmp    1030 <myexec@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"/usr/sbin/dpkg-divert\00"
@.str.1 = [10 x i8] c"--package\00"
@.str.2 = [6 x i8] c"--add\00"
define i32 @dpkg_divert_add(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @myexec(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
@.str = [22 x i8] c"/usr/sbin/dpkg-divert\00"
@.str.1 = [10 x i8] c"--package\00"
@.str.2 = [6 x i8] c"--add\00"
define i32 @dpkg_divert_add(i8* %0, i8* %1) {
%3 = tail call i32 @myexec(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %1, i32* null)
ret i32 %3
}
int test_44_4(int *mem) { return __atomic_fetch_sub(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_44_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
neg    %eax
lock xadd %eax,(%rcx)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_44_4>:
mov    $0xffffffff,%eax
lock xadd %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @test_44_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw sub i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_44_4(i32* nocapture %0) {
%2 = atomicrmw sub i32* %0, i32 1 acq_rel
ret i32 %2
}
double deta_da(double a) { return 1. / a; }


x86 assembly (clang, -O0):
<deta_da>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deta_da>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @deta_da(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @deta_da(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
int execute_setgroups32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setgroups32() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void Fail_Ret(void) {
  Inst_Printf("testl", "%%eax,%%eax");
  Inst_Printf("je", "fail");
}


x86 assembly (clang, -O0):
<Fail_Ret>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xee4(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <Inst_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fail_Ret>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xee7(%rip),%rdi
lea    0xee3(%rip),%rsi
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"testl\00"
@.str.1 = [12 x i8] c"%%eax,%%eax\00"
@.str.2 = [3 x i8] c"je\00"
@.str.3 = [5 x i8] c"fail\00"
define void @Fail_Ret() {
%1 = call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"testl\00"
@.str.1 = [12 x i8] c"%%eax,%%eax\00"
@.str.2 = [3 x i8] c"je\00"
@.str.3 = [5 x i8] c"fail\00"
define void @Fail_Ret() {
%1 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int countcolons(str)
char *str;
{
  while (*str != ':' && *str) {
    str++;
  }
  if (str[0] != ':') {
    return 0;
  } else if (str[1] != ':') {
    return 1;
  }
  return 2;
}


x86 assembly (clang, -O0):
<countcolons>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3a,%ecx
mov    %al,-0x11(%rbp)
je     112d <countcolons+0x2d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113d <countcolons+0x3d>
jmp    114e <countcolons+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <countcolons+0x8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     116a <countcolons+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1193 <countcolons+0x93>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
je     1187 <countcolons+0x87>
movl   $0x1,-0x4(%rbp)
jmp    1193 <countcolons+0x93>
jmp    118c <countcolons+0x8c>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countcolons>:
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl -0x1(%rdi),%eax
test   %al,%al
je     1122 <countcolons+0x22>
cmp    $0x3a,%al
je     1125 <countcolons+0x25>
add    $0x1,%rdi
jmp    1110 <countcolons+0x10>
xor    %eax,%eax
ret
xor    %eax,%eax
cmpb   $0x3a,(%rdi)
sete   %al
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @countcolons(i8* nocapture %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 58, label %7
i8 0, label %12
]
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
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 58
%11 = select i1 %10, i32 2, i32 1
br label %12
12: ; preds = %2, %7
%13 = phi i32 [ %11, %7 ], [ 0, %2 ]
ret i32 %13
}
unsigned mul(unsigned x, unsigned y) {
  return (unsigned)((signed)x * (signed)y);
}


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

x86 assembly (clang, -O2):
<mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kill(char *);
int /*<<< orphan*/ sleep(char *);
void my_func(void) {
  sleep("This should go to stdout\n");
  kill("uname -a");
}


x86 assembly (clang, -O0):
<my_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <sleep@plt>
lea    0xee3(%rip),%rdi
call   1030 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <sleep@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <kill@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"This should go to stdout\0A\00"
@.str.1 = [9 x i8] c"uname -a\00"
define void @my_func() {
%1 = call i32 @sleep(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @kill(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"This should go to stdout\0A\00"
@.str.1 = [9 x i8] c"uname -a\00"
define void @my_func() {
%1 = tail call i32 @sleep(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @kill(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int net_recv(char *buf, int maxlen) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @net_recv(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int readlink(char *, char *, int);
int get_selfname(char *selfname, int namelen) {
  char sysfile[15] = "/proc/self/exe";
  if (-1 != readlink(sysfile, selfname, namelen)) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_selfname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x23(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x1b(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x15(%rbp)
lea    -0x23(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <readlink@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     1172 <get_selfname+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1179 <get_selfname+0x69>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_selfname>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
movabs $0x6578652f666c65,%rax
mov    %rax,0xf(%rsp)
movabs $0x65732f636f72702f,%rax
2f 73 65
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <readlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.get_selfname.sysfile = [15 x i8] c"/proc/self/exe\00"
define i32 @get_selfname(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [15 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = bitcast [15 x i8]* %6 to i8*
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @readlink(i8* %8, i8* %9, i32 %10)
%12 = icmp ne i32 -1, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@__const.get_selfname.sysfile = [15 x i8] c"/proc/self/exe\00"
define i32 @get_selfname(i8* nocapture %0, i32 %1) {
%3 = alloca [15 x i8]
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%5 = call i32 @readlink(i8* %4, i8* %0, i32 %1)
%6 = icmp eq i32 %5, -1
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
void *fcitx_utils_malloc_with_data(size_t, void const *, scalar_t__);
scalar_t__ strlen(char const *);
void *fcitx_utils_malloc_with_str(size_t base_size, const char *extra_str) {
  return fcitx_utils_malloc_with_data(base_size, (const void *)extra_str,
                                      strlen(extra_str) + 1);
}


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

x86 assembly (clang, -O2):
<fcitx_utils_malloc_with_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fcitx_utils_malloc_with_data@plt>

LLVM IR (-O0):
define i8* @fcitx_utils_malloc_with_str(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @fcitx_utils_malloc_with_data(i64 %5, i8* %6, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @fcitx_utils_malloc_with_str(i64 %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @fcitx_utils_malloc_with_data(i64 %0, i8* %1, i64 %4)
ret i8* %5
}
int gs_empty(const char *str) { return str[0] == '\0'; }


x86 assembly (clang, -O0):
<gs_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_empty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @gs_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gs_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ mp_decode_extl(char const **, int /*<<< orphan*/ *);
const char *mp_decode_ext(const char **data, uint32_t *len, uint32_t *type) {
  assert(len != NULL);
  *len = mp_decode_extl(data, type);
  const char *str = *data;
  *data += *len;
  return str;
}


x86 assembly (clang, -O0):
<mp_decode_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <mp_decode_extl@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_ext>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <mp_decode_extl@plt>
mov    %eax,(%r15)
mov    (%rbx),%rcx
cltq
add    %rcx,%rax
mov    %rax,(%rbx)
mov    %rcx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mp_decode_ext(i8** %0, i32* %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8**, i8*** %4
%13 = load i32*, i32** %6
%14 = call i32 @mp_decode_extl(i8** %12, i32* %13)
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
store i8* %17, i8** %7
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i8**, i8*** %4
%21 = load i8*, i8** %20
%22 = sext i32 %19 to i64
%23 = getelementptr inbounds i8, i8* %21, i64 %22
store i8* %23, i8** %20
%24 = load i8*, i8** %7
ret i8* %24
}

LLVM IR (-O2):
define i8* @mp_decode_ext(i8** %0, i32* writeonly %1, i32* %2) {
%4 = icmp ne i32* %1, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @mp_decode_extl(i8** %0, i32* %2)
store i32 %7, i32* %1
%8 = load i8*, i8** %0
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %0
ret i8* %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int, int);
int suma(int, int);
int main() {
  int a = 2;
  int b = 4;
  printf("%i + %i = %i \n", a, b, suma(a, b));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <suma@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <suma@plt>
lea    0xec9(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%i + %i = %i \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 4, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @suma(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"%i + %i = %i \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @suma(i32 2, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void sigusr1_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigusr1_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xab() {
  Assert_real((isalpha(171) == 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_isalpha.c",
              860, ("isalpha should be 0 for 0xab"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xab>:
push   %rax
mov    $0xab,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x35c,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xab\00"
define void @t_isalpha_0xab() {
%1 = call i64 @isalpha(i32 171)
%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 860, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xab\00"
define void @t_isalpha_0xab() {
%1 = tail call i64 @isalpha(i32 171)
%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 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FinalizeFreeObjList();
int /*<<< orphan*/ FinalizeTypeTable();
int /*<<< orphan*/ TclFinalizeExecEnv();
void TclFinalizeCompExecEnv() {
  FinalizeTypeTable();
  FinalizeFreeObjList();
  TclFinalizeExecEnv();
}


x86 assembly (clang, -O0):
<TclFinalizeCompExecEnv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FinalizeTypeTable@plt>
mov    $0x0,%al
call   1040 <FinalizeFreeObjList@plt>
mov    $0x0,%al
call   1050 <TclFinalizeExecEnv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TclFinalizeCompExecEnv>:
push   %rax
xor    %eax,%eax
call   1030 <FinalizeTypeTable@plt>
xor    %eax,%eax
call   1040 <FinalizeFreeObjList@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <TclFinalizeExecEnv@plt>

LLVM IR (-O0):
define void @TclFinalizeCompExecEnv() {
%1 = call i32 (...) @FinalizeTypeTable()
%2 = call i32 (...) @FinalizeFreeObjList()
%3 = call i32 (...) @TclFinalizeExecEnv()
ret void
}

LLVM IR (-O2):
define void @TclFinalizeCompExecEnv() {
%1 = tail call i32 (...) @FinalizeTypeTable()
%2 = tail call i32 (...) @FinalizeFreeObjList()
%3 = tail call i32 (...) @TclFinalizeExecEnv()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  unsigned int x = 0xFFFFFFFF;
  assert(sizeof x == 4);
  assert(x + 1 == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = call i32 @assert(i32 1)
%4 = load i32, i32* %2
%5 = add i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buf[10];
  strcpy(buf, argv[1]);
  printf("%s\n", buf);
  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)
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1a(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %7, i8* %10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t rdtsc(void) {
  uint64_t rv;
  __asm__ __volatile__("rdtsc" : "=A"(rv));
  return (rv);
}


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

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

LLVM IR (-O0):
define i8* @rdtsc() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdtsc() {
%1 = tail call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int is_valid_item(char menu_type, int option, int num_items, int min_items) {
  int valid = 0;
  if ((option >= min_items) && (option <= num_items)) {
    valid = 1;
  } else {
    printf("Please enter valid input.5");
  }
  return valid;
}


x86 assembly (clang, -O0):
<is_valid_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <is_valid_item+0x42>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1152 <is_valid_item+0x42>
movl   $0x1,-0x14(%rbp)
jmp    115e <is_valid_item+0x4e>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_item>:
cmp    %edx,%esi
jg     111e <is_valid_item+0xe>
mov    $0x1,%eax
cmp    %ecx,%esi
jl     111e <is_valid_item+0xe>
ret
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter valid input.5\00"
define i32 @is_valid_item(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %9
br label %20
18: ; preds = %13, %4
%19 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %17
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter valid input.5\00"
define i32 @is_valid_item(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %1, %3
%6 = icmp sgt i32 %1, %2
%7 = or i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %11
}
int xen_numa_init(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @xen_numa_init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ AuxMagSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void AuxMagSettingsUpdated() { UAVObjUpdated(AuxMagSettingsHandle()); }


x86 assembly (clang, -O0):
<AuxMagSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AuxMagSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AuxMagSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <AuxMagSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @AuxMagSettingsUpdated() {
%1 = call i32 (...) @AuxMagSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AuxMagSettingsUpdated() {
%1 = tail call i32 (...) @AuxMagSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_foo();
int main(int argc, char **argv) {
  print_foo();
  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)
mov    $0x0,%al
call   1030 <print_foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = call i32 (...) @print_foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @print_foo()
ret i32 0
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_unmask_up(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 &= ~0x04;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_unmask_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_unmask_up+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xfffffffb,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_unmask_up+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_unmask_up>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_unmask_up+0x41>
movsbl 0xf(%rsp),%esi
and    $0xfffffffb,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_unmask_up() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -5
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_unmask_up() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -5
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
void gtk_alignment_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_alignment_new() {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t os_supports_mappedfiles() { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @os_supports_mappedfiles() {
ret i32 1
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void cleanup(void) {
  printf("All cleaned up!\n");
  if (fflush(stdout) == EOF) {
    printf("Could not close stream inside exit handler\n");
  }
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
jne    115a <cleanup+0x3a>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
jne    1154 <cleanup+0x34>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"All cleaned up!\0A\00"
@stdout = global i32 0
@EOF = global i64 0
@.str.1 = [44 x i8] c"Could not close stream inside exit handler\0A\00"
define void @cleanup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i64 @fflush(i32 %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i64 0
@str = [16 x i8] c"All cleaned up!\00"
@str.2 = [43 x i8] c"Could not close stream inside exit handler\00"
define void @cleanup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i64 @fflush(i32 %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}
/* Type definitions */
struct message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_user(struct message const *, int);
void signin_command(const struct message *message, int socket_fd) {
  add_user(message, socket_fd);
}


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

x86 assembly (clang, -O2):
<signin_command>:
jmp    1030 <add_user@plt>

LLVM IR (-O0):
%struct.message = type { i32 }
define void @signin_command(%struct.message* %0, i32 %1) {
%3 = alloca %struct.message*
%4 = alloca i32
store %struct.message* %0, %struct.message** %3
store i32 %1, i32* %4
%5 = load %struct.message*, %struct.message** %3
%6 = load i32, i32* %4
%7 = call i32 @add_user(%struct.message* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.message = type { i32 }
define void @signin_command(%struct.message* %0, i32 %1) {
%3 = tail call i32 @add_user(%struct.message* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char **argv) {
  printf("Usage: %s [OPTIONS] cmdline\n", argv[0]);
  printf("-h, --help\t\tdisplay this help and exit\n"
         "--version\t\toutput version information and exit\n"
         "-s, --set cmdline\tset elilo alternate variable to cmdline\n"
         "-p, --print\t\tprint elilo alternate variable\n"
         "-d, --delete\t\tprint elilo alternate variable\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: %s [OPTIONS] cmdline\0A\00"
@.str.1 = [234 x i8] c"-h, --help\09\09display this help and exit\0A--version\09\09output version information and exit\0A-s, --set cmdline\09set elilo alternate variable to cmdline\0A-p, --print\09\09print elilo alternate variable\0A-d, --delete\09\09print elilo alternate variable\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: %s [OPTIONS] cmdline\0A\00"
@str = [233 x i8] c"-h, --help\09\09display this help and exit\0A--version\09\09output version information and exit\0A-s, --set cmdline\09set elilo alternate variable to cmdline\0A-p, --print\09\09print elilo alternate variable\0A-d, --delete\09\09print elilo alternate variable\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([233 x i8], [233 x i8]* @str, i64 0, i64 0))
ret void
}
double btdtr(a, b, x)
double a, b, x;
{ return (incbet(a, b, x)); }


x86 assembly (clang, -O0):
<btdtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    $0x3,%al
call   1030 <incbet@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btdtr>:
push   %rax
mov    $0x3,%al
call   1030 <incbet@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @btdtr(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 (double, double, double, ...) bitcast (i32 (...)* @incbet to i32 (double, double, double, ...)*)(double %7, double %8, double %9)
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @btdtr(double %0, double %1, double %2) {
%4 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @incbet to i32 (double, double, double, ...)*)(double %0, double %1, double %2)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
scalar_t__ isalpha(char);
char tolower(char);
int chpos(char ch) {
  if (isalpha(ch))
    return tolower(ch) - 'a' + 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<chpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     115b <chpos+0x3b>
movsbl -0x5(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <chpos+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chpos>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
test   %rax,%rax
je     113d <chpos+0x1d>
movsbl %bl,%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    $0xffffffa0,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @chpos(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call signext i8 @tolower(i8 signext %0)
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, -96
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}