xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_name();
int set_get_name();
int set_name();
int proc_request(int op) {
  int ret = -1;
  switch (op) {
  case 1:
    ret = set_name();
    break;
  case 2:
    ret = get_name();
    break;
  case 3:
    ret = set_get_name();
    break;
  default:
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<proc_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1178 <proc_request+0x48>
jmp    1156 <proc_request+0x26>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1187 <proc_request+0x57>
jmp    1167 <proc_request+0x37>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1196 <proc_request+0x66>
jmp    11a5 <proc_request+0x75>
mov    $0x0,%al
call   1030 <set_name@plt>
mov    %eax,-0x8(%rbp)
jmp    11aa <proc_request+0x7a>
mov    $0x0,%al
call   1050 <get_name@plt>
mov    %eax,-0x8(%rbp)
jmp    11aa <proc_request+0x7a>
mov    $0x0,%al
call   1040 <set_get_name@plt>
mov    %eax,-0x8(%rbp)
jmp    11aa <proc_request+0x7a>
jmp    11aa <proc_request+0x7a>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_request>:
cmp    $0x3,%edi
je     1146 <proc_request+0x16>
cmp    $0x2,%edi
je     114d <proc_request+0x1d>
cmp    $0x1,%edi
jne    1154 <proc_request+0x24>
xor    %eax,%eax
jmp    1030 <set_name@plt>
xor    %eax,%eax
jmp    1040 <set_get_name@plt>
xor    %eax,%eax
jmp    1050 <get_name@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @proc_request(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
]
5: ; preds = %1
%6 = call i32 (...) @set_name()
store i32 %6, i32* %3
br label %12
7: ; preds = %1
%8 = call i32 (...) @get_name()
store i32 %8, i32* %3
br label %12
9: ; preds = %1
%10 = call i32 (...) @set_get_name()
store i32 %10, i32* %3
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %9, %7, %5
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @proc_request(i32 %0) {
switch i32 %0, label %8 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
]
2: ; preds = %1
%3 = tail call i32 (...) @set_name()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @get_name()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @set_get_name()
br label %8
8: ; preds = %1, %6, %4, %2
%9 = phi i32 [ -1, %1 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ]
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y_root;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcrossing_y_root(void *_p) {
  return (int)((XEvent *)_p)->xcrossing.y_root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xcrossing_y_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xcrossing_y_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
flen(f, n) { return ftruncate(f, n); }


x86 assembly (clang, -O0):
<flen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <ftruncate@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @ftruncate to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @flen(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ftruncate to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cvmx_rtc_ds1374_alarm_counter_set(int);
void cvmx_lan_bypass_keep_alive(void) {
  cvmx_rtc_ds1374_alarm_counter_set(0x1000);
}


x86 assembly (clang, -O0):
<cvmx_lan_bypass_keep_alive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1000,%edi
call   1030 <cvmx_rtc_ds1374_alarm_counter_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_lan_bypass_keep_alive>:
mov    $0x1000,%edi
jmp    1030 <cvmx_rtc_ds1374_alarm_counter_set@plt>

LLVM IR (-O0):
define void @cvmx_lan_bypass_keep_alive() {
%1 = call i32 @cvmx_rtc_ds1374_alarm_counter_set(i32 4096)
ret void
}

LLVM IR (-O2):
define void @cvmx_lan_bypass_keep_alive() {
%1 = tail call i32 @cvmx_rtc_ds1374_alarm_counter_set(i32 4096)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EKFConfigurationHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void EKFConfigurationRequestUpdate() {
  UAVObjRequestUpdate(EKFConfigurationHandle());
}


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

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

LLVM IR (-O0):
define void @EKFConfigurationRequestUpdate() {
%1 = call i32 (...) @EKFConfigurationHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @EKFConfigurationRequestUpdate() {
%1 = tail call i32 (...) @EKFConfigurationHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ eMalloc(int);
scalar_t__ popNumber();
int /*<<< orphan*/ pushString(char *);
void basChr() {
  char *buffer = (char *)eMalloc(sizeof(char) * 2);
  buffer[0] = (char)popNumber();
  buffer[1] = '\0';
  pushString(buffer);
}


x86 assembly (clang, -O0):
<basChr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <eMalloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <pushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basChr>:
push   %rbx
mov    $0x2,%edi
call   1030 <eMalloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %al,(%rbx)
movb   $0x0,0x1(%rbx)
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pushString@plt>

LLVM IR (-O0):
define void @basChr() {
%1 = alloca i8*
%2 = call i64 @eMalloc(i32 2)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i64 (...) @popNumber()
%5 = trunc i64 %4 to i8
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %9
%10 = load i8*, i8** %1
%11 = call i32 @pushString(i8* %10)
ret void
}

LLVM IR (-O2):
define void @basChr() {
%1 = tail call i64 @eMalloc(i32 2)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 (...) @popNumber()
%4 = trunc i64 %3 to i8
store i8 %4, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %5
%6 = tail call i32 @pushString(i8* %2)
ret void
}
long baz1(void *a) {
  static long l;
  return l++;
}


x86 assembly (clang, -O0):
<baz1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2f19(%rip),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz1>:
mov    0x2f21(%rip),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x2f16(%rip)
ret

LLVM IR (-O0):
@baz1.l = internal global i64 0
define i64 @baz1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @baz1.l
%4 = add nsw i64 %3, 1
store i64 %4, i64* @baz1.l
ret i64 %3
}

LLVM IR (-O2):
@baz1.l = internal unnamed_addr global i64 0
define i64 @baz1(i8* nocapture readnone %0) {
%2 = load i64, i64* @baz1.l
%3 = add nsw i64 %2, 1
store i64 %3, i64* @baz1.l
ret i64 %2
}
void rsct_usbdev_fini() {}


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

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

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

LLVM IR (-O2):
define void @rsct_usbdev_fini() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *vui_realloc_(void *ptr, size_t size) {
  void *ptr2 = realloc(ptr, size);
  if (ptr2 == NULL) {
    abort();
  }
  return ptr2;
}


x86 assembly (clang, -O0):
<vui_realloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <vui_realloc_+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vui_realloc_>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <vui_realloc_+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @vui_realloc_(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @vui_realloc_(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int safe_streq(const char *lhs, const char *rhs) {
  if (lhs && rhs) {
    return !strcmp(lhs, rhs);
  }
  return 0;
}


x86 assembly (clang, -O0):
<safe_streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1158 <safe_streq+0x48>
cmpq   $0x0,-0x18(%rbp)
je     1158 <safe_streq+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <safe_streq+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_streq>:
xor    %eax,%eax
test   %rdi,%rdi
je     112f <safe_streq+0x1f>
test   %rsi,%rsi
je     112f <safe_streq+0x1f>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @safe_streq(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 @strcmp(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %19
18: ; preds = %8, %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @safe_streq(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void serial_waiting_handle() {
  printf("waiting serial handle\n");
  sleep(1);
}


x86 assembly (clang, -O0):
<serial_waiting_handle>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_waiting_handle>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"waiting serial handle\0A\00"
define void @serial_waiting_handle() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"waiting serial handle\00"
define void @serial_waiting_handle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
double fabs(double);
double fmod(double, double);
double distTMM_CityBlock(double a, double b) {
  double diff1, diff2;
  diff1 = fabs(a - b);
  diff2 = fmod(diff1, 53.0);
  return (((diff2) < (53.0 - diff2)) ? (diff2) : (53.0 - diff2));
}


x86 assembly (clang, -O0):
<distTMM_CityBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xedd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xea0(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <distTMM_CityBlock+0x6e>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1190 <distTMM_CityBlock+0x80>
movsd  0xe7a(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distTMM_CityBlock>:
push   %rax
subsd  %xmm1,%xmm0
andpd  0xee3(%rip),%xmm0
movsd  0xeeb(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
minsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @distTMM_CityBlock(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
%10 = call double @llvm.fabs.f64(double %9)
store double %10, double* %5
%11 = load double, double* %5
%12 = call double @fmod(double %11, double 5.300000e+01)
store double %12, double* %6
%13 = load double, double* %6
%14 = load double, double* %6
%15 = fsub double 5.300000e+01, %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = load double, double* %6
br label %22
19: ; preds = %2
%20 = load double, double* %6
%21 = fsub double 5.300000e+01, %20
br label %22
22: ; preds = %19, %17
%23 = phi double [ %18, %17 ], [ %21, %19 ]
ret double %23
}

LLVM IR (-O2):
define double @distTMM_CityBlock(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = tail call double @fmod(double %4, double 5.300000e+01)
%6 = fsub double 5.300000e+01, %5
%7 = fcmp olt double %5, %6
%8 = select i1 %7, double %5, double %6
ret double %8
}
void v4i_(vec) int vec[4];
{
  float v[4];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  v[3] = vec[3];
  vcall(v, 4);
}


x86 assembly (clang, -O0):
<v4i_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x8(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl 0xc(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4i_>:
sub    $0x18,%rsp
movups (%rdi),%xmm0
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v4i_(i32* %0) {
%2 = alloca i32*
%3 = alloca [4 x float]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to float
%13 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = sitofp i32 %21 to float
%23 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 3
store float %22, float* %23
%24 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%25 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %24, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4i_(i32* nocapture %0) {
%2 = alloca <4 x float>
%3 = bitcast <4 x float>* %2 to i8*
%4 = getelementptr inbounds <4 x float>, <4 x float>* %2, i64 0, i64 0
%5 = bitcast i32* %0 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = sitofp <4 x i32> %6 to <4 x float>
store <4 x float> %7, <4 x float>* %2
%8 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %4, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void CStrDate(char *dateStr) {
  time_t now;
  struct tm *today;
  now = time(NULL);
  today = localtime(&now);
  strftime(dateStr, 9, "%d/%m/%y", today);
}


x86 assembly (clang, -O0):
<CStrDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x9,%esi
lea    0xe97(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CStrDate>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d/%m/%y\00"
define void @CStrDate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d/%m/%y\00"
define void @CStrDate(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
const char *f1(void) { return "falderalde"; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"falderalde\00"
define i8* @f1() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"falderalde\00"
define i8* @f1() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
double sinh_func(x)
double x;
{ return 1.0 - (7.0 / 60.0) * x * x + (31.0 / 2520.0) * x * x * x * x; }


x86 assembly (clang, -O0):
<sinh_func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh_func>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sinh_func(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x3FBDDDDDDDDDDDDE, %3
%5 = load double, double* %2
%6 = fneg double %4
%7 = call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = load double, double* %2
%9 = fmul double 0x3F89319319319319, %8
%10 = load double, double* %2
%11 = fmul double %9, %10
%12 = load double, double* %2
%13 = fmul double %11, %12
%14 = load double, double* %2
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %7)
ret double %15
}

LLVM IR (-O2):
define double @sinh_func(double %0) {
%2 = fmul double %0, 0xBFBDDDDDDDDDDDDE
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fmul double %0, 0x3F89319319319319
%5 = fmul double %4, %0
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %3)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ c2(int);
void c1(int n) { c2(n); }


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

x86 assembly (clang, -O2):
<c1>:
jmp    1030 <c2@plt>

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

LLVM IR (-O2):
define void @c1(i32 %0) {
%2 = tail call i32 @c2(i32 %0)
ret void
}
int test_imm_0Dint16_mem(short *val) {
  return ((*val) & (0x0D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Dint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 13
%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_0Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 13
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double hjd2jd(dj, ra, dec, sys)
double dj;
double ra;
double dec;
int sys;
{
  double lt;
  lt = suntl(dj, ra, dec, sys);
  return (dj - lt);
}


x86 assembly (clang, -O0):
<hjd2jd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x1c(%rbp),%edi
mov    $0x3,%al
call   1030 <suntl@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hjd2jd>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x3,%al
call   1030 <suntl@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hjd2jd(double %0, double %1, double %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load i32, i32* %8
%14 = call i32 (double, double, double, i32, ...) bitcast (i32 (...)* @suntl to i32 (double, double, double, i32, ...)*)(double %10, double %11, double %12, i32 %13)
%15 = sitofp i32 %14 to double
store double %15, double* %9
%16 = load double, double* %5
%17 = load double, double* %9
%18 = fsub double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @hjd2jd(double %0, double %1, double %2, i32 %3) {
%5 = tail call i32 (double, double, double, i32, ...) bitcast (i32 (...)* @suntl to i32 (double, double, double, i32, ...)*)(double %0, double %1, double %2, i32 %3)
%6 = sitofp i32 %5 to double
%7 = fsub double %0, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ RB_AUTOBOOT;
int reboot(int /*<<< orphan*/);
int sys_reboot(void) { return reboot(RB_AUTOBOOT); }


x86 assembly (clang, -O0):
<sys_reboot>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_reboot>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <reboot@plt>

LLVM IR (-O0):
@RB_AUTOBOOT = global i32 0
define i32 @sys_reboot() {
%1 = load i32, i32* @RB_AUTOBOOT
%2 = call i32 @reboot(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@RB_AUTOBOOT = global i32 0
define i32 @sys_reboot() {
%1 = load i32, i32* @RB_AUTOBOOT
%2 = tail call i32 @reboot(i32 %1)
ret i32 %2
}
void protect_kernel_text_data(void) {}


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

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

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

LLVM IR (-O2):
define void @protect_kernel_text_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void matrix_all_free(void **m) {
  void *a;
  a = m[0];
  free(m);
  free(a);
  return;
}


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

x86 assembly (clang, -O2):
<matrix_all_free>:
push   %rbx
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @matrix_all_free(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8**, i8*** %2
%8 = bitcast i8** %7 to i8*
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @matrix_all_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = bitcast i8** %0 to i8*
%4 = tail call i32 @free(i8* %3)
%5 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void wait_for_children() { waitpid(-1, NULL, WNOHANG); }


x86 assembly (clang, -O0):
<wait_for_children>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_children>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
jmp    1030 <waitpid@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @wait_for_children() {
%1 = load i32, i32* @WNOHANG
%2 = call i32 @waitpid(i32 -1, i32* null, i32 %1)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @wait_for_children() {
%1 = load i32, i32* @WNOHANG
%2 = tail call i32 @waitpid(i32 -1, i32* null, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void __put_unaligned_be16(uint16_t val, uint8_t *p) {
  *p++ = val >> 8;
  *p++ = val;
}


x86 assembly (clang, -O0):
<__put_unaligned_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_be16>:
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,(%rsi)
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @__put_unaligned_be16(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 = ashr i32 %5, 8
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %4
store i32 %6, i32* %7
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_be16(i32 %0, i32* nocapture writeonly %1) {
%3 = ashr i32 %0, 8
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %1
store i32 %0, i32* %4
ret void
}
int blankstring(char *str) {
  register char *cp;
  for (cp = str; *cp; cp++) {
    if (*cp != ' ' && *cp != '\t' && *cp != '\r' && *cp != '\n')
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<blankstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     117f <blankstring+0x7f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1169 <blankstring+0x69>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1169 <blankstring+0x69>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1169 <blankstring+0x69>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1169 <blankstring+0x69>
movl   $0x0,-0x4(%rbp)
jmp    1186 <blankstring+0x86>
jmp    116e <blankstring+0x6e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <blankstring+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankstring>:
movabs $0x100002600,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
cmp    $0x20,%rcx
ja     1130 <blankstring+0x30>
bt     %rcx,%rax
jae    1125 <blankstring+0x25>
add    $0x1,%rdi
jmp    1110 <blankstring+0x10>
test   %rcx,%rcx
jne    1130 <blankstring+0x30>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @blankstring(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 32, label %5
i8 9, label %5
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
char UartRx(void) {
  while (((*((volatile unsigned int *)((0xFFFD0000 + 0x14)))) & 0x00000001) ==
         0)
    ;
  return (char)(*((volatile unsigned int *)((0xFFFD0000 + 0x18))));
}


x86 assembly (clang, -O0):
<UartRx>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UartRx+0x9>
mov    $0xfffd0014,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1121 <UartRx+0x21>
jmp    1109 <UartRx+0x9>
mov    $0xfffd0018,%eax
mov    (%rax),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UartRx>:
mov    $0xfffd0014,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x1,(%rax)
je     1110 <UartRx+0x10>
mov    0x4(%rax),%eax
ret

LLVM IR (-O0):
define signext i8 @UartRx() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 4294770708 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 4294770712 to i32*)
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @UartRx() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 4294770708 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 4294770712 to i32*)
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void arr2free(void **aa, const int n1, const int n2) {
  int i;
  for (i = 0; i < n1; i++) {
    free(aa[i]);
  }
  free(aa);
}


x86 assembly (clang, -O0):
<arr2free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <arr2free+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <arr2free+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr2free>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <arr2free+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <arr2free+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @arr2free(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %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* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i8**, i8*** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = bitcast i8* %17 to i8**
%19 = call i32 @free(i8** %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
%24 = load i8**, i8*** %4
%25 = call i32 @free(i8** %24)
ret void
}

LLVM IR (-O2):
define void @arr2free(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = bitcast i8** %9 to i8***
%11 = load i8**, i8*** %10
%12 = tail call i32 @free(i8** %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = tail call i32 @free(i8** %0)
ret void
}
extern unsigned char get_bit_5(const unsigned char c) { return (c & 0x20) > 0; }


x86 assembly (clang, -O0):
<get_bit_5>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_5>:
mov    %edi,%eax
shr    $0x5,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_bit_5(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 32
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @get_bit_5(i8 zeroext %0) {
%2 = lshr i8 %0, 5
%3 = and i8 %2, 1
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
void authnone_destroy(AUTH *client) {}


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

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

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

LLVM IR (-O2):
define void @authnone_destroy(i32* nocapture %0) {
ret void
}
float max_f(float a, float b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <max_f+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max_f+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_f>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @max_f(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_prim2_exp(unsigned int, struct Cyc_Absyn_Exp *,
                                          struct Cyc_Absyn_Exp *, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_eq_exp(struct Cyc_Absyn_Exp *e1,
                                       struct Cyc_Absyn_Exp *e2, unsigned loc) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Absyn_prim2_exp(5U, e1, e2, loc);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Absyn_eq_exp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <Cyc_Absyn_prim2_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_eq_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = alloca %struct.Cyc_Absyn_Exp*
%5 = alloca %struct.Cyc_Absyn_Exp*
%6 = alloca i32
%7 = alloca %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %4
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %5
store i32 %2, i32* %6
%8 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %4
%9 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%10 = load i32, i32* %6
%11 = call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 5, %struct.Cyc_Absyn_Exp* %8, %struct.Cyc_Absyn_Exp* %9, i32 %10)
store %struct.Cyc_Absyn_Exp* %11, %struct.Cyc_Absyn_Exp** %7
%12 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %7
ret %struct.Cyc_Absyn_Exp* %12
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_eq_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 5, %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2)
ret %struct.Cyc_Absyn_Exp* %4
}
unsigned char inportb(unsigned short _port) {
  unsigned char rv;
  __asm__ __volatile__("inb %1, %0" : "=a"(rv) : "dN"(_port));
  return rv;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
int getIntLen(long int value) {
  int l = 1;
  while (value > 9) {
    l++;
    value /= 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<getIntLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x9,-0x8(%rbp)
jle    113a <getIntLen+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    110f <getIntLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIntLen>:
mov    $0x1,%ecx
cmp    $0xa,%rdi
jl     1136 <getIntLen+0x36>
mov    $0x1,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopw   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <getIntLen+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getIntLen(i64 %0) {
%2 = icmp sgt i64 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i64 %5, 10
%8 = icmp ugt i64 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int ENOTSUP;
int cpu_dump_cpuinfo_single(void) { return -ENOTSUP; }


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

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

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @cpu_dump_cpuinfo_single() {
%1 = load i32, i32* @ENOTSUP
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @cpu_dump_cpuinfo_single() {
%1 = load i32, i32* @ENOTSUP
%2 = sub nsw i32 0, %1
ret i32 %2
}
unsigned c_dict_hash(const char *str) {
  unsigned hash = 5381;
  while (*str) {
    hash = ((hash << 5) + hash) ^ *str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<c_dict_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <c_dict_hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <c_dict_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dict_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <c_dict_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <c_dict_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @c_dict_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
char const *disk(char *);
const char *disk_home() { return disk("/home"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"/home\00"
define i8* @disk_home() {
%1 = call i8* @disk(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"/home\00"
define i8* @disk_home() {
%1 = tail call i8* @disk(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
size_t base64len(size_t len) { return (((len + 2) / 3 * 4) + 1); }


x86 assembly (clang, -O0):
<base64len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64len>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @base64len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
%5 = udiv i64 %4, 3
%6 = mul i64 %5, 4
%7 = add i64 %6, 1
ret i64 %7
}

LLVM IR (-O2):
define i64 @base64len(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
%5 = or i64 %4, 1
ret i64 %5
}