xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xselection_display(void *_p, void *_v) {
  ((XEvent *)_p)->xselection.display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xselection_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xselection_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
int is_contain_other_char(const char *phoneNumber) {
  int i;
  int flag = 0;
  for (i = 0; phoneNumber[i] != '\0'; i++) {
    if (phoneNumber[i] < '0' || phoneNumber[i] > '9') {
      flag = 1;
      break;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<is_contain_other_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1174 <is_contain_other_char+0x74>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     1155 <is_contain_other_char+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    1161 <is_contain_other_char+0x61>
movl   $0x1,-0x10(%rbp)
jmp    1174 <is_contain_other_char+0x74>
jmp    1166 <is_contain_other_char+0x66>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <is_contain_other_char+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_contain_other_char>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1123 <is_contain_other_char+0x23>
add    $0x1,%rdi
nopl   0x0(%rax)
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1124 <is_contain_other_char+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <is_contain_other_char+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_contain_other_char(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -58
%12 = icmp ult i8 %11, -10
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %4, %8, %1
%15 = phi i32 [ 0, %1 ], [ 1, %8 ], [ 0, %4 ]
ret i32 %15
}
/* Type definitions */
struct compat_semaphore {
  int dummy;
};

/* Variables and functions */
int compat_sem_is_locked(struct compat_semaphore *);
int sem_is_locked(struct compat_semaphore *sem) {
  return compat_sem_is_locked(sem);
}


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

x86 assembly (clang, -O2):
<sem_is_locked>:
jmp    1030 <compat_sem_is_locked@plt>

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

LLVM IR (-O2):
%struct.compat_semaphore = type { i32 }
define i32 @sem_is_locked(%struct.compat_semaphore* %0) {
%2 = tail call i32 @compat_sem_is_locked(%struct.compat_semaphore* %0)
ret i32 %2
}
main() {
  char x[] = "123";
  char y[sizeof x];
  _Static_assert(sizeof y == 4, "bad size");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.x = [4 x i8] c"123\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int espalhar(int entrada) { return (entrada % 100); }


x86 assembly (clang, -O0):
<espalhar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<espalhar>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @espalhar(i32 %0) {
%2 = srem i32 %0, 100
ret i32 %2
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int a_strcasecmp(const char *a, const char *b) {
  return strcasecmp((a ? a : ""), (b ? b : ""));
}


x86 assembly (clang, -O0):
<a_strcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <a_strcasecmp+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <a_strcasecmp+0x38>
lea    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <a_strcasecmp+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <a_strcasecmp+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <a_strcasecmp+0x68>
lea    0xe91(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <a_strcasecmp+0x68>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcasecmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_strcasecmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @a_strcasecmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %9 ]
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i8*, i8** %4
br label %17
16: ; preds = %10
br label %17
17: ; preds = %16, %14
%18 = phi i8* [ %15, %14 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %16 ]
%19 = call i32 @strcasecmp(i8* %11, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @a_strcasecmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%7 = tail call i32 @strcasecmp(i8* %4, i8* %6)
ret i32 %7
}
void disable_interrupts() { __asm__ volatile("cli;nop"); }


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

x86 assembly (clang, -O2):
<disable_interrupts>:
cli
nop
ret

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

LLVM IR (-O2):
define void @disable_interrupts() {
tail call void asm sideeffect "cli;nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvCancelNextFrame(char byBoardNum) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvCancelNextFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvCancelNextFrame(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvCancelNextFrame(i8 signext %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *,
                           char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
                "usage: hexdump [-bcCdovx] [-e fmt] [-f fmt_file] [-n length]",
                "               [-s skip] [file ...]",
                "       hd      [-bcdovx]  [-e fmt] [-f fmt_file] [-n length]",
                "               [-s skip] [file ...]");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xf08(%rip),%r9
lea    0xf25(%rip),%r8
mov    %r9,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xed5(%rip),%rdx
lea    0xf2f(%rip),%r8
lea    0xf04(%rip),%rcx
mov    %rcx,%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [61 x i8] c"usage: hexdump [-bcCdovx] [-e fmt] [-f fmt_file] [-n length]\00"
@.str.2 = [36 x i8] c" [-s skip] [file ...]\00"
@.str.3 = [61 x i8] c" hd [-bcdovx] [-e fmt] [-f fmt_file] [-n length]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [61 x i8] c"usage: hexdump [-bcCdovx] [-e fmt] [-f fmt_file] [-n length]\00"
@.str.2 = [36 x i8] c" [-s skip] [file ...]\00"
@.str.3 = [61 x i8] c" hd [-bcdovx] [-e fmt] [-f fmt_file] [-n length]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int get_component_name(void *self, char *name) {
  strncpy(name, "{{ long_name }}", (2048));
  return (0);
}


x86 assembly (clang, -O0):
<get_component_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x800,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_component_name>:
push   %rax
mov    %rsi,%rdi
lea    0xee5(%rip),%rsi
mov    $0x800,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"{{ long_name }}\00"
define i32 @get_component_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2048)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"{{ long_name }}\00"
define i32 @get_component_name(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2048)
ret i32 0
}
long long f(long long a, long long b) { return a * b; }


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

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
imul   %rsi,%rax
ret

LLVM IR (-O0):
define i64 @f(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 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @f(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printTableDivider() { printf("--------  ----      ------\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"-------- ---- ------\00"
define void @printTableDivider() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int min(unsigned int a, unsigned int b) { return a <= b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmova  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp ule i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void SetBaud(int _baud) { printf("Baud:%d\r\n", _baud); }


x86 assembly (clang, -O0):
<SetBaud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBaud>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Baud:%d\0D\0A\00"
define void @SetBaud(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Baud:%d\0D\0A\00"
define void @SetBaud(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int aw_bdb_get(void *v_mydb, void *v_txn, int db_rmw, char *keystr, int keylen,
               void *v_ptr_datastr, int *datalen) {
  fatal("BerkeleyDB support not compiled");
  return 0;
}


x86 assembly (clang, -O0):
<aw_bdb_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <fatal@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define i32 @aw_bdb_get(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32* %6, i32** %14
%15 = call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define i32 @aw_bdb_get(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4, i8* nocapture readnone %5, i32* nocapture readnone %6) {
%8 = tail call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double sqrt(double x) {
  if (x < 0.0F) {
    return -1;
  } else {
    double res;
    asm("fsqrt" : "=t"(res) : "0"(x));
    return res;
  }
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1129 <sqrt+0x29>
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114f <sqrt+0x4f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
fsqrt
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1113 <sqrt+0x13>
movsd  0xeee(%rip),%xmm0
ret
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fsqrt
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store double -1.000000e+00, double* %2
br label %12
8: ; preds = %1
%9 = load double, double* %3
%10 = call double asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %9)
store double %10, double* %4
%11 = load double, double* %4
store double %11, double* %2
br label %12
12: ; preds = %8, %7
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ -1.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
int atoi(char *);
int atoi_woffset(char *ptr, int offset) { return atoi(ptr + offset); }


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

x86 assembly (clang, -O2):
<atoi_woffset>:
movslq %esi,%rax
add    %rax,%rdi
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @atoi_woffset(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @atoi(i8* %4)
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t osmo_get2bytes(const uint8_t *a) {
  return (uint16_t)((((uint16_t)a[0]) << 8) + (uint16_t)a[1]);
}


x86 assembly (clang, -O0):
<osmo_get2bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<osmo_get2bytes>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @osmo_get2bytes(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @osmo_get2bytes(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %4, %7
ret i32 %8
}
void newlinespec_unit2OPT_LF() {}


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

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

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

LLVM IR (-O2):
define void @newlinespec_unit2OPT_LF() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ A7_main();
int main() { A7_main(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <A7_main@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @A7_main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @A7_main()
ret i32 0
}
void arch_reset(char mode) {}


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @arch_reset(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ariel_enable() { printf("ARIEL-CLIENT: Library enabled.\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"ARIEL-CLIENT: Library enabled.\0A\00"
define void @ariel_enable() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"ARIEL-CLIENT: Library enabled.\00"
define void @ariel_enable() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void *realloc(void *, size_t);
void *aRealloc_(void *p, size_t size, const char *file, int line,
                const char *func) {
  void *ret;
  ret = realloc(p, size);
  if (ret == NULL) {
    printf("%s:%d: in func %s: realloc error out of memory!\n", file, line,
           func);
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<aRealloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1188 <aRealloc_+0x58>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aRealloc_>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     114b <aRealloc_+0x1b>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"%s:%d: in func %s: realloc error out of memory!\0A\00"
define i8* @aRealloc_(i8* %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %11
%15 = load i8*, i8** %11
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %23
17: ; preds = %5
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = load i8*, i8** %10
%21 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %19, i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %5
%24 = load i8*, i8** %11
ret i8* %24
}

LLVM IR (-O2):
@.str = [49 x i8] c"%s:%d: in func %s: realloc error out of memory!\0A\00"
define noalias i8* @aRealloc_(i8* nocapture %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i8* @realloc(i8* %0, i64 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %4)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret i8* %6
}
short EVM5515_GPIO_init() { return 0; }


x86 assembly (clang, -O0):
<EVM5515_GPIO_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @EVM5515_GPIO_init() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @EVM5515_GPIO_init() {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ B2();
int *func2(int /*<<< orphan*/);
int *A2() { return func2(B2()); }


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

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

LLVM IR (-O0):
define i32* @A2() {
%1 = call i32 (...) @B2()
%2 = call i32* @func2(i32 %1)
ret i32* %2
}

LLVM IR (-O2):
define i32* @A2() {
%1 = tail call i32 (...) @B2()
%2 = tail call i32* @func2(i32 %1)
ret i32* %2
}
long decimal_binary(long n) {
  int rest;
  long bin = 0, i = 1;
  while (n != 0) {
    rest = n % 2;
    n = n / 2;
    bin += (rest * i);
    i *= 10;
  }
  return bin;
}


x86 assembly (clang, -O0):
<decimal_binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1167 <decimal_binary+0x67>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
movslq -0xc(%rbp),%rax
imul   -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
imul   $0xa,-0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <decimal_binary+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_binary>:
test   %rdi,%rdi
je     1146 <decimal_binary+0x46>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rdi,%rdx
shr    $0x3f,%rdx
add    %rdi,%rdx
mov    %rdx,%r8
sar    %r8
and    $0xfffffffffffffffe,%rdx
mov    %rdi,%rsi
sub    %rdx,%rsi
imul   %rcx,%rsi
add    %rsi,%rax
add    %rcx,%rcx
lea    (%rcx,%rcx,4),%rcx
add    $0x1,%rdi
cmp    $0x2,%rdi
mov    %r8,%rdi
ja     1110 <decimal_binary+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @decimal_binary(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 1, %1 ]
%5 = phi i64 [ %10, %3 ], [ 0, %1 ]
%6 = phi i64 [ %8, %3 ], [ %0, %1 ]
%7 = srem i64 %6, 2
%8 = sdiv i64 %6, 2
%9 = mul nsw i64 %4, %7
%10 = add nsw i64 %9, %5
%11 = mul nsw i64 %4, 10
%12 = add i64 %6, 1
%13 = icmp ult i64 %12, 3
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i64 [ 0, %1 ], [ %10, %3 ]
ret i64 %15
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int tv_sec;
  int tv_usec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
int cputime() {
  struct rusage rus;
  getrusage(0, &rus);
  return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<cputime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrusage@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputime>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <getrusage@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
define i32 @cputime() {
%1 = alloca %struct.rusage
%2 = call i32 @getrusage(i32 0, %struct.rusage* %1)
%3 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%4 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
define i32 @cputime() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = call i32 @getrusage(i32 0, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
int hboot_dpm_is_bootsource_dpm(unsigned long ulBootSource
                                __attribute__((unused))) {
  int iResult;
  iResult = 0;
  return iResult;
}


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

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

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

LLVM IR (-O2):
define i32 @hboot_dpm_is_bootsource_dpm(i64 %0) {
ret i32 0
}
void set_bg_matrix(int a, int b, int c, int d) {
  (*(short *)0x4000020) = a;
  (*(short *)0x4000022) = b;
  (*(short *)0x4000024) = c;
  (*(short *)0x4000026) = d;
}


x86 assembly (clang, -O0):
<set_bg_matrix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,%cx
mov    $0x4000020,%eax
mov    %cx,(%rax)
mov    -0x8(%rbp),%eax
mov    %ax,%cx
mov    $0x4000022,%eax
mov    %cx,(%rax)
mov    -0xc(%rbp),%eax
mov    %ax,%cx
mov    $0x4000024,%eax
mov    %cx,(%rax)
mov    -0x10(%rbp),%eax
mov    %ax,%cx
mov    $0x4000026,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bg_matrix>:
mov    %di,0x4000020
04
mov    %si,0x4000022
04
mov    %dx,0x4000024
04
mov    %cx,0x4000026
04
ret

LLVM IR (-O0):
define void @set_bg_matrix(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = trunc i32 %9 to i16
store i16 %10, i16* inttoptr (i64 67108896 to i16*)
%11 = load i32, i32* %6
%12 = trunc i32 %11 to i16
store i16 %12, i16* inttoptr (i64 67108898 to i16*)
%13 = load i32, i32* %7
%14 = trunc i32 %13 to i16
store i16 %14, i16* inttoptr (i64 67108900 to i16*)
%15 = load i32, i32* %8
%16 = trunc i32 %15 to i16
store i16 %16, i16* inttoptr (i64 67108902 to i16*)
ret void
}

LLVM IR (-O2):
define void @set_bg_matrix(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = trunc i32 %0 to i16
store i16 %5, i16* inttoptr (i64 67108896 to i16*)
%6 = trunc i32 %1 to i16
store i16 %6, i16* inttoptr (i64 67108898 to i16*)
%7 = trunc i32 %2 to i16
store i16 %7, i16* inttoptr (i64 67108900 to i16*)
%8 = trunc i32 %3 to i16
store i16 %8, i16* inttoptr (i64 67108902 to i16*)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int bl_uart_read_reg(int);
void bl_uart_check_send_end(void) {
  uint16_t lsr;
  uint16_t timeout = 0xffff;
  while (timeout--) {
    lsr = bl_uart_read_reg((0xa00f0000 + 0x14));
    if (lsr & 0x0040) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<bl_uart_check_send_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1159 <bl_uart_check_send_end+0x49>
mov    $0xa00f0014,%edi
call   1030 <bl_uart_read_reg@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1154 <bl_uart_check_send_end+0x44>
jmp    1159 <bl_uart_check_send_end+0x49>
jmp    111f <bl_uart_check_send_end+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl_uart_check_send_end>:
push   %rbx
mov    $0xffff0000,%ebx
cs nopw 0x0(%rax,%rax,1)
inc    %ebx
je     1132 <bl_uart_check_send_end+0x22>
mov    $0xa00f0014,%edi
call   1030 <bl_uart_read_reg@plt>
test   $0x40,%al
je     1120 <bl_uart_check_send_end+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @bl_uart_check_send_end() {
%1 = alloca i32
%2 = alloca i32
store i32 65535, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = call i32 @bl_uart_read_reg(i32 -1609629676)
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = and i32 %9, 64
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
br label %14
13: ; preds = %7
br label %3
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @bl_uart_check_send_end() {
br label %1
1: ; preds = %4, %0
%2 = phi i32 [ 65535, %0 ], [ %5, %4 ]
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = tail call i32 @bl_uart_read_reg(i32 -1609629676)
%7 = and i32 %6, 64
%8 = icmp eq i32 %7, 0
br i1 %8, label %1, label %9
9: ; preds = %4, %1
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

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

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


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xcrossing_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct request {
  int dummy;
};

/* Variables and functions */
int __end_that_request_first(struct request *, int, int);
int end_that_request_first(struct request *req, int uptodate, int nr_sectors) {
  int tmp;
  tmp = __end_that_request_first(req, uptodate, nr_sectors << 9);
  return (tmp);
}


x86 assembly (clang, -O0):
<end_that_request_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
shl    $0x9,%edx
call   1030 <__end_that_request_first@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_that_request_first>:
shl    $0x9,%edx
jmp    1030 <__end_that_request_first@plt>

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

LLVM IR (-O2):
%struct.request = type { i32 }
define i32 @end_that_request_first(%struct.request* %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 9
%5 = tail call i32 @__end_that_request_first(%struct.request* %0, i32 %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sn3218a_uninit();
void sn3218a_led_uninit(void) { sn3218a_uninit(); }


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

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

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

LLVM IR (-O2):
define void @sn3218a_led_uninit() {
%1 = tail call i32 (...) @sn3218a_uninit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EC_POINT;
typedef int /*<<< orphan*/ EC_GROUP;
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int EC_POINT_get_affine_coordinates_GF2m(int /*<<< orphan*/ const *,
                                         int /*<<< orphan*/ const *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *);
int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
                                    BIGNUM *x, BIGNUM *y, BN_CTX *ctx) {
  return EC_POINT_get_affine_coordinates_GF2m(group, p, x, y, ctx);
}


x86 assembly (clang, -O0):
<EC_POINT_get_affine_coordinates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <EC_POINT_get_affine_coordinates_GF2m@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EC_POINT_get_affine_coordinates>:
jmp    1030 <EC_POINT_get_affine_coordinates_GF2m@plt>

LLVM IR (-O0):
define i32 @EC_POINT_get_affine_coordinates(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
%16 = call i32 @EC_POINT_get_affine_coordinates_GF2m(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @EC_POINT_get_affine_coordinates(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @EC_POINT_get_affine_coordinates_GF2m(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
int convertPos(char *pos) {
  if (strcasecmp(pos, "seedkey") == 0) {
    return 0x01;
  } else if (strcasecmp(pos, "encryptedseed") == 0) {
    return 0x02;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<convertPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1142 <convertPos+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <convertPos+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1168 <convertPos+0x58>
movl   $0x2,-0x4(%rbp)
jmp    116f <convertPos+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertPos>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     113e <convertPos+0x2e>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"seedkey\00"
@.str.1 = [14 x i8] c"encryptedseed\00"
define i32 @convertPos(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 2, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}