xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ctest1(int *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  ctest1(&x, "test");
  printf("Valx=%d\n", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [9 x i8] c"Valx=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @ctest1(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usbcb_wake_from_suspend();
void usb_wake_from_suspend(void) {
  usbcb_wake_from_suspend();
  *(volatile unsigned *)(0xBF800000 + (0x85050)) &= ~0x0010;
  *(volatile unsigned *)(0xBF800000 + (0x85040)) = 0x0010;
}


x86 assembly (clang, -O0):
<usb_wake_from_suspend>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <usbcb_wake_from_suspend@plt>
mov    $0xbf885050,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0xbf885050,%eax
mov    %ecx,(%rax)
mov    $0xbf885040,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_wake_from_suspend>:
push   %rax
xor    %eax,%eax
call   1030 <usbcb_wake_from_suspend@plt>
mov    $0xbf885050,%eax
andl   $0xffffffef,(%rax)
movl   $0x10,-0x10(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @usb_wake_from_suspend() {
%1 = call i32 (...) @usbcb_wake_from_suspend()
%2 = load volatile i32, i32* inttoptr (i64 3213381712 to i32*)
%3 = and i32 %2, -17
store volatile i32 %3, i32* inttoptr (i64 3213381712 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213381696 to i32*)
ret void
}

LLVM IR (-O2):
define void @usb_wake_from_suspend() {
%1 = tail call i32 (...) @usbcb_wake_from_suspend()
%2 = load volatile i32, i32* inttoptr (i64 3213381712 to i32*)
%3 = and i32 %2, -17
store volatile i32 %3, i32* inttoptr (i64 3213381712 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213381696 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
int mkdir(char const *, int);
int resctrl_mon_mkdir(const char *path) {
  ;
  if (mkdir(path, 0755) == -1 && errno != EEXIST)
    return 7;
  return 0;
}


x86 assembly (clang, -O0):
<resctrl_mon_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    1159 <resctrl_mon_mkdir+0x49>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
je     1159 <resctrl_mon_mkdir+0x49>
movl   $0x7,-0x4(%rbp)
jmp    1160 <resctrl_mon_mkdir+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resctrl_mon_mkdir>:
push   %rax
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    113b <resctrl_mon_mkdir+0x2b>
mov    0x2eb1(%rip),%rax
mov    (%rax),%rcx
mov    0x2eaf(%rip),%rdx
mov    $0x7,%eax
cmp    (%rdx),%rcx
jne    113d <resctrl_mon_mkdir+0x2d>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @resctrl_mon_mkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 493)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EEXIST
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 7, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__37__IO__clr();
void SharedAnalogDeviceP__0__EnablePin__clr(void) {
  HplAtm128GeneralIOPinP__37__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @SharedAnalogDeviceP__0__EnablePin__clr() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__37__IO__clr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ recurse(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  recurse(0);
  exit(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)
xor    %edi,%edi
call   1030 <recurse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <recurse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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 @recurse(i32 0)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @recurse(i32 0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr_fd(char const *, int);
void ft_putstr(char const *s) { ft_putstr_fd(s, 1); }


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

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

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = tail call i32 @ft_putstr_fd(i8* %0, i32 1)
ret void
}
void spin_lock(int *p) {
  while (!__sync_bool_compare_and_swap(p, 0, 1))
    ;
}


x86 assembly (clang, -O0):
<spin_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    $0x1,%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <spin_lock+0x2b>
jmp    1130 <spin_lock+0x30>
jmp    1108 <spin_lock+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_lock>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
lock cmpxchg %ecx,(%rdi)
jne    1110 <spin_lock+0x10>
ret

LLVM IR (-O0):
define void @spin_lock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %8, %1
%4 = load i32*, i32** %2
%5 = cmpxchg i32* %4, i32 0, i32 1 seq_cst seq_cst
%6 = extractvalue { i32, i1 } %5, 1
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @spin_lock(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = cmpxchg i32* %0, i32 0, i32 1 seq_cst seq_cst
%4 = extractvalue { i32, i1 } %3, 1
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double getEccentricity() {
  double ec;
  printf("Enter the eccentricity of the orbit: ");
  scanf("%lf", &ec);
  return ec;
}


x86 assembly (clang, -O0):
<getEccentricity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEccentricity>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter the eccentricity of the orbit: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @getEccentricity() {
%1 = alloca double
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@.str = [38 x i8] c"Enter the eccentricity of the orbit: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @getEccentricity() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
ret double %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int keycode;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_keycode(void *_p, unsigned _v) {
  ((XKeyPressedEvent *)_p)->keycode = (unsigned)_v;
}


x86 assembly (clang, -O0):
<set_XKeyPressedEvent_keycode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XKeyPressedEvent_keycode>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyPressedEvent_keycode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyPressedEvent_keycode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void wifi_evt_hardware_soft_timer(
    const struct wifi_msg_hardware_soft_timer_evt_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_hardware_soft_timer_evt_t = type opaque
define void @wifi_evt_hardware_soft_timer(%struct.wifi_msg_hardware_soft_timer_evt_t* %0) {
%2 = alloca %struct.wifi_msg_hardware_soft_timer_evt_t*
store %struct.wifi_msg_hardware_soft_timer_evt_t* %0, %struct.wifi_msg_hardware_soft_timer_evt_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_hardware_soft_timer_evt_t = type opaque
define void @wifi_evt_hardware_soft_timer(%struct.wifi_msg_hardware_soft_timer_evt_t* nocapture %0) {
ret void
}
void glGetMaterialxv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetMaterialxv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intif_charposreq(int, char const *, int);
int intif_jumpto(int account_id, const char *name) {
  intif_charposreq(account_id, name, 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @intif_jumpto(i32 %0, i8* %1) {
%3 = tail call i32 @intif_charposreq(i32 %0, i8* %1, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emsEnd(int *);
void errEnd(int *status) { emsEnd(status); }


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

x86 assembly (clang, -O2):
<errEnd>:
jmp    1030 <emsEnd@plt>

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

LLVM IR (-O2):
define void @errEnd(i32* %0) {
%2 = tail call i32 @emsEnd(i32* %0)
ret void
}
int isdigit(int c) { return (47 < c && c < 58); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x2f,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jge    1124 <isdigit+0x24>
cmpl   $0x3a,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 47, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 58
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
char *whoami() {
  struct passwd *pw;
  if (NULL != (pw = getpwuid(getuid())))
    return pw->pw_name;
  else
    return "nobody";
}


x86 assembly (clang, -O0):
<whoami>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     1158 <whoami+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <whoami+0x43>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whoami>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1139 <whoami+0x19>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xec0(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [7 x i8] c"nobody\00"
define i8* @whoami() {
%1 = alloca i8*
%2 = alloca %struct.passwd*
%3 = call i32 (...) @getuid()
%4 = call %struct.passwd* @getpwuid(i32 %3)
store %struct.passwd* %4, %struct.passwd** %2
%5 = icmp ne %struct.passwd* null, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load %struct.passwd*, %struct.passwd** %2
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i32 0, i32 0
%9 = load i8*, i8** %8
store i8* %9, i8** %1
br label %11
10: ; preds = %0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
11: ; preds = %10, %6
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [7 x i8] c"nobody\00"
define i8* @whoami() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %0, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %8
}
int d_lt_mm1(double *a1, double *a2) { return (((*a1) < (*a2))); }


x86 assembly (clang, -O0):
<d_lt_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_lt_mm1>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @d_lt_mm1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp olt double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_lt_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int D_log2(int num) {
  int c;
  c = 0;
  while (num >>= 1)
    c++;
  return c;
}


x86 assembly (clang, -O0):
<D_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <D_log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <D_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<D_log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <D_log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <D_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @D_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ handleLine(char *, char *, char *);
int /*<<< orphan*/ stdin;
void getInput(char *indexName, char *typeName) {
  char *line = NULL;
  size_t linecap = 0;
  while (getline(&line, &linecap, stdin) > 0) {
    handleLine(indexName, typeName, line);
  }
}


x86 assembly (clang, -O0):
<getInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <getline@plt>
cmp    $0x0,%rax
jle    1176 <getInput+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <handleLine@plt>
jmp    1140 <getInput+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInput>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2e9d(%rip),%r13
mov    0x0(%r13),%edx
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
call   1040 <getline@plt>
test   %rax,%rax
jle    1193 <getInput+0x73>
mov    %rsp,%r15
lea    0x8(%rsp),%r12
nopl   0x0(%rax)
mov    (%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <handleLine@plt>
mov    0x0(%r13),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <getline@plt>
test   %rax,%rax
jg     1170 <getInput+0x50>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @getInput(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* null, i8** %5
store i64 0, i64* %6
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* @stdin
%9 = call i64 @getline(i8** %5, i64* %6, i32 %8)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @handleLine(i8* %12, i8* %13, i8* %14)
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @getInput(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%7 = load i32, i32* @stdin
%8 = call i64 @getline(i8** %3, i64* %4, i32 %7)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2, %10
%11 = load i8*, i8** %3
%12 = call i32 @handleLine(i8* %0, i8* %1, i8* %11)
%13 = load i32, i32* @stdin
%14 = call i64 @getline(i8** %3, i64* %4, i32 %13)
%15 = icmp sgt i64 %14, 0
br i1 %15, label %10, label %16
16: ; preds = %10, %2
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isEQ(const char *comm) { return strcmp(comm, "eq") == 0; }


x86 assembly (clang, -O0):
<isEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEQ>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"eq\00"
define i32 @isEQ(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"eq\00"
define i32 @isEQ(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int fast_mod7(int);
int is_leap(int /*<<< orphan*/);
int /*<<< orphan*/ ypit_year(int);
int __attribute__((no)) ypit_nweeks(int j1) {
  int j1dow, islong = 0;
  j1dow = fast_mod7(j1);
  if (j1dow == 4)
    islong = 1;
  else if (j1dow == 3)
    islong = is_leap(ypit_year(j1));
  return 52 + islong;
}


x86 assembly (clang, -O0):
<ypit_nweeks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fast_mod7@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    1163 <ypit_nweeks+0x33>
movl   $0x1,-0xc(%rbp)
jmp    1184 <ypit_nweeks+0x54>
cmpl   $0x3,-0x8(%rbp)
jne    117f <ypit_nweeks+0x4f>
mov    -0x4(%rbp),%edi
call   1050 <ypit_year@plt>
mov    %eax,%edi
call   1030 <is_leap@plt>
mov    %eax,-0xc(%rbp)
jmp    1184 <ypit_nweeks+0x54>
mov    -0xc(%rbp),%eax
add    $0x34,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ypit_nweeks>:
push   %rbx
mov    %edi,%ebx
call   1040 <fast_mod7@plt>
cmp    $0x4,%eax
je     1155 <ypit_nweeks+0x25>
cmp    $0x3,%eax
jne    115c <ypit_nweeks+0x2c>
mov    %ebx,%edi
call   1050 <ypit_year@plt>
mov    %eax,%edi
call   1030 <is_leap@plt>
add    $0x34,%eax
pop    %rbx
ret
mov    $0x35,%eax
pop    %rbx
ret
mov    $0x34,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ypit_nweeks(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @fast_mod7(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 4
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %4
br label %18
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 3
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %2
%15 = call i32 @ypit_year(i32 %14)
%16 = call i32 @is_leap(i32 %15)
store i32 %16, i32* %4
br label %17
17: ; preds = %13, %10
br label %18
18: ; preds = %17, %9
%19 = load i32, i32* %4
%20 = add nsw i32 52, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @ypit_nweeks(i32 %0) {
%2 = tail call i32 @fast_mod7(i32 %0)
switch i32 %2, label %7 [
i32 4, label %8
i32 3, label %3
]
3: ; preds = %1
%4 = tail call i32 @ypit_year(i32 %0)
%5 = tail call i32 @is_leap(i32 %4)
%6 = add i32 %5, 52
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %3
%9 = phi i32 [ %6, %3 ], [ 53, %1 ], [ 52, %7 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x45() {
  Assert_real((isupper(69)),
              "/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_isupper.c",
              350, ("isupper should be 1 for E"));
}


x86 assembly (clang, -O0):
<t_isupper_0x45>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x15e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x45>:
push   %rax
mov    $0x45,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x15e,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for E\00"
define void @t_isupper_0x45() {
%1 = call i32 @isupper(i32 69)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for E\00"
define void @t_isupper_0x45() {
%1 = tail call i32 @isupper(i32 69)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long seek(long fd, long offset, long mode) {
  long ret = 0;
  asm("movq $19,%%rax  \n\t"
      "movq %1,%%rbx \n\t"
      "movq %2,%%rcx  \n\t"
      "movq %3,%%rdx \n\t"
      "int $0x80  \n\t"
      "movq %%rax,%0 \n\t"
      : "=m"(ret)
      : "m"(fd), "m"(offset), "m"(mode));
  return ret;
}


x86 assembly (clang, -O0):
<seek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x13,%rax
mov    -0x8(%rbp),%rbx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
int    $0x80
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    %rdx,-0x18(%rsp)
movq   $0x0,-0x20(%rsp)
mov    $0x13,%rax
mov    -0x8(%rsp),%rbx
mov    -0x10(%rsp),%rcx
mov    -0x18(%rsp),%rdx
int    $0x80
mov    %rax,-0x20(%rsp)
mov    -0x20(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @seek(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 0, i64* %7
%8 = load i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @seek(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = bitcast i64* %7 to i8*
store i64 0, i64* %7
%9 = load i64, i64* %7
ret i64 %9
}
int benchmarkIterationsCount() { return 50; }


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

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

LLVM IR (-O0):
define i32 @benchmarkIterationsCount() {
ret i32 50
}

LLVM IR (-O2):
define i32 @benchmarkIterationsCount() {
ret i32 50
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int write_arr(FILE *f, int *arr, int size) {
  for (int i = 0; i < size; i++) {
    fprintf(f, "%i ", arr[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<write_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <write_arr+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <write_arr+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_arr>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1148 <write_arr+0x38>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,4),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <write_arr+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i \00"
define i32 @write_arr(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32*, i32** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define i32 @write_arr(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret i32 0
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
int fork_sig_data(void *dri_if) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fork_sig_data(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void atcleanup_free_callback(void *mem) { free(mem); }


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

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

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

LLVM IR (-O2):
define void @atcleanup_free_callback(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double exp(double);
double sigmoid(double x) { return 1.0 / (1.0 + exp(-x)); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  0xeba(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @exp(double %4)
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @sigmoid(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ tolower(int);
char *strlwr(char *string) {
  int c;
  while ((c = *string) != 0) {
    *string++ = tolower(c);
  }
  return (string);
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     114f <strlwr+0x3f>
mov    -0xc(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111c <strlwr+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%cl
test   %cl,%cl
je     113d <strlwr+0x2d>
nopw   0x0(%rax,%rax,1)
movsbl %cl,%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
lea    0x1(%rbx),%rax
mov    %cl,(%rbx)
movzbl 0x1(%rbx),%ecx
mov    %rax,%rbx
test   %cl,%cl
jne    1120 <strlwr+0x10>
pop    %rbx
ret
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @tolower(i32 %7)
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put1_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int);
void MC_put_o_16_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                        int height) {
  MC_put1_16(height, dest, ref, stride);
}


x86 assembly (clang, -O0):
<MC_put_o_16_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <MC_put1_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_put_o_16_mmxext>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
jmp    1030 <MC_put1_16@plt>

LLVM IR (-O0):
define void @MC_put_o_16_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_put1_16(i32 %9, i32* %10, i32* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @MC_put_o_16_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put1_16(i32 %3, i32* %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ thr1(int /*<<< orphan*/);
int /*<<< orphan*/ thr2(int /*<<< orphan*/);
int /*<<< orphan*/ thr3(int /*<<< orphan*/);
int /*<<< orphan*/ thr4(int /*<<< orphan*/);
int /*<<< orphan*/ thr5(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  thr1(0);
__CPROVER_ASYNC_1:
  thr2(0);
__CPROVER_ASYNC_2:
  thr3(0);
__CPROVER_ASYNC_3:
  thr4(0);
__CPROVER_ASYNC_4:
  thr5(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1070 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %edi,%edi
call   1060 <thr5@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1070 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %edi,%edi
call   1060 <thr5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @thr1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @thr2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @thr3(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @thr4(i32 0)
br label %10
10: ; preds = %8
%11 = call i32 @thr5(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @thr1(i32 0)
%2 = tail call i32 @thr2(i32 0)
%3 = tail call i32 @thr3(i32 0)
%4 = tail call i32 @thr4(i32 0)
%5 = tail call i32 @thr5(i32 0)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_get_machine_names(char ***machines) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_get_machine_names>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_get_machine_names>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_get_machine_names(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_get_machine_names(i8*** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ tcdrain(int);
void serial_close(int serial_port) {
  tcdrain(serial_port);
  close(serial_port);
}


x86 assembly (clang, -O0):
<serial_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tcdrain@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_close>:
push   %rbx
mov    %edi,%ebx
call   1030 <tcdrain@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @serial_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @tcdrain(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @serial_close(i32 %0) {
%2 = tail call i32 @tcdrain(i32 %0)
%3 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
double mean(double, double);
int /*<<< orphan*/ printf(char *, double, double, double);
int main(void) {
  double v1, v2, m;
  v1 = 5.5;
  v2 = 7.9;
  m = mean(v1, v2);
  printf("The mean of %3.2f and %3.2f is %3.2f\n", v1, v2, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <mean@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <mean@plt>
movaps %xmm0,%xmm2
lea    0xed0(%rip),%rdi
movsd  0xeb8(%rip),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"The mean of %3.2f and %3.2f is %3.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 5.500000e+00, double* %2
store double 7.900000e+00, double* %3
%5 = load double, double* %2
%6 = load double, double* %3
%7 = call double @mean(double %5, double %6)
store double %7, double* %4
%8 = load double, double* %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %8, double %9, double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"The mean of %3.2f and %3.2f is %3.2f\0A\00"
define i32 @main() {
%1 = tail call double @mean(double 5.500000e+00, double 7.900000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double 5.500000e+00, double 7.900000e+00, double %1)
ret i32 0
}
int sc_is_space(unsigned char element) {
  if (' ' == element || '\t' == element)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<sc_is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
je     112c <sc_is_space+0x2c>
movzbl -0x5(%rbp),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
jne    1138 <sc_is_space+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <sc_is_space+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_is_space>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @sc_is_space(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 32, %5
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 9, %9
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @sc_is_space(i8 zeroext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long int fsize(FILE *file) {
  long int currentpos;
  long int size;
  currentpos = ftell(file);
  fseek(file, 0, SEEK_END);
  size = ftell(file);
  fseek(file, currentpos, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
/* Variables and functions */
char *getUserGameDataDir();
char *getSetupDir() { return getUserGameDataDir(); }


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

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

LLVM IR (-O0):
define i8* @getSetupDir() {
%1 = call i8* (...) @getUserGameDataDir()
ret i8* %1
}

LLVM IR (-O2):
define i8* @getSetupDir() {
%1 = tail call i8* (...) @getUserGameDataDir()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ update_z_conf(float, double);
void vff_update(float z_meas) { update_z_conf(z_meas, 1.0); }


x86 assembly (clang, -O0):
<vff_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <update_z_conf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vff_update>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <update_z_conf@plt>

LLVM IR (-O0):
define void @vff_update(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @update_z_conf(float %3, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @vff_update(float %0) {
%2 = tail call i32 @update_z_conf(float %0, double 1.000000e+00)
ret void
}