xunge/DecIR huggingface dataset:
void gtk_color_button_get_type() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_new();
int /*<<< orphan*/ bind_helper(int /*<<< orphan*/ *);
ENGINE *engine_gmp(void) {
  ENGINE *ret = ENGINE_new();
  if (!ret)
    return NULL;
  if (!bind_helper(ret)) {
    ENGINE_free(ret);
    return NULL;
  }
  return ret;
}


x86 assembly (clang, -O0):
<engine_gmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ENGINE_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <engine_gmp+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    118b <engine_gmp+0x5b>
mov    -0x10(%rbp),%rdi
call   1050 <bind_helper@plt>
cmp    $0x0,%eax
jne    1183 <engine_gmp+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <ENGINE_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    118b <engine_gmp+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<engine_gmp>:
push   %rbx
xor    %eax,%eax
call   1040 <ENGINE_new@plt>
test   %rax,%rax
je     1154 <engine_gmp+0x24>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <bind_helper@plt>
test   %eax,%eax
jne    1156 <engine_gmp+0x26>
mov    %rbx,%rdi
call   1030 <ENGINE_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @engine_gmp() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @ENGINE_new()
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %0
store i32* null, i32** %1
br label %16
7: ; preds = %0
%8 = load i32*, i32** %2
%9 = call i32 @bind_helper(i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = load i32*, i32** %2
%13 = call i32 @ENGINE_free(i32* %12)
store i32* null, i32** %1
br label %16
14: ; preds = %7
%15 = load i32*, i32** %2
store i32* %15, i32** %1
br label %16
16: ; preds = %14, %11, %6
%17 = load i32*, i32** %1
ret i32* %17
}

LLVM IR (-O2):
define i32* @engine_gmp() {
%1 = tail call i32* (...) @ENGINE_new()
%2 = icmp eq i32* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @bind_helper(i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ENGINE_free(i32* %1)
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32* [ null, %6 ], [ null, %0 ], [ %1, %3 ]
ret i32* %9
}
/* Variables and functions */
int LoadFile(char *, void **, int /*<<< orphan*/, int /*<<< orphan*/);
int FS_ReadFileAndCache(const char *qpath, void **buffer) {
  return LoadFile((char *)qpath, buffer, 0, 0);
}


x86 assembly (clang, -O0):
<FS_ReadFileAndCache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <LoadFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FS_ReadFileAndCache>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <LoadFile@plt>

LLVM IR (-O0):
define i32 @FS_ReadFileAndCache(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 = load i8**, i8*** %4
%7 = call i32 @LoadFile(i8* %5, i8** %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @FS_ReadFileAndCache(i8* %0, i8** %1) {
%3 = tail call i32 @LoadFile(i8* %0, i8** %1, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_putstr(char *);
int write(int, char *, int);
void my_putchar(char c) {
  int a;
  a = write(1, &c, 1);
  if (a == -1) {
    my_putstr("Error on write\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<my_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1171 <my_putchar+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <my_putstr@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     1151 <my_putchar+0x21>
pop    %rax
ret
lea    0xea8(%rip),%rdi
call   1040 <my_putstr@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Error on write\0A\00"
define void @my_putchar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = call i32 @write(i32 1, i8* %2, i32 1)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error on write\0A\00"
define void @my_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void buf_add_uint32(char *buf, uint32_t val) {
  uint32_t nval = htonl(val);
  memcpy(buf, &nval, 4);
}


x86 assembly (clang, -O0):
<buf_add_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_add_uint32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @buf_add_uint32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @htonl(i32 %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = call i32 @memcpy(i8* %8, i32* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @buf_add_uint32(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
int ft_len(int n) {
  int len;
  len = 0;
  if (n == 0)
    return (1);
  if (n < 0)
    len++;
  while (n != 0) {
    len++;
    n /= 10;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <ft_len+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1168 <ft_len+0x68>
cmpl   $0x0,-0x8(%rbp)
jge    1137 <ft_len+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <ft_len+0x3c>
cmpl   $0x0,-0x8(%rbp)
je     1162 <ft_len+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    113c <ft_len+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_len>:
test   %edi,%edi
je     1133 <ft_len+0x33>
mov    %edi,%eax
shr    $0x1f,%eax
nopl   0x0(%rax)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <ft_len+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_len(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 31
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %4, %3 ], [ %8, %5 ]
%7 = phi i32 [ %0, %3 ], [ %9, %5 ]
%8 = add nuw nsw i32 %6, 1
%9 = sdiv i32 %7, 10
%10 = add i32 %7, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %13
}
int fb_ConsolePageSet(int active, int visible) { return -1; }


x86 assembly (clang, -O0):
<fb_ConsolePageSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fb_ConsolePageSet(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("Starting server! %s\n", argv[1]);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Starting server! %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Starting server! %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int hidden_func() { return 0; }


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

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

LLVM IR (-O0):
define i32 @hidden_func() {
ret i32 0
}

LLVM IR (-O2):
define i32 @hidden_func() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char str[]) { printf("%s\n", str); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
char *IcsFileNameFind(char const *str) {
  char const *begin;
  begin = strrchr(str, '/');
  if (begin == NULL) {
    begin = str;
  } else {
    begin++;
  }
  return (char *)begin;
}


x86 assembly (clang, -O0):
<IcsFileNameFind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <IcsFileNameFind+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <IcsFileNameFind+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IcsFileNameFind>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @IcsFileNameFind(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %13
13: ; preds = %10, %8
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @IcsFileNameFind(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int __signbit(long double);
int __signbitl(long double a1) { return __signbit(a1); }


x86 assembly (clang, -O0):
<__signbitl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__signbit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__signbitl>:
jmp    1030 <__signbit@plt>

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

LLVM IR (-O2):
define i32 @__signbitl(x86_fp80 %0) {
%2 = tail call i32 @__signbit(x86_fp80 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendExternalInterrupt09(void) {
  SendInterrupt(0x59, 0x1, 0x8000, 0x02000000);
}


x86 assembly (clang, -O0):
<ScuSendExternalInterrupt09>:
push   %rbp
mov    %rsp,%rbp
mov    $0x59,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x2000000,%ecx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendExternalInterrupt09>:
mov    $0x59,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x2000000,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendExternalInterrupt09() {
%1 = call i32 @SendInterrupt(i32 89, i32 1, i32 32768, i32 33554432)
ret void
}

LLVM IR (-O2):
define void @ScuSendExternalInterrupt09() {
%1 = tail call i32 @SendInterrupt(i32 89, i32 1, i32 32768, i32 33554432)
ret void
}
/* Variables and functions */
short *BGBMID_LoadWAV_RateMono16(char const *, int *, int);
short *BGBMID_LoadWAV_32Mono16(const char *name, int *rlen) {
  return (BGBMID_LoadWAV_RateMono16(name, rlen, 32000));
}


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

x86 assembly (clang, -O2):
<BGBMID_LoadWAV_32Mono16>:
mov    $0x7d00,%edx
jmp    1030 <BGBMID_LoadWAV_RateMono16@plt>

LLVM IR (-O0):
define i16* @BGBMID_LoadWAV_32Mono16(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 = call i16* @BGBMID_LoadWAV_RateMono16(i8* %5, i32* %6, i32 32000)
ret i16* %7
}

LLVM IR (-O2):
define i16* @BGBMID_LoadWAV_32Mono16(i8* %0, i32* %1) {
%3 = tail call i16* @BGBMID_LoadWAV_RateMono16(i8* %0, i32* %1, i32 32000)
ret i16* %3
}
int set_sock_opt(int sock, int level, int optname) {
  int ret = 0;
  int reuse = 1;
  ret = setsockopt(sock, level, optname, &reuse, sizeof(reuse));
  if (ret < 0) {
    printf("setsockopt error %s\n", __FUNCTION__);
  }
  return ret;
}


x86 assembly (clang, -O0):
<set_sock_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x14(%rbp),%rcx
mov    $0x4,%r8d
mov    $0x0,%al
call   1030 <setsockopt@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    117b <set_sock_opt+0x5b>
lea    0xe93(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sock_opt>:
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%rcx
mov    $0x4,%r8d
xor    %eax,%eax
call   1030 <setsockopt@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    115a <set_sock_opt+0x3a>
lea    0xeb4(%rip),%rdi
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"setsockopt error %s\0A\00"
@__FUNCTION__.set_sock_opt = [13 x i8] c"set_sock_opt\00"
define i32 @set_sock_opt(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 1, i32* %8
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i32, i32, i32, i32*, i64, ...) bitcast (i32 (...)* @setsockopt to i32 (i32, i32, i32, i32*, i64, ...)*)(i32 %9, i32 %10, i32 %11, i32* %8, i64 4)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.set_sock_opt, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [21 x i8] c"setsockopt error %s\0A\00"
@__FUNCTION__.set_sock_opt = [13 x i8] c"set_sock_opt\00"
define i32 @set_sock_opt(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%6 = call i32 (i32, i32, i32, i32*, i64, ...) bitcast (i32 (...)* @setsockopt to i32 (i32, i32, i32, i32*, i64, ...)*)(i32 %0, i32 %1, i32 %2, i32* %4, i64 4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.set_sock_opt, i64 0, i64 0))
br label %10
10: ; preds = %8, %3
ret i32 %6
}
void simplesocket_init() {}


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

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

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

LLVM IR (-O2):
define void @simplesocket_init() {
ret void
}
void ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf,
                            int done) {}


x86 assembly (clang, -O0):
<ath5k_debug_printtxbuf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ath5k_softc = type opaque
%struct.ath5k_buf = type opaque
define void @ath5k_debug_printtxbuf(%struct.ath5k_softc* %0, %struct.ath5k_buf* %1, i32 %2) {
%4 = alloca %struct.ath5k_softc*
%5 = alloca %struct.ath5k_buf*
%6 = alloca i32
store %struct.ath5k_softc* %0, %struct.ath5k_softc** %4
store %struct.ath5k_buf* %1, %struct.ath5k_buf** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.ath5k_softc = type opaque
%struct.ath5k_buf = type opaque
define void @ath5k_debug_printtxbuf(%struct.ath5k_softc* nocapture %0, %struct.ath5k_buf* nocapture %1, i32 %2) {
ret void
}
int is_whitespace(char ch) {
  if (ch == 0 || ch == ' ' || ch == '\n' || ch == '=')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     113e <is_whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113e <is_whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     113e <is_whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x3d,%eax
jne    114a <is_whitespace+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_whitespace+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 61, label %3
i8 32, label %3
i8 10, label %3
i8 0, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int do_349() { return 349; }


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

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

LLVM IR (-O0):
define i32 @do_349() {
ret i32 349
}

LLVM IR (-O2):
define i32 @do_349() {
ret i32 349
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ free(char *);
char *getToken(char const **);
float getFloat(const char **p) {
  char *token = getToken(p);
  float result = atof(token);
  free(token);
  return result;
}


x86 assembly (clang, -O0):
<getFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getToken@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atof@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFloat>:
push   %rbx
sub    $0x10,%rsp
call   1050 <getToken@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @getFloat(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca float
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = call i8* @getToken(i8** %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call float @atof(i8* %7)
store float %8, float* %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load float, float* %4
ret float %11
}

LLVM IR (-O2):
define float @getFloat(i8** %0) {
%2 = tail call i8* @getToken(i8** %0)
%3 = tail call float @atof(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret float %3
}
void GPIODirModeSet(unsigned long ulPort, unsigned char ucPins,
                    unsigned long ulPinIO) {
  ;
  ;
  (*((volatile unsigned long *)(ulPort + 0x00000400))) =
      ((ulPinIO & 1)
           ? ((*((volatile unsigned long *)(ulPort + 0x00000400))) | ucPins)
           : ((*((volatile unsigned long *)(ulPort + 0x00000400))) &
              ~(ucPins)));
}


x86 assembly (clang, -O0):
<GPIODirModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     113f <GPIODirModeSet+0x3f>
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%rax
movzbl -0x9(%rbp),%ecx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115b <GPIODirModeSet+0x5b>
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%rax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x400(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODirModeSet>:
mov    0x400(%rdi),%rax
mov    %esi,%ecx
mov    %rcx,%rsi
not    %rsi
and    %rax,%rsi
or     %rcx,%rax
test   $0x1,%dl
cmove  %rsi,%rax
mov    %rax,0x400(%rdi)
ret

LLVM IR (-O0):
define void @GPIODirModeSet(i64 %0, i8 zeroext %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i64
store i64 %0, i64* %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = and i64 %7, 1
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i64, i64* %4
%12 = add i64 %11, 1024
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = load i8, i8* %5
%16 = zext i8 %15 to i64
%17 = or i64 %14, %16
br label %28
18: ; preds = %3
%19 = load i64, i64* %4
%20 = add i64 %19, 1024
%21 = inttoptr i64 %20 to i64*
%22 = load volatile i64, i64* %21
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = xor i32 %24, -1
%26 = sext i32 %25 to i64
%27 = and i64 %22, %26
br label %28
28: ; preds = %18, %10
%29 = phi i64 [ %17, %10 ], [ %27, %18 ]
%30 = load i64, i64* %4
%31 = add i64 %30, 1024
%32 = inttoptr i64 %31 to i64*
store volatile i64 %29, i64* %32
ret void
}

LLVM IR (-O2):
define void @GPIODirModeSet(i64 %0, i8 zeroext %1, i64 %2) {
%4 = and i64 %2, 1
%5 = icmp eq i64 %4, 0
%6 = add i64 %0, 1024
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = zext i8 %1 to i64
%10 = xor i64 %9, -1
%11 = and i64 %8, %10
%12 = or i64 %8, %9
%13 = select i1 %5, i64 %11, i64 %12
store volatile i64 %13, i64* %7
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
bool stringEquals(const char *s1, const char *s2) {
  int comparison = strcmp(s1, s2);
  return (comparison == 0);
}


x86 assembly (clang, -O0):
<stringEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @stringEquals(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int alint_init() { return 1; }


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

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

LLVM IR (-O0):
define i32 @alint_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @alint_init() {
ret i32 1
}
/* Variables and functions */
int exc_type(void *);
int /*<<< orphan*/ free(void *);
void exc_free(void *exc) {
  switch (exc_type(exc)) {
  case 1:
    free(exc);
  case 2:
    return;
  };
}


x86 assembly (clang, -O0):
<exc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <exc_type@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x1,%eax
je     1159 <exc_free+0x39>
jmp    1148 <exc_free+0x28>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1162 <exc_free+0x42>
jmp    1167 <exc_free+0x47>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1167 <exc_free+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exc_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <exc_type@plt>
cmp    $0x1,%eax
jne    1137 <exc_free+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @exc_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @exc_type(i8* %3)
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %8
]
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %1, %5
br label %9
9: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @exc_free(i8* %0) {
%2 = tail call i32 @exc_type(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buddy_free(struct page *);
void page_cleanup(struct page **page) {
  if (*page) {
    buddy_free(*page);
  }
}


x86 assembly (clang, -O0):
<page_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <page_cleanup+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <buddy_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_cleanup>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <page_cleanup+0xd>
jmp    1030 <buddy_free@plt>
ret

LLVM IR (-O0):
%struct.page = type { i32 }
define void @page_cleanup(%struct.page** %0) {
%2 = alloca %struct.page**
store %struct.page** %0, %struct.page*** %2
%3 = load %struct.page**, %struct.page*** %2
%4 = load %struct.page*, %struct.page** %3
%5 = icmp ne %struct.page* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.page**, %struct.page*** %2
%8 = load %struct.page*, %struct.page** %7
%9 = call i32 @buddy_free(%struct.page* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @page_cleanup(%struct.page** nocapture %0) {
%2 = load %struct.page*, %struct.page** %0
%3 = icmp eq %struct.page* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @buddy_free(%struct.page* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "Usage: %s [-v] source_file destination_file\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [-v] source_file destination_file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [-v] source_file destination_file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage: gdb_redirecrt <path_to_file>\n"); }


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"usage: gdb_redirecrt <path_to_file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
signed int cmatch(char c, char str[]) {
  int e;
  for (e = 0; str[e] != '\0'; ++e) {
    if (str[e] == c) {
      return e;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<cmatch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <cmatch+0x60>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <cmatch+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <cmatch+0x67>
jmp    1152 <cmatch+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <cmatch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmatch>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <cmatch+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,%dl
je     1123 <cmatch+0x23>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <cmatch+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmatch(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
unsigned long x86_read_cr3() {
  unsigned long val;
  __asm__ __volatile__("mov %%cr3, %0" : "=r"(val));
  return val;
}


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

x86 assembly (clang, -O2):
<x86_read_cr3>:
mov    %cr3,%rax
ret

LLVM IR (-O0):
define i64 @x86_read_cr3() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @x86_read_cr3() {
%1 = tail call i64 asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ pgfuny_(float (*)(), int *, float *, float *, int *);
cpgfuny(float pgfun1(), int n, float ymin, float ymax, int pgflag) {
  pgfuny_(pgfun1, &n, &ymin, &ymax, &pgflag);
}


x86 assembly (clang, -O0):
<cpgfuny>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
movss  %xmm1,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <pgfuny_@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpgfuny>:
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
mov    %edx,0x8(%rsp)
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <pgfuny_@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @cpgfuny(float (...)* %0, i32 %1, float %2, float %3, i32 %4) {
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
store i32 %4, i32* %9
%10 = call i32 @pgfuny_(float (...)* %0, i32* %6, float* %7, float* %8, i32* %9)
ret i32 undef
}
/* Variables and functions */
scalar_t__ strlen(char *);
bool str_is_nonempty(char *s) {
  if (s != NULL && strlen(s) > 0) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<str_is_nonempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <str_is_nonempty+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1146 <str_is_nonempty+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <str_is_nonempty+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_is_nonempty>:
test   %rdi,%rdi
je     112e <str_is_nonempty+0x1e>
push   %rax
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
lea    0x8(%rsp),%rsp
jle    112e <str_is_nonempty+0x1e>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_is_nonempty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
double f(double a, double b, int c, int d) {
  return (c > 10 && d > 20) ? a : b;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
cmpl   $0xa,-0x14(%rbp)
jle    1137 <f+0x37>
cmpl   $0x14,-0x18(%rbp)
jle    1137 <f+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1141 <f+0x41>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x15,%esi
jl     110b <f+0xb>
cmp    $0xb,%edi
jl     1113 <f+0x13>
ret
movaps %xmm1,%xmm0
cmp    $0xb,%edi
jge    110a <f+0xa>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @f(double %0, double %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, 10
%6 = icmp sgt i32 %3, 20
%7 = and i1 %5, %6
%8 = select i1 %7, double %0, double %1
ret double %8
}
/* Variables and functions */
scalar_t__ beaglelogic_get_buffersize(int, size_t *);
int munmap(void *, size_t);
int beaglelogic_munmap(int fd, void *addr) {
  size_t sz;
  if (beaglelogic_get_buffersize(fd, &sz))
    return -1;
  return munmap(addr, sz);
}


x86 assembly (clang, -O0):
<beaglelogic_munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <beaglelogic_get_buffersize@plt>
cmp    $0x0,%rax
je     1151 <beaglelogic_munmap+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <beaglelogic_munmap+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <munmap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beaglelogic_munmap>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <beaglelogic_get_buffersize@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    114c <beaglelogic_munmap+0x2c>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <munmap@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @beaglelogic_munmap(i32 %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @beaglelogic_get_buffersize(i32 %0, i64* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %3
%9 = call i32 @munmap(i8* %1, i64 %8)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ %9, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
char *formataddr(char *, char *);
char *concataddr(char *orig, char *str) { return formataddr(orig, str); }


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

x86 assembly (clang, -O2):
<concataddr>:
jmp    1030 <formataddr@plt>

LLVM IR (-O0):
define i8* @concataddr(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 = load i8*, i8** %4
%7 = call i8* @formataddr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @concataddr(i8* %0, i8* %1) {
%3 = tail call i8* @formataddr(i8* %0, i8* %1)
ret i8* %3
}
float convert(int fahr) {
  int temp;
  temp = (5.0 / 9.0) * (fahr - 32);
  return temp;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convert(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fmul double 0x3FE1C71C71C71C72, %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @convert(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to float
ret float %6
}
int is_letter(char symbol) {
  if ((symbol >= 'A' && symbol <= 'Z') || (symbol >= 'a' && symbol <= 'z')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1124 <is_letter+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    113e <is_letter+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     114a <is_letter+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     114a <is_letter+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_letter+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_letter(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
}