xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int EBUSY;
int pthread_rwlock_always_fail_EBUSY(pthread_rwlock_t *rwlock) { return EBUSY; }


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

x86 assembly (clang, -O2):
<pthread_rwlock_always_fail_EBUSY>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EBUSY = global i32 0
define i32 @pthread_rwlock_always_fail_EBUSY(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @EBUSY
ret i32 %3
}

LLVM IR (-O2):
@EBUSY = global i32 0
define i32 @pthread_rwlock_always_fail_EBUSY(i32* nocapture readnone %0) {
%2 = load i32, i32* @EBUSY
ret i32 %2
}
imm0reg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (22 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x16,%eax
cmp    -0xc(%rbp),%eax
ja     1132 <imm0reg1+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <imm0reg1+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0reg1>:
xor    %eax,%eax
cmp    $0x16,%esi
setae  %al
ret

LLVM IR (-O0):
define i32 @imm0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %9
%15 = icmp ule i32 22, %14
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 1, i32* %7
br label %18
17: ; preds = %6
store i32 0, i32* %7
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @imm0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = icmp ugt i32 %1, 21
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ gpio_configure_dir(int, int /*<<< orphan*/);
int /*<<< orphan*/ gpio_configure_edge(int, char *);
int /*<<< orphan*/ gpio_write_value(int, int /*<<< orphan*/);
int initialize_button_gpio(void) {
  gpio_configure_dir(49, 0);
  gpio_write_value(68, 0);
  gpio_configure_edge(49, "rising");
  return 0;
}


x86 assembly (clang, -O0):
<initialize_button_gpio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
xor    %esi,%esi
call   1050 <gpio_configure_dir@plt>
mov    $0x44,%edi
xor    %esi,%esi
call   1040 <gpio_write_value@plt>
mov    $0x31,%edi
lea    0xea8(%rip),%rsi
call   1030 <gpio_configure_edge@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_button_gpio>:
push   %rax
mov    $0x31,%edi
xor    %esi,%esi
call   1050 <gpio_configure_dir@plt>
mov    $0x44,%edi
xor    %esi,%esi
call   1040 <gpio_write_value@plt>
lea    0xeb0(%rip),%rsi
mov    $0x31,%edi
call   1030 <gpio_configure_edge@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"rising\00"
define i32 @initialize_button_gpio() {
%1 = call i32 @gpio_configure_dir(i32 49, i32 0)
%2 = call i32 @gpio_write_value(i32 68, i32 0)
%3 = call i32 @gpio_configure_edge(i32 49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"rising\00"
define i32 @initialize_button_gpio() {
%1 = tail call i32 @gpio_configure_dir(i32 49, i32 0)
%2 = tail call i32 @gpio_write_value(i32 68, i32 0)
%3 = tail call i32 @gpio_configure_edge(i32 49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double fun1(double z) { return 3.0 * z * z - z; }


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

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

LLVM IR (-O0):
define double @fun1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.000000e+00, %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fneg double %6
%8 = call double @llvm.fmuladd.f64(double %4, double %5, double %7)
ret double %8
}

LLVM IR (-O2):
define double @fun1(double %0) {
%2 = fmul double %0, 3.000000e+00
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
ret double %4
}
int b() { return 5; }


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

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

LLVM IR (-O0):
define i32 @b() {
ret i32 5
}

LLVM IR (-O2):
define i32 @b() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ trap(char *);
void trap_pa(void) { trap("prefetch abort"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"prefetch abort\00"
define void @trap_pa() {
%1 = call i32 @trap(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"prefetch abort\00"
define void @trap_pa() {
%1 = tail call i32 @trap(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sesc_exit(int /*<<< orphan*/);
int sesc_prof_commit(int id) {
  sesc_exit(0);
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @sesc_prof_commit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sesc_exit(i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @sesc_prof_commit(i32 %0) {
%2 = tail call i32 @sesc_exit(i32 0)
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
int get_XSelectionClearEvent_send_event(void *_p) {
  return (int)((XSelectionClearEvent *)_p)->send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XSelectionClearEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void free_argv(char **argv, unsigned rows) {
  for (unsigned row = 0; row < rows; row++) {
    free(argv[row]);
  }
  free(argv);
}


x86 assembly (clang, -O0):
<free_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <free_argv+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_argv+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_argv>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <free_argv+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 <free_argv+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_argv(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i8**, i8*** %3
%21 = bitcast i8** %20 to i8*
ret void
}

LLVM IR (-O2):
define void @free_argv(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init_cloud_generation() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<init_cloud_generation>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_cloud_generation() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @init_cloud_generation() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void i2c_ev_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @i2c_ev_handler() {
ret void
}
int c() { return 15; }


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

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

LLVM IR (-O0):
define i32 @c() {
ret i32 15
}

LLVM IR (-O2):
define i32 @c() {
ret i32 15
}
I0R1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (22 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0R1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     113f <I0R1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <I0R1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0R1>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @I0R1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* %9
%15 = fcmp ole double 2.200000e+01, %14
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 1, i32* %7
br label %18
17: ; preds = %6
store i32 0, i32* %7
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @I0R1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = fcmp oge double %1, 2.200000e+01
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putnchr(char c, unsigned int n) {
  while (n > 0) {
    write(1, &c, 1);
    n--;
  }
}


x86 assembly (clang, -O0):
<ft_putnchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1149 <ft_putnchr+0x39>
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <ft_putnchr+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnchr>:
push   %r14
push   %rbx
push   %rax
mov    %dil,0x7(%rsp)
test   %esi,%esi
je     1147 <ft_putnchr+0x37>
mov    %esi,%ebx
lea    0x7(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebx
jne    1130 <ft_putnchr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ft_putnchr(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp ugt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = call i32 @write(i32 1, i8* %3, i32 1)
%10 = load i32, i32* %4
%11 = add i32 %10, -1
store i32 %11, i32* %4
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_putnchr(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = call i32 @write(i32 1, i8* %3, i32 1)
%8 = add i32 %6, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
double check1(double x) { return __builtin_copysign(x, 1.0); }


x86 assembly (clang, -O0):
<check1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<check1>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @check1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.copysign.f64(double %3, double 1.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @check1(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
void pp_soft_wdt_feed(void) {}


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

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

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

LLVM IR (-O2):
define void @pp_soft_wdt_feed() {
ret void
}
/* Variables and functions */
double float_sum(float, float);
int int_sum(int, int);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  int i = 1, j = 2;
  float f1 = 1.23, f2 = 2.34;
  printf("sum1: %d\n", int_sum(i, j));
  printf("sum2: %f\n", float_sum(f1, f2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movss  0xeaf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe9e(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <int_sum@plt>
cvtsi2sd %eax,%xmm0
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1050 <float_sum@plt>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <int_sum@plt>
cvtsi2sd %eax,%xmm0
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movss  0xea8(%rip),%xmm0
movss  0xea4(%rip),%xmm1
call   1050 <float_sum@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"sum1: %d\0A\00"
@.str.1 = [10 x i8] c"sum2: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store float 0x3FF3AE1480000000, float* %4
store float 0x4002B851E0000000, float* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @int_sum(i32 %6, i32 %7)
%9 = sitofp i32 %8 to double
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %9)
%11 = load float, float* %4
%12 = load float, float* %5
%13 = call double @float_sum(float %11, float %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"sum1: %d\0A\00"
@.str.1 = [10 x i8] c"sum2: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @int_sum(i32 1, i32 2)
%2 = sitofp i32 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call double @float_sum(float 0x3FF3AE1480000000, float 0x4002B851E0000000)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}
int main() {
  unsigned long arg = 0x123456789ABCDEF0;
  unsigned long out = 0;
  __asm__("bswapq %%rax" : "=a"(out) : "a"(arg));
  return (out == 0xF0DEBC9A78563412);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movabs $0x123456789abcdef0,%rax
56 34 12
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
bswap  %rax
mov    %rax,-0x18(%rbp)
movabs $0xf0debc9a78563412,%rax
bc de f0
cmp    %rax,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movabs $0x123456789abcdef0,%rax
56 34 12
bswap  %rax
movabs $0xf0debc9a78563412,%rdx
bc de f0
xor    %ecx,%ecx
cmp    %rdx,%rax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 1311768467463790320, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = call i64 asm "bswapq %rax", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, -1090226688147180526
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 asm "bswapq %rax", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i64 1311768467463790320)
%2 = icmp eq i64 %1, -1090226688147180526
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint8_t;
struct blob_buf {
  int dummy;
};
struct blob_attr {
  int dummy;
};

/* Variables and functions */
struct blob_attr *blob_put(struct blob_buf *, int, int /*<<< orphan*/ *, int);
struct blob_attr *blob_put_u8(struct blob_buf *buf, int id, uint8_t val) {
  return blob_put(buf, id, &val, sizeof(val));
}


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

x86 assembly (clang, -O2):
<blob_put_u8>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <blob_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.blob_attr = type { i32 }
%struct.blob_buf = type { i32 }
define %struct.blob_attr* @blob_put_u8(%struct.blob_buf* %0, i32 %1, i32 %2) {
%4 = alloca %struct.blob_buf*
%5 = alloca i32
%6 = alloca i32
store %struct.blob_buf* %0, %struct.blob_buf** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.blob_buf*, %struct.blob_buf** %4
%8 = load i32, i32* %5
%9 = call %struct.blob_attr* @blob_put(%struct.blob_buf* %7, i32 %8, i32* %6, i32 4)
ret %struct.blob_attr* %9
}

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
%struct.blob_buf = type { i32 }
define %struct.blob_attr* @blob_put_u8(%struct.blob_buf* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call %struct.blob_attr* @blob_put(%struct.blob_buf* %0, i32 %1, i32* %4, i32 4)
ret %struct.blob_attr* %5
}
/* Variables and functions */
int /*<<< orphan*/ end();
int /*<<< orphan*/ func1();
int /*<<< orphan*/ func2();
int main(void) {
  int i;
  func1();
  for (i = 0; i < 10000; i++) {
    func2();
  }
  end();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <func1@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    116f <main+0x3f>
mov    $0x0,%al
call   1050 <func2@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
mov    $0x0,%al
call   1040 <end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <func1@plt>
mov    $0x2710,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1050 <func2@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
call   1040 <end@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @func1()
store i32 0, i32* %2
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 (...) @func2()
br label %9
9: ; preds = %7
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = call i32 (...) @end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @func2()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 10000
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (...) @end()
ret i32 0
}
void fldcw_rounding(void) {
  asm(" pushw $0x077F ; fldcw (%esp) ; addl $2, %esp");
}


x86 assembly (clang, -O0):
<fldcw_rounding>:
push   %rbp
mov    %rsp,%rbp
pushw  $0x77f
fldcw  (%esp)
add    $0x2,%esp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fldcw_rounding>:
pushw  $0x77f
fldcw  (%esp)
add    $0x2,%esp
ret

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

LLVM IR (-O2):
define void @fldcw_rounding() {
tail call void asm sideeffect " pushw $$0x077F ; fldcw (%esp) ; addl $$2, %esp", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
bool IsWhitespace(char C) {
  bool Result = C == ' ' || C == '\t' || C == '\n' || C == '\r' || C == 'f';
  return Result;
}


x86 assembly (clang, -O0):
<IsWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     115f <IsWhitespace+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     115f <IsWhitespace+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     115f <IsWhitespace+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     115f <IsWhitespace+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsWhitespace>:
cmp    $0x20,%dil
ja     1120 <IsWhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <IsWhitespace+0x20>
ret
xor    %eax,%eax
cmp    $0x66,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @IsWhitespace(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 13
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 102
br label %23
23: ; preds = %19, %15, %11, %7, %1
%24 = phi i1 [ true, %15 ], [ true, %11 ], [ true, %7 ], [ true, %1 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @IsWhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 102
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
scalar_t__ alloca(int);
int /*<<< orphan*/ test10a(char *);
void __attribute__((no)) __attribute__((noclone)) test10(void) {
  char *save = (char *)alloca(4);
  test10a(save);
}


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <test10a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
push   %rax
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <test10a@plt>

LLVM IR (-O0):
define void @test10() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @test10a(i8* %4)
ret void
}

LLVM IR (-O2):
define void @test10() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @test10a(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void reservaSopaLetras() {
  printf("Reserva memoria para una sopa de letras\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Reserva memoria para una sopa de letras\0A\00"
define void @reservaSopaLetras() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Reserva memoria para una sopa de letras\00"
define void @reservaSopaLetras() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
double metresToCentimetres(double metres) { return metres * 100.0; }


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

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

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

LLVM IR (-O2):
define double @metresToCentimetres(double %0) {
%2 = fmul double %0, 1.000000e+02
ret double %2
}
/* Variables and functions */
int input_socket();
unsigned get_socket() { return input_socket(); }


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

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

LLVM IR (-O0):
define i32 @get_socket() {
%1 = call i32 (...) @input_socket()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_socket() {
%1 = tail call i32 (...) @input_socket()
ret i32 %1
}
int fib(int param1) {
  int eax;
  int eax_1;
  int local4;
  if (param1 <= 1) {
    local4 = param1;
  } else {
    eax_1 = fib(param1 - 1);
    eax = fib(param1 - 2);
    local4 = eax_1 + eax;
  }
  return local4;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     1130 <fib+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <fib+0x45>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_c0_set_0(uint8_t value) { return value | 0x01; }


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

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

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

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

/* Variables and functions */
size_t str_rindex(char const *, char *);
size_t u_char_to_u(int /*<<< orphan*/, char *);
size_t u_char_rindex(const char *str, uint32_t c) {
  char ch[7];
  ch[u_char_to_u(c, ch)] = '\0';
  return str_rindex(str, ch);
}


x86 assembly (clang, -O0):
<u_char_rindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x13(%rbp),%rsi
call   1040 <u_char_to_u@plt>
movb   $0x0,-0x13(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1030 <str_rindex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_char_rindex>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x1(%rsp),%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1040 <u_char_to_u@plt>
movb   $0x0,0x1(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <str_rindex@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @u_char_rindex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [7 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%8 = call i64 @u_char_to_u(i32 %6, i8* %7)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 %8
store i8 0, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%12 = call i64 @str_rindex(i8* %10, i8* %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @u_char_rindex(i8* %0, i32 %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = call i64 @u_char_to_u(i32 %1, i8* %4)
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 %5
store i8 0, i8* %6
%7 = call i64 @str_rindex(i8* %0, i8* %4)
ret i64 %7
}
unsigned long LPCWordRead(unsigned long ulBase, unsigned long ulOffset) {
  ;
  ;

  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000400 + ulOffset))));
}


x86 assembly (clang, -O0):
<LPCWordRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x400,%rax
add    -0x10(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCWordRead>:
mov    0x400(%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @LPCWordRead(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 1024
%7 = load i64, i64* %4
%8 = add i64 %6, %7
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @LPCWordRead(i64 %0, i64 %1) {
%3 = add i64 %0, 1024
%4 = add i64 %3, %1
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ADCSequenceDMADisable(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) &=
      ~(0x100 << ui32SequenceNum);
}


x86 assembly (clang, -O0):
<ADCSequenceDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x100,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceDMADisable>:
mov    %esi,%ecx
mov    $0x100,%eax
shl    %cl,%eax
not    %eax
movslq %edi,%rcx
and    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @ADCSequenceDMADisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 256, %5
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 0
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, %7
store volatile i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @ADCSequenceDMADisable(i32 %0, i32 %1) {
%3 = shl i32 256, %1
%4 = xor i32 %3, -1
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, %4
store volatile i32 %8, i32* %6
ret void
}
/* Variables and functions */
char *ckmalloc(scalar_t__);
scalar_t__ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *savestr(const char *s) {
  char *p;
  p = ckmalloc(strlen(s) + 1);
  ((void)strcpy(p, s));
  return p;
}


x86 assembly (clang, -O0):
<savestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <ckmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <ckmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @savestr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @ckmalloc(i64 %3)
%5 = tail call i64 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ write(int, int *, int);
int main(void) {
  int fd;
  int val = 0x45;
  fd = open("/dev/my_drv", O_RDWR);
  if (fd < 0) {
    printf("open error fd:%d\n", fd);
  }
  write(fd, &val, 16);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x45,-0xc(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1177 <main+0x47>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x45,0xc(%rsp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1166 <main+0x36>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x10,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/my_drv\00"
@O_RDWR = global i32 0
@.str.1 = [18 x i8] c"open error fd:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 69, i32* %3
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %0
%12 = load i32, i32* %2
%13 = call i32 @write(i32 %12, i32* %3, i32 16)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/my_drv\00"
@O_RDWR = global i32 0
@.str.1 = [18 x i8] c"open error fd:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 69, i32* %1
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %6, %0
%9 = call i32 @write(i32 %4, i32* %1, i32 16)
ret i32 0
}
/* Variables and functions */
int log(int);
float Mel(int k, float fres) { return 1127 * log(1 + (k - 1) * fres); }


x86 assembly (clang, -O0):
<Mel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec5(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <log@plt>
imul   $0x467,%eax,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mel>:
push   %rax
add    $0xffffffff,%edi
cvtsi2ss %edi,%xmm1
mulss  %xmm0,%xmm1
addss  0xedc(%rip),%xmm1
cvttss2si %xmm1,%edi
call   1030 <log@plt>
imul   $0x467,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Mel(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
%7 = sitofp i32 %6 to float
%8 = load float, float* %4
%9 = call float @llvm.fmuladd.f32(float %7, float %8, float 1.000000e+00)
%10 = fptosi float %9 to i32
%11 = call i32 @log(i32 %10)
%12 = mul nsw i32 1127, %11
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @Mel(i32 %0, float %1) {
%3 = add nsw i32 %0, -1
%4 = sitofp i32 %3 to float
%5 = tail call float @llvm.fmuladd.f32(float %4, float %1, float 1.000000e+00)
%6 = fptosi float %5 to i32
%7 = tail call i32 @log(i32 %6)
%8 = mul nsw i32 %7, 1127
%9 = sitofp i32 %8 to float
ret float %9
}
void die_if_kernel(char *str, struct pt_regs *regs, long err) { return; }


x86 assembly (clang, -O0):
<die_if_kernel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pt_regs = type opaque
define void @die_if_kernel(i8* %0, %struct.pt_regs* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca %struct.pt_regs*
%6 = alloca i64
store i8* %0, i8** %4
store %struct.pt_regs* %1, %struct.pt_regs** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @die_if_kernel(i8* nocapture %0, %struct.pt_regs* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int a, b;
  int r;
  r = scanf("%d %d", &a, &b);
  printf("%d\n", a + b);
  a += r;
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ deslash(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *x = "kala";
  deslash(x);
  printf("%s", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <deslash@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"kala\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @deslash(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double check(double x, double y) { return __builtin_copysign(x, y); }


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @check(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* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @check(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ pthread_sigmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void block_signal(int signum, sigset_t *old) {
  sigset_t set;
  sigemptyset(&set);
  sigaddset(&set, signum);
  pthread_sigmask(SIG_BLOCK, &set, old);
}


x86 assembly (clang, -O0):
<block_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rsi
call   1040 <pthread_sigmask@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_signal>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <sigaddset@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define void @block_signal(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = call i32 @sigemptyset(i32* %5)
%7 = load i32, i32* %3
%8 = call i32 @sigaddset(i32* %5, i32 %7)
%9 = load i32, i32* @SIG_BLOCK
%10 = load i32*, i32** %4
%11 = call i32 @pthread_sigmask(i32 %9, i32* %5, i32* %10)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define void @block_signal(i32 %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sigemptyset(i32* %3)
%6 = call i32 @sigaddset(i32* %3, i32 %0)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @pthread_sigmask(i32 %7, i32* %3, i32* %1)
ret void
}
void lf3(void) {}


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

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

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

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