xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int is_sw_interrupt(uint32_t op) {
  return !((op & 0x0F000000) ^ 0x0F000000);
}


x86 assembly (clang, -O0):
<is_sw_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf000000,%eax
xor    $0xf000000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sw_interrupt>:
not    %edi
xor    %eax,%eax
test   $0xf000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_sw_interrupt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 251658240
%5 = xor i32 %4, 251658240
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_sw_interrupt(i32 %0) {
%2 = and i32 %0, 251658240
%3 = icmp eq i32 %2, 251658240
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void version() {
  printf("%s -- version %s\nWritten by %s\n\n%s comes with ABSOLUTELY NO "
         "WARRANTY.  This is free software, and you\nare welcome to "
         "redistribute it under certain conditions.  See the GNU\nGeneral "
         "Public Licence for details.\n",
         "runguard",
         "3"
         "/"
         "3.3",
         "Jaap Eldering", "runguard");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf9f(%rip),%r8
lea    0xfa1(%rip),%rdx
lea    0xfa0(%rip),%rcx
mov    %r8,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xfab(%rip),%rdx
lea    0xfaa(%rip),%rcx
lea    0xf94(%rip),%rsi
mov    %rsi,%r8
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [209 x i8] c"%s -- version %s\0AWritten by %s\0A\0A%s comes with ABSOLUTELY NO WARRANTY. This is free software, and you\0Aare welcome to redistribute it under certain conditions. See the GNU\0AGeneral Public Licence for details.\0A\00"
@.str.1 = [9 x i8] c"runguard\00"
@.str.2 = [6 x i8] c"3/3.3\00"
@.str.3 = [14 x i8] c"Jaap Eldering\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [209 x i8] c"%s -- version %s\0AWritten by %s\0A\0A%s comes with ABSOLUTELY NO WARRANTY. This is free software, and you\0Aare welcome to redistribute it under certain conditions. See the GNU\0AGeneral Public Licence for details.\0A\00"
@.str.1 = [9 x i8] c"runguard\00"
@.str.2 = [6 x i8] c"3/3.3\00"
@.str.3 = [14 x i8] c"Jaap Eldering\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct lframe {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lframe *machine_add_pause(struct lemon *);
struct lframe *lemon_machine_add_pause(struct lemon *lemon) {
  return machine_add_pause(lemon);
}


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

x86 assembly (clang, -O2):
<lemon_machine_add_pause>:
jmp    1030 <machine_add_pause@plt>

LLVM IR (-O0):
%struct.lframe = type { i32 }
%struct.lemon = type { i32 }
define %struct.lframe* @lemon_machine_add_pause(%struct.lemon* %0) {
%2 = alloca %struct.lemon*
store %struct.lemon* %0, %struct.lemon** %2
%3 = load %struct.lemon*, %struct.lemon** %2
%4 = call %struct.lframe* @machine_add_pause(%struct.lemon* %3)
ret %struct.lframe* %4
}

LLVM IR (-O2):
%struct.lframe = type { i32 }
%struct.lemon = type { i32 }
define %struct.lframe* @lemon_machine_add_pause(%struct.lemon* %0) {
%2 = tail call %struct.lframe* @machine_add_pause(%struct.lemon* %0)
ret %struct.lframe* %2
}
void smpboot_clear_io_apic_irqs(void) {}


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

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

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

LLVM IR (-O2):
define void @smpboot_clear_io_apic_irqs() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t getArrayL(int64_t *arr, int idx) { return arr[idx]; }


x86 assembly (clang, -O0):
<getArrayL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArrayL>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getArrayL(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getArrayL(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
double func(double a, double b) {
  double sol;
  sol = (a - b) / (a * b);
  return sol;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @func(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = fdiv double %8, %11
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @func(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fmul double %0, %1
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M250_f(char *s) {
  debug("M250_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M250_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M250_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M250_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M250_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M250_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M250_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void clear_entire_screen() { fputs("\033[2J", stdout); }


x86 assembly (clang, -O0):
<clear_entire_screen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_entire_screen>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define void @clear_entire_screen() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define void @clear_entire_screen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void con(char *name, int type, void *arg) {
  printf("conflict detected %d:%s, arg %s\n", type, name, arg);
}


x86 assembly (clang, -O0):
<con>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con>:
mov    %rdx,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"conflict detected %d:%s, arg %s\0A\00"
define void @con(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"conflict detected %d:%s, arg %s\0A\00"
define void @con(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0, i8* %2)
ret void
}
void Convert16To8Plane() {}


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

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

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

LLVM IR (-O2):
define void @Convert16To8Plane() {
ret void
}
int is_leap_year(unsigned int year) {
  if (!year)
    return 0;
  else if (!(year % 400))
    return 1;
  else if (!(year % 100))
    return 0;
  else if (!(year % 4))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <is_leap_year+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1181 <is_leap_year+0x81>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    113e <is_leap_year+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1181 <is_leap_year+0x81>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    115f <is_leap_year+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1181 <is_leap_year+0x81>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    117a <is_leap_year+0x7a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <is_leap_year+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   %edi,%edi
je     112d <is_leap_year+0x2d>
imul   $0xc28f5c29,%edi,%ecx
mov    %ecx,%edx
ror    $0x4,%edx
cmp    $0xa3d70b,%edx
jb     112e <is_leap_year+0x2e>
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
jb     112d <is_leap_year+0x2d>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = urem i32 %0, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = urem i32 %0, 100
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = and i32 %0, 3
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %6 ], [ %12, %9 ]
ret i32 %14
}
double df(double x) { return 9 * x * x - 2; }


x86 assembly (clang, -O0):
<df>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @df(double %0) {
%2 = fmul double %0, 9.000000e+00
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double -2.000000e+00)
ret double %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cut_strcmp(const char *str1, const char *str2) {
  if (str1 == NULL || str2 == NULL) {
    return str1 == str2;
  }
  return strcmp(str1, str2);
}


x86 assembly (clang, -O0):
<cut_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <cut_strcmp+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    114e <cut_strcmp+0x3e>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <cut_strcmp+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cut_strcmp>:
test   %rdi,%rdi
je     111f <cut_strcmp+0xf>
test   %rsi,%rsi
je     111f <cut_strcmp+0xf>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @cut_strcmp(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 eq i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %8, %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = icmp eq i8* %12, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
br label %20
16: ; preds = %8
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @strcmp(i8* %17, i8* %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @cut_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = icmp eq i8* %0, %1
%8 = zext i1 %7 to i32
br label %11
9: ; preds = %2
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void copy_dvec(int n, double *dest, double *p) {
  memcpy(dest, p, n * sizeof(double));
}


x86 assembly (clang, -O0):
<copy_dvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dvec>:
lea    0x0(,%rdi,8),%eax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_dvec(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double*, double** %6
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(double* %7, double* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @copy_dvec(i32 %0, double* %1, double* %2) {
%4 = shl i32 %0, 3
%5 = tail call i32 @memcpy(double* %1, double* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bgCyan(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmBgCyan(char *str) { printColor(bgCyan(str)); }


x86 assembly (clang, -O0):
<cmBgCyan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bgCyan@plt>
mov    %eax,%edi
call   1030 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmBgCyan>:
push   %rax
call   1040 <bgCyan@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <printColor@plt>

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

LLVM IR (-O2):
define void @cmBgCyan(i8* %0) {
%2 = tail call i32 @bgCyan(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CMT_DriverIRQHandler();
__attribute__((weak)) void CMT_IRQHandler(void) { CMT_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @CMT_IRQHandler() {
%1 = tail call i32 (...) @CMT_DriverIRQHandler()
ret void
}
/* Variables and functions */
int get_code_lenght(char const *);
int is_length_valid(const char *code, int length) {
  return (get_code_lenght(code) == length);
}


x86 assembly (clang, -O0):
<is_length_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_code_lenght@plt>
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_length_valid>:
push   %rbx
mov    %esi,%ebx
call   1030 <get_code_lenght@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_length_valid(i8* %0, i32 %1) {
%3 = tail call i32 @get_code_lenght(i8* %0)
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int get_cursor();
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ set_cursor(int);
void remove_last_char() {
  int offset = get_cursor();
  set_cursor(offset - 2);
  print(" ");
  set_cursor(offset - 2);
}


x86 assembly (clang, -O0):
<remove_last_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_cursor@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1050 <set_cursor@plt>
lea    0xeac(%rip),%rdi
call   1040 <print@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1050 <set_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_last_char>:
push   %rbx
xor    %eax,%eax
call   1030 <get_cursor@plt>
lea    -0x2(%rax),%ebx
mov    %ebx,%edi
call   1050 <set_cursor@plt>
lea    0xeb7(%rip),%rdi
call   1040 <print@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <set_cursor@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @remove_last_char() {
%1 = alloca i32
%2 = call i32 (...) @get_cursor()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sub nsw i32 %3, 2
%5 = call i32 @set_cursor(i32 %4)
%6 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = sub nsw i32 %7, 2
%9 = call i32 @set_cursor(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @remove_last_char() {
%1 = tail call i32 (...) @get_cursor()
%2 = add nsw i32 %1, -2
%3 = tail call i32 @set_cursor(i32 %2)
%4 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @set_cursor(i32 %2)
ret void
}
void walkAhead() {}


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

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

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

LLVM IR (-O2):
define void @walkAhead() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_IntRegister(int, void (*)());
void stub1(uint32_t);
void WatchdogIntRegister(void (*pfnHandler)(void)) {
  NOROM_IntRegister(30, pfnHandler);
  ((void (*)(uint32_t ui32Interrupt))(
      (uint32_t *)(((uint32_t *)0x10000180)[12]))[4])(30);
}


x86 assembly (clang, -O0):
<WatchdogIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1e,%edi
call   1030 <NOROM_IntRegister@plt>
mov    $0x10000180,%eax
mov    0x60(%rax),%rax
mov    $0x1e,%edi
call   *0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntRegister>:
push   %rax
mov    %rdi,%rsi
mov    $0x1e,%edi
call   1030 <NOROM_IntRegister@plt>
mov    0x100001e0,%rax
10
mov    $0x1e,%edi
pop    %rcx
jmp    *0x20(%rax)

LLVM IR (-O0):
define void @WatchdogIntRegister(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @NOROM_IntRegister(i32 30, void (...)* %4)
%6 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 268435840 to i64*), i64 12)
%7 = inttoptr i64 %6 to i64*
%8 = getelementptr inbounds i64, i64* %7, i64 4
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to void (i64)*
ret void
}

LLVM IR (-O2):
define void @WatchdogIntRegister(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @NOROM_IntRegister(i32 30, void (...)* %2)
%4 = load i64, i64* inttoptr (i64 268435936 to i64*)
%5 = inttoptr i64 %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 4
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to void (i64)*
tail call void %8(i64 30)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ n32016_init();
void copro_32016_poweron_reset() { n32016_init(); }


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

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

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

LLVM IR (-O2):
define void @copro_32016_poweron_reset() {
%1 = tail call i32 (...) @n32016_init()
ret void
}
int main() { return 7 + 5; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 12
}
/* Variables and functions */
int abc();
int /*<<< orphan*/ printf(char *, int);
main() {
  int a;
  a = abc();
  printf("\n %d this is fisrt a:", a);
  a = abc();
  printf("\n %d this is second a:", a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <abc@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <abc@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0A %d this is fisrt a:\00"
@.str.1 = [23 x i8] c"\0A %d this is second a:\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @abc()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @abc()
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0A %d this is fisrt a:\00"
@.str.1 = [23 x i8] c"\0A %d this is second a:\00"
define i32 @main() {
%1 = tail call i32 (...) @abc()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abc()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int testOpenFile(const char *filePath) {
  FILE *tmpFile = fopen(filePath, "r");
  if (tmpFile == NULL) {
    return 1;
  }
  fclose(tmpFile);
  return 0;
}


x86 assembly (clang, -O0):
<testOpenFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <testOpenFile+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1167 <testOpenFile+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testOpenFile>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113e <testOpenFile+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @testOpenFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %13
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i32 @fclose(i32* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @testOpenFile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void tft_fill(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint16_t color) {
  (void)x;
  (void)y;
  (void)w;
  (void)h;
  (void)color;
}


x86 assembly (clang, -O0):
<tft_fill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tft_fill(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
void f_delay(int tenth_sec) {
  clock_t start_t, end_t;
  long int i;
  start_t = clock();
  do {
    for (i = 0; i < 10000000; i++)
      ;
    end_t = clock();
  } while ((end_t - start_t) < (tenth_sec * CLOCKS_PER_SEC) / 2);
  return;
}


x86 assembly (clang, -O0):
<f_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x989680,-0x18(%rbp)
jge    1151 <f_delay+0x41>
jmp    1140 <f_delay+0x30>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112d <f_delay+0x1d>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e7a(%rip),%rcx
imul   (%rcx),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jl     1125 <f_delay+0x15>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_delay>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebp
mov    0x2ec2(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
sub    %ebp,%eax
mov    (%r14),%ecx
imul   %ebx,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
cmp    %edx,%eax
jl     1130 <f_delay+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @f_delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %2
%6 = call i32 (...) @clock()
store i32 %6, i32* %3
br label %7
7: ; preds = %17, %1
store i64 0, i64* %5
br label %8
8: ; preds = %12, %7
%9 = load i64, i64* %5
%10 = icmp slt i64 %9, 10000000
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i64, i64* %5
%14 = add nsw i64 %13, 1
store i64 %14, i64* %5
br label %8
15: ; preds = %8
%16 = call i32 (...) @clock()
store i32 %16, i32* %4
br label %17
17: ; preds = %15
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = sub nsw i32 %18, %19
%21 = load i32, i32* %2
%22 = load i32, i32* @CLOCKS_PER_SEC
%23 = mul nsw i32 %21, %22
%24 = sdiv i32 %23, 2
%25 = icmp slt i32 %20, %24
br i1 %25, label %7, label %26
26: ; preds = %17
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @f_delay(i32 %0) {
%2 = tail call i32 (...) @clock()
br label %3
3: ; preds = %3, %1
%4 = tail call i32 (...) @clock()
%5 = sub nsw i32 %4, %2
%6 = load i32, i32* @CLOCKS_PER_SEC
%7 = mul nsw i32 %6, %0
%8 = sdiv i32 %7, 2
%9 = icmp slt i32 %5, %8
br i1 %9, label %3, label %10
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello, world\a"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world\07\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world\07\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
bool is_alpha(char c) {
  return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_alpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_alpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void UARTCharPut(unsigned long ulBase, unsigned char ucData) {
  ;
  while (!((*((volatile unsigned long *)(ulBase + 0x00000000))) & 0x00000080)) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = ucData;
}


x86 assembly (clang, -O0):
<UARTCharPut>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x80,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1131 <UARTCharPut+0x31>
jmp    1136 <UARTCharPut+0x36>
jmp    110e <UARTCharPut+0xe>
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPut>:
testq  $0x80,(%rdi)
je     1100 <UARTCharPut>
movzbl %sil,%eax
mov    %rax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @UARTCharPut(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
br label %5
5: ; preds = %13, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 128
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i8, i8* %4
%16 = zext i8 %15 to i64
%17 = load i64, i64* %3
%18 = add i64 %17, 4
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}

LLVM IR (-O2):
define void @UARTCharPut(i64 %0, i8 zeroext %1) {
%3 = inttoptr i64 %0 to i64*
br label %4
4: ; preds = %4, %2
%5 = load volatile i64, i64* %3
%6 = and i64 %5, 128
%7 = icmp eq i64 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = zext i8 %1 to i64
%10 = add i64 %0, 4
%11 = inttoptr i64 %10 to i64*
store volatile i64 %9, i64* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite_base32hex(char *, int, int /*<<< orphan*/ *);
int set_val(void *ctx, char *val, int vallen) {
  FILE *fp = ctx;
  fwrite_base32hex(val, vallen, fp);
  fputc(',', fp);
  return 0;
}


x86 assembly (clang, -O0):
<set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fwrite_base32hex@plt>
mov    -0x20(%rbp),%rsi
mov    $0x2c,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_val>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rbx,%rdx
call   1040 <fwrite_base32hex@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @set_val(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite_base32hex(i8* %10, i32 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fputc(i8 signext 44, i32* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @set_val(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite_base32hex(i8* %1, i32 %2, i32* %4)
%6 = tail call i32 @fputc(i8 signext 44, i32* %4)
ret i32 0
}
/* Variables and functions */
char *strpbrk(char *, char const *);
char *xstrsep(char **stringp, const char *delim) {
  char *ret = *stringp;
  if (ret == NULL)
    return NULL;
  if ((*stringp = strpbrk(*stringp, delim)) != NULL)
    *((*stringp)++) = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<xstrsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <xstrsep+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1180 <xstrsep+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     1178 <xstrsep+0x68>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrsep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     113c <xstrsep+0x2c>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strpbrk@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     113c <xstrsep+0x2c>
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,(%r14)
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xstrsep(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i8* @strpbrk(i8* %3, i8* %1)
store i8* %6, i8** %0
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %9, i8** %0
store i8 0, i8* %6
br label %10
10: ; preds = %5, %8, %2
ret i8* %3
}
int min3(int val1, int val2, int val3) {
  int out = val1;
  if (out > val2)
    out = val2;
  if (out > val3)
    out = val3;
  return out;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1125 <min3+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1137 <min3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Type definitions */
struct AMCMemPool {
  int dummy;
};

/* Variables and functions */
int _memPool_Destory(struct AMCMemPool *);
int AMCMemPool_Destory(struct AMCMemPool *pool) {
  return _memPool_Destory(pool);
}


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

x86 assembly (clang, -O2):
<AMCMemPool_Destory>:
jmp    1030 <_memPool_Destory@plt>

LLVM IR (-O0):
%struct.AMCMemPool = type { i32 }
define i32 @AMCMemPool_Destory(%struct.AMCMemPool* %0) {
%2 = alloca %struct.AMCMemPool*
store %struct.AMCMemPool* %0, %struct.AMCMemPool** %2
%3 = load %struct.AMCMemPool*, %struct.AMCMemPool** %2
%4 = call i32 @_memPool_Destory(%struct.AMCMemPool* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.AMCMemPool = type { i32 }
define i32 @AMCMemPool_Destory(%struct.AMCMemPool* %0) {
%2 = tail call i32 @_memPool_Destory(%struct.AMCMemPool* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
void userlevel_syscall(void) {
  int i;
  for (i = 0; i < 10000; i++) {
    syscall(SYS_gettid);
  }
}


x86 assembly (clang, -O0):
<userlevel_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    1148 <userlevel_syscall+0x38>
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <userlevel_syscall+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userlevel_syscall>:
push   %r14
push   %rbx
push   %rax
mov    $0x2710,%ebx
mov    0x2ec8(%rip),%r14
mov    (%r14),%edi
call   1030 <syscall@plt>
add    $0xffffffff,%ebx
jne    1120 <userlevel_syscall+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SYS_gettid = global i32 0
define void @userlevel_syscall() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10000
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* @SYS_gettid
%7 = call i32 @syscall(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define void @userlevel_syscall() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = load i32, i32* @SYS_gettid
%4 = tail call i32 @syscall(i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 10000
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
int proposal_best(double newscore, double oldscore, double temp) {
  if (newscore > oldscore) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<proposal_best>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112f <proposal_best+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <proposal_best+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proposal_best>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

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

LLVM IR (-O2):
define i32 @proposal_best(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}