xunge/DecIR huggingface dataset:
int sfd_strlen(const char *s) {
  int i = 0;
  while (s[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<sfd_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <sfd_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sfd_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <sfd_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @sfd_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printerr_ex(int, char *, int);
int /*<<< orphan*/ printf(char *);
int sl_log(char *, char *);
int main(void) {
  int ret;
  ret = sl_log("Test", "This is testing message");
  printerr_ex((ret == -1), "sl_log", 1);
  printf("Written message into pblog.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <sl_log@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb5(%rip),%rsi
mov    $0x1,%edx
call   1050 <printerr_ex@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <sl_log@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xec9(%rip),%rsi
mov    $0x1,%edx
call   1050 <printerr_ex@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Test\00"
@.str.1 = [24 x i8] c"This is testing message\00"
@.str.2 = [7 x i8] c"sl_log\00"
@.str.3 = [29 x i8] c"Written message into pblog.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sl_log(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @printerr_ex(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 1)
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Test\00"
@.str.1 = [24 x i8] c"This is testing message\00"
@.str.2 = [7 x i8] c"sl_log\00"
@str = [28 x i8] c"Written message into pblog.\00"
define i32 @main() {
%1 = tail call i32 @sl_log(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @printerr_ex(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned long long read_num(char const *, int, char *);
unsigned long long read_oct(const char *s) { return read_num(s, 8, "octal"); }


x86 assembly (clang, -O0):
<read_oct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
lea    0xed4(%rip),%rdx
call   1030 <read_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"octal\00"
define i64 @read_oct(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @read_num(i8* %3, i32 8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i64 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"octal\00"
define i64 @read_oct(i8* %0) {
%2 = tail call i64 @read_num(i8* %0, i32 8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i64 %2
}
/* Variables and functions */
char *strchr(const char *str, int c) {
  register char *p = (char *)str;
  register const char chr = c;
  while (*p)
    if (*p == chr)
      return p;
    else
      p++;
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <strchr+0x57>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <strchr+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <strchr+0x5f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <strchr+0x19>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
__attribute__((no)) __attribute__((optimize("-O0"))) void
stress_sigsegv_x86_trap(void) {
  int a = 1, b = 2;
  asm(".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      ".byte 0xf2\n\t"
      "mul %1\n\t"
      : "=r"(a)
      : "r"(b), "r"(a));
}


x86 assembly (clang, -O0):
<stress_sigsegv_x86_trap>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz
f2 f2 f2 f2 f2 f2 f2
repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz repnz
f2 f2 f2 f2 f2 f2 f2
mul    %eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @stress_sigsegv_x86_trap() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %1
%5 = call i32 asm ".byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09mul $1\0A\09", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 %3, i32 %4)
store i32 %5, i32* %1
ret void
}

LLVM IR (-O2):
define void @stress_sigsegv_x86_trap() {
%1 = tail call i32 asm ".byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09.byte 0xf2\0A\09mul $1\0A\09", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 2, i32 1)
ret void
}
double bfield_scale_factor(double x, int dim) { return 1.0; }


x86 assembly (clang, -O0):
<bfield_scale_factor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfield_scale_factor>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @bfield_scale_factor(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @bfield_scale_factor(double %0, i32 %1) {
ret double 1.000000e+00
}
int issep(char c) { return ((c == ',') || (c == ':') || (c == ';')); }


x86 assembly (clang, -O0):
<issep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     113b <issep+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3a,%ecx
mov    %al,-0x2(%rbp)
je     113b <issep+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x3b,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<issep>:
mov    $0x1,%eax
cmp    $0x2c,%dil
je     1111 <issep+0x11>
cmp    $0x3a,%dil
jne    1112 <issep+0x12>
ret
xor    %eax,%eax
cmp    $0x3b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @issep(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 44
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 58
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 59
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @issep(i8 signext %0) {
switch i8 %0, label %2 [
i8 58, label %5
i8 44, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 59
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
void potentiometers_init(void) {}


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

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

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

LLVM IR (-O2):
define void @potentiometers_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wpa_supplicant_req_scan(void *, int, int);
void _wpa_supplicant_req_scan(void *wpa_s, int sec, int usec) {
  wpa_supplicant_req_scan(wpa_s, sec, usec);
}


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

x86 assembly (clang, -O2):
<_wpa_supplicant_req_scan>:
jmp    1030 <wpa_supplicant_req_scan@plt>

LLVM IR (-O0):
define void @_wpa_supplicant_req_scan(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @wpa_supplicant_req_scan(i8* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @_wpa_supplicant_req_scan(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @wpa_supplicant_req_scan(i8* %0, i32 %1, i32 %2)
ret void
}
void ff_hevc_put_hevc_epel_hv64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv64_10_sse4() {
ret void
}
/* Type definitions */
struct uv__epoll_event {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int syscall(int, int, struct uv__epoll_event *, int, int,
            int /*<<< orphan*/ const *, int);
int uv__epoll_pwait(int epfd, struct uv__epoll_event *events, int nevents,
                    int timeout, const sigset_t *sigmask) {
  return syscall(281, epfd, events, nevents, timeout, sigmask,
                 sizeof(*sigmask));
}


x86 assembly (clang, -O0):
<uv__epoll_pwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    $0x119,%edi
movl   $0x4,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__epoll_pwait>:
push   %rax
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x4,(%rsp)
mov    $0x119,%edi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.uv__epoll_event = type { i32 }
define i32 @uv__epoll_pwait(i32 %0, %struct.uv__epoll_event* %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca %struct.uv__epoll_event*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store %struct.uv__epoll_event* %1, %struct.uv__epoll_event** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load %struct.uv__epoll_event*, %struct.uv__epoll_event** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i32 @syscall(i32 281, i32 %11, %struct.uv__epoll_event* %12, i32 %13, i32 %14, i32* %15, i32 4)
ret i32 %16
}

LLVM IR (-O2):
%struct.uv__epoll_event = type { i32 }
define i32 @uv__epoll_pwait(i32 %0, %struct.uv__epoll_event* %1, i32 %2, i32 %3, i32* %4) {
%6 = tail call i32 @syscall(i32 281, i32 %0, %struct.uv__epoll_event* %1, i32 %2, i32 %3, i32* %4, i32 4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_add(uintptr_t, uintptr_t, uintptr_t);
void fiat_p434_add(uint64_t out1[7], const uint64_t arg1[7],
                   const uint64_t arg2[7]) {
  internal_fiat_p434_add((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


x86 assembly (clang, -O0):
<fiat_p434_add>:
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),%rdx
call   1030 <internal_fiat_p434_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p434_add>:
jmp    1030 <internal_fiat_p434_add@plt>

LLVM IR (-O0):
define void @fiat_p434_add(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p434_add(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p434_add(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p434_add(i64 %4, i64 %5, i64 %6)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
off_t pl_file_size(const char *file) {
  struct stat st;
  if (!stat(file, &st))
    return st.st_size;
  return 0;
}


x86 assembly (clang, -O0):
<pl_file_size>:
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,%eax
jne    113d <pl_file_size+0x2d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <pl_file_size+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    1124 <pl_file_size+0x14>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @pl_file_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 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t F(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (~x & z); }


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

x86 assembly (clang, -O2):
<F>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @F(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 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @F(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
int test_imm_0Cuint8_mem(unsigned char *val) {
  return ((*val) & (-0x0C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Cuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfffffff4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -12
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void nputs(char *p, int c) {
  while (c--)
    putchar(*p++);
}


x86 assembly (clang, -O0):
<nputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114f <nputs+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111f <nputs+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nputs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <nputs+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <nputs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @nputs(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
int nc_set_base_pe(int ncid, int pe) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nc_set_base_pe(i32 %0, i32 %1) {
ret i32 0
}
int xfs_fileid_length(int hasparent, int is64) {
  return hasparent ? (is64 ? 6 : 4) : (is64 ? 3 : 2);
}


x86 assembly (clang, -O0):
<xfs_fileid_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <xfs_fileid_length+0x2f>
mov    -0x8(%rbp),%edx
mov    $0x4,%eax
mov    $0x6,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <xfs_fileid_length+0x45>
mov    -0x8(%rbp),%edx
mov    $0x2,%eax
mov    $0x3,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_fileid_length>:
xor    %eax,%eax
xor    %ecx,%ecx
test   %esi,%esi
setne  %al
sete   %cl
xor    $0x3,%ecx
test   %edi,%edi
lea    0x4(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xfs_fileid_length(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 6, i32 4
br label %17
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 3, i32 2
br label %17
17: ; preds = %12, %7
%18 = phi i32 [ %11, %7 ], [ %16, %12 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @xfs_fileid_length(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 4, i32 6
%6 = select i1 %4, i32 2, i32 3
%7 = select i1 %3, i32 %6, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x96() {
  Assert_real((isalnum(150) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              755, ("isalnum should be 0 for 0x96"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x96\00"
define void @t_isalnum_0x96() {
%1 = call i64 @isalnum(i32 150)
%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 755, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x96\00"
define void @t_isalnum_0x96() {
%1 = tail call i64 @isalnum(i32 150)
%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 755, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int sum;
  int *int_p = (int *)malloc(10 * sizeof(int));
  *int_p = 2;
  void *void_p;
  void_p = int_p;
  int i;
  for (i = 0; i < 10; i++) {
    int *int_p2 = (int *)void_p;
    sum += *int_p + *int_p2;
    int_p++;
    void_p = (void *)((int)void_p + sizeof(int));
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    1192 <main+0x82>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
add    (%rcx),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cltq
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1030 <malloc@plt>
movl   $0x2,(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 40)
%2 = inttoptr i64 %1 to i32*
store i32 2, i32* %2
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void writeLittleInt(FILE *file, uint32_t value) {
  putc((value), file);
  putc((value >> 8), file);
  putc((value >> 16), file);
  putc((value >> 24), file);
}


x86 assembly (clang, -O0):
<writeLittleInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeLittleInt>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
sar    $0x8,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
sar    $0x10,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
sar    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @writeLittleInt(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @putc(i32 %5, i32* %6)
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = call i32 @putc(i32 %9, i32* %10)
%12 = load i32, i32* %4
%13 = ashr i32 %12, 16
%14 = load i32*, i32** %3
%15 = call i32 @putc(i32 %13, i32* %14)
%16 = load i32, i32* %4
%17 = ashr i32 %16, 24
%18 = load i32*, i32** %3
%19 = call i32 @putc(i32 %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @writeLittleInt(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @putc(i32 %1, i32* %0)
%4 = ashr i32 %1, 8
%5 = tail call i32 @putc(i32 %4, i32* %0)
%6 = ashr i32 %1, 16
%7 = tail call i32 @putc(i32 %6, i32* %0)
%8 = ashr i32 %1, 24
%9 = tail call i32 @putc(i32 %8, i32* %0)
ret void
}
double add(const double x, const double y, const double z) { return x + y + z; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @add(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 = fadd double %7, %8
%10 = load double, double* %6
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @add(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
ret double %5
}
float descending_order(float a, float b) { return b - a; }


x86 assembly (clang, -O0):
<descending_order>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<descending_order>:
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @descending_order(float %0, float %1) {
%3 = fsub float %1, %0
ret float %3
}
int is_prime(number) {
  int divider;
  if (number < 1) {
    return -1;
  } else {
    for (divider = 2; divider < number; divider++) {
      if (number % divider == 0) {
        return 0;
      }
    }
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <is_prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <is_prime+0x66>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <is_prime+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <is_prime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <is_prime+0x66>
jmp    1151 <is_prime+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
test   %edi,%edi
jle    1133 <is_prime+0x33>
mov    $0x1,%ecx
cmp    $0x3,%edi
jb     1130 <is_prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1139 <is_prime+0x39>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <is_prime+0x20>
mov    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %24
8: ; preds = %1
store i32 2, i32* %4
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %2
br label %24
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
store i32 1, i32* %2
br label %24
24: ; preds = %23, %18, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 2
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i32 [ -1, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("%lu, %lu\n", sizeof(int8_t), sizeof(int32_t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%lu, %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
ret i32 0
}
/* Variables and functions */
long atol(char *);
char *ueld_readconfig(char *);
long ueld_readconfiglong(char *name, long defaultval) {
  long i = defaultval;
  char *value = ueld_readconfig(name);
  if (value) {
    i = atol(value);
  }
  return i;
}


x86 assembly (clang, -O0):
<ueld_readconfiglong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ueld_readconfig@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <ueld_readconfiglong+0x3d>
mov    -0x20(%rbp),%rdi
call   1040 <atol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ueld_readconfiglong>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ueld_readconfig@plt>
test   %rax,%rax
je     1137 <ueld_readconfiglong+0x17>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atol@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @ueld_readconfiglong(i8* %0, i64 %1) {
%3 = tail call i8* @ueld_readconfig(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i64 @atol(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = phi i64 [ %6, %5 ], [ %1, %2 ]
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT1_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT1_IRQHandler(void) {
  GPIO1_INT1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO1_INT1_IRQHandler() {
%1 = call i32 (...) @GPIO1_INT1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO1_INT1_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT1_DriverIRQHandler()
ret void
}
int CalculateDaysBetweenFFunc(int year, int month) {
  return (month <= 2) ? year - 1 : year;
}


x86 assembly (clang, -O0):
<CalculateDaysBetweenFFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1122 <CalculateDaysBetweenFFunc+0x22>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <CalculateDaysBetweenFFunc+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateDaysBetweenFFunc>:
mov    %edi,%eax
xor    %ecx,%ecx
cmp    $0x3,%esi
setl   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @CalculateDaysBetweenFFunc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sle i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @CalculateDaysBetweenFFunc(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 3
%4 = sext i1 %3 to i32
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
char *trim_right(char *buffer, int length) {
  int str_len;
  str_len = strlen(buffer);
  if (str_len < length)
    return buffer;
  buffer[str_len - length] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<trim_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1144 <trim_right+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <trim_right+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_right>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
sub    %ebp,%eax
jl     1127 <trim_right+0x17>
cltq
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @trim_right(i8* returned %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = sub nsw i32 %3, %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %2, %5
ret i8* %0
}
int matchdigit(char c) { return ((c >= '0') && (c <= '9')); }


x86 assembly (clang, -O0):
<matchdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <matchdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @matchdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @matchdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int open_rdonly(char *);
int open_rdwr(char *);
int execute_close() {
  close(open_rdonly("syscalls.txt"));
  int fd = open_rdwr("syscalls2.txt");
  close(fd);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<execute_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%edi
call   1040 <close@plt>
lea    0xebb(%rip),%rdi
call   1050 <open_rdwr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_close>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%edi
call   1040 <close@plt>
lea    0xec2(%rip),%rdi
call   1050 <open_rdwr@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <close@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"syscalls.txt\00"
@.str.1 = [14 x i8] c"syscalls2.txt\00"
define i32 @execute_close() {
%1 = alloca i32
%2 = call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @close(i32 %2)
%4 = call i32 @open_rdwr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @close(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @close(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"syscalls.txt\00"
@.str.1 = [14 x i8] c"syscalls2.txt\00"
define i32 @execute_close() {
%1 = tail call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @close(i32 %1)
%3 = tail call i32 @open_rdwr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @close(i32 %3)
%5 = tail call i32 @close(i32 %3)
ret i32 0
}
int do_633() { return 633; }


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

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

LLVM IR (-O0):
define i32 @do_633() {
ret i32 633
}

LLVM IR (-O2):
define i32 @do_633() {
ret i32 633
}