xunge/DecIR huggingface dataset:
/* Type definitions */
typedef void EVP_MD_CTX;

/* Variables and functions */
int EVP_DigestInit_ex(void *, int /*<<< orphan*/, int /*<<< orphan*/ *);
void *EVP_MD_CTX_create();
int /*<<< orphan*/ EVP_md5();
void *MD5_init() {
  EVP_MD_CTX *pctx;
  pctx = EVP_MD_CTX_create();
  if (EVP_DigestInit_ex(pctx, EVP_md5(), NULL) != 1)
    return pctx;
  return pctx;
}


x86 assembly (clang, -O0):
<MD5_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <EVP_MD_CTX_create@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <EVP_md5@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <EVP_DigestInit_ex@plt>
cmp    $0x1,%eax
je     1177 <MD5_init+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <MD5_init+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MD5_init>:
push   %rbx
xor    %eax,%eax
call   1050 <EVP_MD_CTX_create@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <EVP_md5@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <EVP_DigestInit_ex@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @MD5_init() {
%1 = tail call i8* (...) @EVP_MD_CTX_create()
%2 = tail call i32 (...) @EVP_md5()
%3 = tail call i32 @EVP_DigestInit_ex(i8* %1, i32 %2, i32* null)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: print-gen [ -d ] gen-file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
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
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: print-gen [ -d ] gen-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: print-gen [ -d ] gen-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("hello, %s\n", "cat");
  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)
lea    0xed3(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"hello, %s\0A\00"
@.str.1 = [4 x i8] c"cat\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 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello, %s\0A\00"
@.str.1 = [4 x i8] c"cat\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vasprintf(char **, char const *, int /*<<< orphan*/);
char *error_message(const char *message, va_list args) {
  char *result;
  vasprintf(&result, message, args);
  return result;
}


x86 assembly (clang, -O0):
<error_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
call   1030 <vasprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_message>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <vasprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @error_message(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @vasprintf(i8** %3, i8* %0, i32 %1)
%6 = load i8*, i8** %3
ret i8* %6
}
unsigned lq2x_generic_input_fmts(void) { return (1 << 0) | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @lq2x_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @lq2x_generic_input_fmts() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ abbreviate(char *);
int main() { abbreviate("Hello There My Friend"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello There My Friend\00"
define i32 @main() {
%1 = call i32 @abbreviate(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello There My Friend\00"
define i32 @main() {
%1 = tail call i32 @abbreviate(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t convert(uint8_t c) {
  uint8_t out = 0;
  switch (c) {
  case '+':
  case '-':
    out = 0;
    break;
  case '>':
  case '<':
    out = 1;
    break;
  case '.':
    out = 3;
    break;
  case ',':
    out = 2;
    break;
  case '[':
    out = 4;
    break;
  case ']':
    out = 5;
    break;
  case '?':
    out = 7;
    break;
  }
  return out;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffd5,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x32,%eax
ja     1186 <convert+0x86>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    1186 <convert+0x86>
movl   $0x1,-0x8(%rbp)
jmp    1186 <convert+0x86>
movl   $0x3,-0x8(%rbp)
jmp    1186 <convert+0x86>
movl   $0x2,-0x8(%rbp)
jmp    1186 <convert+0x86>
movl   $0x4,-0x8(%rbp)
jmp    1186 <convert+0x86>
movl   $0x5,-0x8(%rbp)
jmp    1186 <convert+0x86>
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
xor    %eax,%eax
add    $0xffffffd4,%edi
cmp    $0x31,%edi
ja     113d <convert+0x3d>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
mov    $0x5,%eax
ret
mov    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @convert(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %12 [
i32 43, label %5
i32 45, label %5
i32 62, label %6
i32 60, label %6
i32 46, label %7
i32 44, label %8
i32 91, label %9
i32 93, label %10
i32 63, label %11
]
5: ; preds = %1, %1
store i32 0, i32* %3
br label %12
6: ; preds = %1, %1
store i32 1, i32* %3
br label %12
7: ; preds = %1
store i32 3, i32* %3
br label %12
8: ; preds = %1
store i32 2, i32* %3
br label %12
9: ; preds = %1
store i32 4, i32* %3
br label %12
10: ; preds = %1
store i32 5, i32* %3
br label %12
11: ; preds = %1
store i32 7, i32* %3
br label %12
12: ; preds = %1, %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @convert(i32 %0) {
switch i32 %0, label %8 [
i32 63, label %7
i32 93, label %6
i32 62, label %2
i32 60, label %2
i32 46, label %3
i32 44, label %4
i32 91, label %5
]
2: ; preds = %1, %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3, %2
%9 = phi i32 [ 7, %7 ], [ 5, %6 ], [ 4, %5 ], [ 2, %4 ], [ 3, %3 ], [ 1, %2 ], [ 0, %1 ]
ret i32 %9
}
const char *_system_depended_path(const char *path) { return path; }


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

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

LLVM IR (-O0):
define i8* @_system_depended_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @_system_depended_path(i8* readnone returned %0) {
ret i8* %0
}
void push(char q[100], int *k, char num) {
  *k = *k - 1;
  q[*k] = num;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movslq (%rsi),%rax
lea    -0x1(%rax),%rcx
mov    %ecx,(%rsi)
mov    %dl,-0x1(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @push(i8* %0, i32* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
%9 = sub nsw i32 %8, 1
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load i8, i8* %6
%12 = load i8*, i8** %4
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 %11, i8* %16
ret void
}

LLVM IR (-O2):
define void @push(i8* nocapture writeonly %0, i32* nocapture %1, i8 signext %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %2, i8* %7
ret void
}
int permutate(int i) {
  unsigned int permutation_table[] = {2, 1, 4, 7, 6, 5, 0, 3};
  return permutation_table[i];
}


x86 assembly (clang, -O0):
<permutate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutate>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.permutate.permutation_table = [8 x i32] [i32 2, i32 1, i32 4, i32 7, i32 6, i32 5, i32 0, i32 3]
define i32 @permutate(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = bitcast [8 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
@__const.permutate.permutation_table = [8 x i32] [i32 2, i32 1, i32 4, i32 7, i32 6, i32 5, i32 0, i32 3]
define i32 @permutate(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [8 x i32], [8 x i32]* @__const.permutate.permutation_table, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int square(int);
int main(void) {
  int x;
  scanf("%d", &x);
  printf("%d", square(x));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <square@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void RTSha256(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @atomic_init() {
ret void
}
int GetAFromRGB(const int nRGB) { return (nRGB & 0xFF000000) >> 24; }


x86 assembly (clang, -O0):
<GetAFromRGB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetAFromRGB>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @GetAFromRGB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetAFromRGB(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
void livepatch_callbacks_mod_exit(void) { pr_info("%s\n", __func__); }


x86 assembly (clang, -O0):
<livepatch_callbacks_mod_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_info@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<livepatch_callbacks_mod_exit>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
jmp    1030 <pr_info@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.livepatch_callbacks_mod_exit = [29 x i8] c"livepatch_callbacks_mod_exit\00"
define void @livepatch_callbacks_mod_exit() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.livepatch_callbacks_mod_exit, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@__func__.livepatch_callbacks_mod_exit = [29 x i8] c"livepatch_callbacks_mod_exit\00"
define void @livepatch_callbacks_mod_exit() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.livepatch_callbacks_mod_exit, i64 0, i64 0))
ret void
}
void UART4_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @UART4_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void lv_error(const char *message) { fprintf(stderr, "ERROR: %s", message); }


x86 assembly (clang, -O0):
<lv_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lv_error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"ERROR: %s\00"
define void @lv_error(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 ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"ERROR: %s\00"
define void @lv_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int ch;
  scanf("%hhd", &ch);
  printf("%c\n", ch);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%hhd\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void print_log(char *text, FILE *f1) {
  time_t horario;
  horario = time(NULL);
  fprintf(f1, "--> %s ==> %s", text, asctime(gmtime(&horario)));
  fflush(f1);
}


x86 assembly (clang, -O0):
<print_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
call   1070 <gmtime@plt>
mov    %eax,%edi
call   1030 <asctime@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
lea    0xe62(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_log>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1070 <gmtime@plt>
mov    %eax,%edi
call   1030 <asctime@plt>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <fflush@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"--> %s ==> %s\00"
define void @print_log(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = call i32 @time(i32* null)
store i32 %6, i32* %5
%7 = load i32*, i32** %4
%8 = load i8*, i8** %3
%9 = call i32 @gmtime(i32* %5)
%10 = call i8* @asctime(i32 %9)
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %10)
%12 = load i32*, i32** %4
%13 = call i32 @fflush(i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"--> %s ==> %s\00"
define void @print_log(i8* %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call i32 @gmtime(i32* %3)
%7 = call i8* @asctime(i32 %6)
%8 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
%9 = call i32 @fflush(i32* %1)
ret void
}
int open(const char *filename, int flags, int mode) {
  int fd = 0;
  asm("movl $5,%%eax		\n\t"
      "movl %1,%%ebx	\n\t"
      "movl %2,%%ecx \n\t"
      "movl %3,%%edx \n\t"
      "int $0x80  \n\t"
      "movl %%eax,%0 \n\t"
      : "=m"(fd)
      : "m"(filename), "m"(flags), "m"(mode));
  return fd;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x5,%eax
mov    -0x8(%rbp),%ebx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    %rdi,-0x8(%rsp)
mov    %esi,-0xc(%rsp)
mov    %edx,-0x10(%rsp)
movl   $0x0,-0x14(%rsp)
mov    $0x5,%eax
mov    -0x8(%rsp),%ebx
mov    -0xc(%rsp),%ecx
mov    -0x10(%rsp),%edx
int    $0x80
mov    %eax,-0x14(%rsp)
mov    -0x14(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%9 = load i32, i32* %7
ret i32 %9
}
int UDFDescriptor(unsigned char *data, unsigned short *TagID) {
  *TagID = ((unsigned short)data[0] | ((unsigned short)data[(0) + 1] << 8));
  return 0;
}


x86 assembly (clang, -O0):
<UDFDescriptor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UDFDescriptor>:
movzwl (%rdi),%eax
mov    %ax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @UDFDescriptor(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = zext i16 %8 to i32
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i16
%14 = zext i16 %13 to i32
%15 = shl i32 %14, 8
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i16
%18 = load i16*, i16** %4
store i16 %17, i16* %18
ret i32 0
}

LLVM IR (-O2):
define i32 @UDFDescriptor(i8* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = shl nuw i16 %7, 8
%9 = or i16 %8, %4
store i16 %9, i16* %1
ret i32 0
}
/* Variables and functions */
int is_child_dead();
int /*<<< orphan*/ usleep(int);
int utp_poll_pipe() {
  int ret = 0, cnt = 0xFFFF;
  while (ret == 0 && cnt > 0) {
    ret = is_child_dead();
    usleep(10000);
    cnt--;
  }
  if (ret == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<utp_poll_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0xffff,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    114f <utp_poll_pipe+0x2f>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115f <utp_poll_pipe+0x3f>
jmp    1181 <utp_poll_pipe+0x61>
mov    $0x0,%al
call   1030 <is_child_dead@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <utp_poll_pipe+0x16>
cmpl   $0x0,-0x8(%rbp)
jne    1197 <utp_poll_pipe+0x77>
movl   $0x1,-0x4(%rbp)
jmp    119e <utp_poll_pipe+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utp_poll_pipe>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffff,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <is_child_dead@plt>
mov    %eax,%ebp
mov    $0x2710,%edi
call   1040 <usleep@plt>
test   %ebp,%ebp
jne    1151 <utp_poll_pipe+0x31>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <utp_poll_pipe+0x10>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @utp_poll_pipe() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 65535, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %17
12: ; preds = %10
%13 = call i32 (...) @is_child_dead()
store i32 %13, i32* %2
%14 = call i32 @usleep(i32 10000)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
br label %4
17: ; preds = %10
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %1
br label %22
21: ; preds = %17
store i32 0, i32* %1
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @utp_poll_pipe() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 65535, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @is_child_dead()
%4 = tail call i32 @usleep(i32 10000)
%5 = add nsw i32 %2, -1
%6 = icmp eq i32 %3, 0
%7 = icmp ugt i32 %2, 1
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %1, label %9
9: ; preds = %1
%10 = zext i1 %6 to i32
ret i32 %10
}
void lif_close_phy_device(descriptor) {}


x86 assembly (clang, -O0):
<lif_close_phy_device>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lif_close_phy_device(i32 %0) {
ret void
}
void SPUsetVolumeL(unsigned char ch, short vol) {}


x86 assembly (clang, -O0):
<SPUsetVolumeL>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SPUsetVolumeL(i8 zeroext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @SPUsetVolumeL(i8 zeroext %0, i16 signext %1) {
ret void
}
/* Variables and functions */
scalar_t__ ESRCH;
scalar_t__ errno;
scalar_t__ kill(unsigned int, int /*<<< orphan*/);
unsigned short isLivePID(unsigned int ckpid) {
  if (0 == kill(ckpid, 0)) {
    return 1;
  } else if (ESRCH == errno) {
    return 0;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isLivePID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    113e <isLivePID+0x2e>
movw   $0x1,-0x2(%rbp)
jmp    1169 <isLivePID+0x59>
mov    0x2e8b(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
jne    1163 <isLivePID+0x53>
movw   $0x0,-0x2(%rbp)
jmp    1169 <isLivePID+0x59>
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ESRCH = global i64 0
@errno = global i64 0
define zeroext i16 @isLivePID(i32 %0) {
%2 = alloca i16
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @kill(i32 %4, i32 0)
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 1, i16* %2
br label %14
8: ; preds = %1
%9 = load i64, i64* @ESRCH
%10 = load i64, i64* @errno
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i16 0, i16* %2
br label %14
13: ; preds = %8
store i16 0, i16* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
@ESRCH = global i64 0
@errno = global i64 0
define zeroext i16 @isLivePID(i32 %0) {
%2 = tail call i64 @kill(i32 %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Type definitions */
typedef int time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
time_t mktime(struct tm *tm) { return -1; }


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @mktime(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @mktime(%struct.tm* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sse_utils_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<sse_utils_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sse_utils_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int f316(int *);
int f317(int *p) { return f316(p); }


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

x86 assembly (clang, -O2):
<f317>:
jmp    1030 <f316@plt>

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

LLVM IR (-O2):
define i32 @f317(i32* %0) {
%2 = tail call i32 @f316(i32* %0)
ret i32 %2
}
double max_double(double a, double b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max_double+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <max_double+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_double>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @max_double(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
char *foo(void) {
  char *p, c;
  c = 'a';
  p = &c;
  printf("*p = %c\n", *p);
  return p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x9(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed1(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
lea    0x7(%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"*p = %c\0A\00"
define noalias i8* @foo() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext 97)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ new_units();
void process_make_temp(void) { new_units(); }


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

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

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

LLVM IR (-O2):
define void @process_make_temp() {
%1 = tail call i32 (...) @new_units()
ret void
}
void tegra_cpuidle_init(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_cpuidle_init() {
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRA7_get(void) { return U_WMRCORENONE_get("U_WMRA7"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA7\00"
define i32 @U_WMRA7_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA7\00"
define i32 @U_WMRA7_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ljoy_Close(int);
char *ljoy_GetName(int);
int ljoy_OpenById(int, int /*<<< orphan*/);
char *ljoy_GetNameById(int joyid) {
  int id = ljoy_OpenById(joyid, 0);
  char *ret = ljoy_GetName(id);
  ljoy_Close(id);
  return (ret);
}


x86 assembly (clang, -O0):
<ljoy_GetNameById>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <ljoy_OpenById@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <ljoy_GetName@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ljoy_Close@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ljoy_GetNameById>:
push   %r14
push   %rbx
push   %rax
xor    %esi,%esi
call   1040 <ljoy_OpenById@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <ljoy_GetName@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <ljoy_Close@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ljoy_GetNameById(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @ljoy_OpenById(i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i8* @ljoy_GetName(i32 %7)
store i8* %8, i8** %4
%9 = load i32, i32* %3
%10 = call i32 @ljoy_Close(i32 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @ljoy_GetNameById(i32 %0) {
%2 = tail call i32 @ljoy_OpenById(i32 %0, i32 0)
%3 = tail call i8* @ljoy_GetName(i32 %2)
%4 = tail call i32 @ljoy_Close(i32 %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *IcsFOpen(char const *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int IcsExistFile(const char *filename) {
  FILE *fp;
  if ((fp = IcsFOpen(filename, "rb")) != NULL) {
    fclose(fp);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<IcsExistFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <IcsFOpen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <IcsExistFile+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <IcsExistFile+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @IcsExistFile(i8* %0) {
%2 = tail call i32* @IcsFOpen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_assignop_exp(struct Cyc_Absyn_Exp *,
                                             int /*<<< orphan*/,
                                             struct Cyc_Absyn_Exp *,
                                             unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_assign_exp(struct Cyc_Absyn_Exp *e1,
                                           struct Cyc_Absyn_Exp *e2,
                                           unsigned loc) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Absyn_assignop_exp(e1, 0, e2, loc);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Absyn_assign_exp>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <Cyc_Absyn_assignop_exp@plt>

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

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_assign_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_assignop_exp(%struct.Cyc_Absyn_Exp* %0, i32 0, %struct.Cyc_Absyn_Exp* %1, i32 %2)
ret %struct.Cyc_Absyn_Exp* %4
}
/* Variables and functions */
int /*<<< orphan*/ BGBBTJ_Codec_Init();
int BGBBTJ_AVI_Init() {
  BGBBTJ_Codec_Init();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @BGBBTJ_AVI_Init() {
%1 = tail call i32 (...) @BGBBTJ_Codec_Init()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t __attribute__((no)) vm_vaarg64(void *rf, void **ptr) {
  void *p = *ptr;
  p -= sizeof(uint64_t);
  uint64_t r = *(uint64_t *)p;
  *ptr = p;
  return r;
}


x86 assembly (clang, -O0):
<vm_vaarg64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_vaarg64>:
mov    (%rsi),%rcx
mov    -0x4(%rcx),%eax
add    $0xfffffffffffffffc,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define i32 @vm_vaarg64(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = getelementptr i8, i8* %9, i64 -4
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %6
%14 = load i8*, i8** %5
%15 = load i8**, i8*** %4
store i8* %14, i8** %15
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @vm_vaarg64(i8* nocapture readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = getelementptr i8, i8* %3, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i8* %4, i8** %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I am test exe2.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"I am test exe2.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"I am test exe2.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void arr_(int *arr) { printf("arr* : %p \n", arr); }


x86 assembly (clang, -O0):
<arr_>:
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):
<arr_>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"arr* : %p \0A\00"
define void @arr_(i32* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}