xunge/DecIR huggingface dataset:
int h3(int a, int b) { return b - 7; }


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

x86 assembly (clang, -O2):
<h3>:
lea    -0x7(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @h3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @h3(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -7
ret i32 %3
}
void pexit(message, code) char *message;
int code;
{
  perror(message);
  exit(code);
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <perror@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pexit>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @pexit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %5)
%7 = load i32, i32* %4
unreachable
}

LLVM IR (-O2):
define void @pexit(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
tail call void @exit(i32 %1)
unreachable
}
int v(char c) { return 'A' < c ? c - 'A' + 10 : c - '0'; }


x86 assembly (clang, -O0):
<v>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jge    112d <v+0x2d>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <v+0x37>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v>:
lea    -0x30(%rdi),%ecx
lea    -0x37(%rdi),%eax
cmp    $0x42,%dil
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @v(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 65, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 65
%10 = add nsw i32 %9, 10
br label %15
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
br label %15
15: ; preds = %11, %6
%16 = phi i32 [ %10, %6 ], [ %14, %11 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @v(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp sgt i8 %0, 65
%4 = select i1 %3, i32 -55, i32 -48
%5 = add nsw i32 %4, %2
ret i32 %5
}
int pmic_get_health(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pmic_get_health() {
ret i32 0
}
void pagination_load_page_directory(struct page_directory_entry *pd) {
  asm volatile("mov %0, %%cr3" ::"b"(pd));
}


x86 assembly (clang, -O0):
<pagination_load_page_directory>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    %rbx,%cr3
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pagination_load_page_directory>:
push   %rbx
mov    %rdi,%rbx
mov    %rbx,%cr3
pop    %rbx
ret

LLVM IR (-O0):
%struct.page_directory_entry = type opaque
define void @pagination_load_page_directory(%struct.page_directory_entry* %0) {
%2 = alloca %struct.page_directory_entry*
store %struct.page_directory_entry* %0, %struct.page_directory_entry** %2
%3 = load %struct.page_directory_entry*, %struct.page_directory_entry** %2
ret void
}

LLVM IR (-O2):
%struct.page_directory_entry = type opaque
define void @pagination_load_page_directory(%struct.page_directory_entry* %0) {
tail call void asm sideeffect "mov $0, %cr3", "{bx},~{dirflag},~{fpsr},~{flags}"(%struct.page_directory_entry* %0)
ret void
}
void add_Byte(void *state, unsigned char byte, unsigned int offset) {
  ((unsigned char *)state)[offset] ^= byte;
}


x86 assembly (clang, -O0):
<add_Byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movzbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_Byte>:
mov    %edx,%eax
xor    %sil,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @add_Byte(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = xor i8 %6, %1
store i8 %7, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_c_files(char *, int /*<<< orphan*/);
int main(void) {
  find_c_files(".", 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32 @find_c_files(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(long long a) {
  if (a != 0x0123456789abcLL)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x123456789abc,%rax
cmp    %rax,-0x8(%rbp)
je     1137 <foo+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0x123456789abc,%rax
cmp    %rax,%rdi
jne    1120 <foo+0x10>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 20015998343868
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp eq i64 %0, 20015998343868
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ USBFS_LoadEP0();
void USBFS_ControlReadDataStage(void) { USBFS_LoadEP0(); }


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

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

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

LLVM IR (-O2):
define void @USBFS_ControlReadDataStage() {
%1 = tail call i32 (...) @USBFS_LoadEP0()
ret void
}
int anys(s1, s2)
register char *s1, *s2;
{
  while (*s1)
    if (any(*s1++, s2))
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<anys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <anys+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <any@plt>
cmp    $0x0,%eax
je     115f <anys+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    116b <anys+0x5b>
jmp    1120 <anys+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anys>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %r14d,%r14d
nopl   (%rax)
movsbl 0x0(%rbp),%edi
test   %edi,%edi
je     1140 <anys+0x30>
add    $0x1,%rbp
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <any@plt>
test   %eax,%eax
je     1120 <anys+0x10>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @anys(i8* nocapture %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 %9, i8* %1)
%11 = icmp eq i32 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
char *ssh_malloc(size_t);
int /*<<< orphan*/ strlcpy(char *, char const *, size_t);
int strlen(char const *);
char *ssh_strdup(const char *str) {
  size_t len;
  char *cp;
  len = strlen(str) + 1;
  cp = ssh_malloc(len);
  strlcpy(cp, str, len);
  return cp;
}


x86 assembly (clang, -O0):
<ssh_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ssh_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <strlcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1040 <ssh_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <strlcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ssh_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @ssh_malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @strlcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @ssh_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @ssh_malloc(i64 %4)
%6 = tail call i32 @strlcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
__attribute__((always_)) void debug_objects_early_init(void) {}


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

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

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

LLVM IR (-O2):
define void @debug_objects_early_init() {
ret void
}
int hash(char *str, unsigned int *hashValue) {
  int c;
  while ((c = (int)*str++)) {
    *hashValue = ((*hashValue << 5) + *hashValue) + c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1147 <hash+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x5,%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
add    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    110c <hash+0xc>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <hash+0x29>
mov    (%rsi),%edx
add    $0x1,%rdi
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
mov    %eax,(%rsi)
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = load i32, i32* %1
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %14, %7 ], [ %6, %5 ]
%9 = phi i8 [ %15, %7 ], [ %3, %5 ]
%10 = phi i8* [ %12, %7 ], [ %0, %5 ]
%11 = sext i8 %9 to i32
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = mul i32 %8, 33
%14 = add i32 %13, %11
store i32 %14, i32* %1
%15 = load i8, i8* %12
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %2
ret i32 0
}
void RAWToARGBRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @RAWToARGBRow_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) {
  printf("Inside dummy handler\n");
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Inside dummy handler\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
double kmToFeet(double km) { return km * 3280.84; }


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

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

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

LLVM IR (-O2):
define double @kmToFeet(double %0) {
%2 = fmul double %0, 3.280840e+03
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void cleanup(void *arg) {
  static int ncall;
  if (++ncall != 1) {
    puts("second call to cleanup");
    exit(1);
  }
  printf("cleanup call #%d\n", ncall);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2efa(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef1(%rip)
cmp    $0x1,%eax
je     116a <cleanup+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2ecc(%rip),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
mov    0x2f05(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2efc(%rip)
test   %eax,%eax
jne    1156 <cleanup+0x26>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1040 <printf@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@cleanup.ncall = internal global i32 0
@.str = [23 x i8] c"second call to cleanup\00"
@.str.1 = [18 x i8] c"cleanup call #%d\0A\00"
define void @cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @cleanup.ncall
%4 = add nsw i32 %3, 1
store i32 %4, i32* @cleanup.ncall
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i32, i32* @cleanup.ncall
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@cleanup.ncall = internal unnamed_addr global i32 0
@.str = [23 x i8] c"second call to cleanup\00"
@.str.1 = [18 x i8] c"cleanup call #%d\0A\00"
define void @cleanup(i8* nocapture readnone %0) {
%2 = load i32, i32* @cleanup.ncall
%3 = add nsw i32 %2, 1
store i32 %3, i32* @cleanup.ncall
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
void *Cyc_AssnDef_aggr(int /*<<< orphan*/, unsigned int, struct Cyc_List_List *,
                       void *);
void *Cyc_AssnDef_datatype_aggr(unsigned tag, struct Cyc_List_List *ts,
                                void *tp) {
  void *_T0;
  _T0 = Cyc_AssnDef_aggr(0, tag, ts, tp);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_AssnDef_datatype_aggr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <Cyc_AssnDef_aggr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_AssnDef_datatype_aggr>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <Cyc_AssnDef_aggr@plt>

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

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define i8* @Cyc_AssnDef_datatype_aggr(i32 %0, %struct.Cyc_List_List* %1, i8* %2) {
%4 = tail call i8* @Cyc_AssnDef_aggr(i32 0, i32 %0, %struct.Cyc_List_List* %1, i8* %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigaddset(int /*<<< orphan*/ *, int);
int main(void) {
  sigset_t set;
  int status;
  status = sigaddset(&set, 21);
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x15,%esi
call   1030 <sigaddset@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x15,%esi
call   1030 <sigaddset@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @sigaddset(i32* %2, i32 21)
store i32 %4, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigaddset(i32* %1, i32 21)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint64_t read64(const void *p) {
  uint64_t x;
  memcpy(&x, p, sizeof(x));
  return x;
}


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

x86 assembly (clang, -O2):
<read64>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read64(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @read64(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void test9(struct t **s) {
  if (s == 0)
    *s = 0;
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111e <test9+0x1e>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.t = type opaque
define void @test9(%struct.t** %0) {
%2 = alloca %struct.t**
store %struct.t** %0, %struct.t*** %2
%3 = load %struct.t**, %struct.t*** %2
%4 = icmp eq %struct.t** %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load %struct.t**, %struct.t*** %2
store %struct.t* null, %struct.t** %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.t = type opaque
define void @test9(%struct.t** readnone %0) {
%2 = icmp ne %struct.t** %0, null
tail call void @llvm.assume(i1 %2)
ret void
}
void SNDWavMuteAudio(void) {}


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

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

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

LLVM IR (-O2):
define void @SNDWavMuteAudio() {
ret void
}
/* Variables and functions */
int UInt160Eq(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ UInt160Get(void const *);
int _pkhEq(const void *pkh, const void *otherPkh) {
  return UInt160Eq(UInt160Get(pkh), UInt160Get(otherPkh));
}


x86 assembly (clang, -O0):
<_pkhEq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <UInt160Get@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <UInt160Get@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <UInt160Eq@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pkhEq>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <UInt160Get@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <UInt160Get@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <UInt160Eq@plt>

LLVM IR (-O0):
define i32 @_pkhEq(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 = call i32 @UInt160Get(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @UInt160Get(i8* %7)
%9 = call i32 @UInt160Eq(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_pkhEq(i8* %0, i8* %1) {
%3 = tail call i32 @UInt160Get(i8* %0)
%4 = tail call i32 @UInt160Get(i8* %1)
%5 = tail call i32 @UInt160Eq(i32 %3, i32 %4)
ret i32 %5
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *findchildelement(struct node *, char *);
struct node *findreturntype(struct node *node) {
  return findchildelement(node, "Type");
}


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

x86 assembly (clang, -O2):
<findreturntype>:
lea    0xee9(%rip),%rsi
jmp    1030 <findchildelement@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [5 x i8] c"Type\00"
define %struct.node* @findreturntype(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call %struct.node* @findchildelement(%struct.node* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret %struct.node* %4
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [5 x i8] c"Type\00"
define %struct.node* @findreturntype(%struct.node* %0) {
%2 = tail call %struct.node* @findchildelement(%struct.node* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret %struct.node* %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
void ft_putstr_fd(char const *s, int fd) {
  while (*s)
    write(fd, s++, 1);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <ft_putstr_fd+0x3f>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    111f <ft_putstr_fd+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     114c <ft_putstr_fd+0x3c>
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x1(%rdi),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14d,%edi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x1,%ebx
cmpb   $0x0,0x0(%rbp)
lea    0x1(%rbp),%rbp
jne    1130 <ft_putstr_fd+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
%13 = ptrtoint i8* %11 to i32
%14 = call i32 @write(i32 %10, i32 %13, i32 1)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = ptrtoint i8* %6 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @write(i32 %1, i32 %9, i32 1)
%11 = load i8, i8* %7
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int evaluatePostfix(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char exp[] = "231*+9-";
  printf("Value of %s is %d", exp, evaluatePostfix(exp));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x2d392b2a313332,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <evaluatePostfix@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.exp = [8 x i8] c"231*+9-\00"
@.str = [18 x i8] c"Value of %s is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = bitcast [8 x i8]* %2 to i8*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%6 = call i32 @evaluatePostfix(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Value of %s is %d\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 12729231506223922, i64* %1
%3 = call i32 @evaluatePostfix(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
unsigned long strtoul(char *, int /*<<< orphan*/ *, int);
const unsigned short buf2status_code(const char *buf, const int len) {
  char s[4];
  unsigned long int code;
  strncpy(s, buf, 3);
  s[3] = '\0';
  code = strtoul(s, NULL, 10);
  return (const unsigned short)code;
}


x86 assembly (clang, -O0):
<buf2status_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0xd(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf2status_code>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @buf2status_code(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [4 x i8]
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @strncpy(i8* %7, i8* %8, i32 3)
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 0, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%12 = call i64 @strtoul(i8* %11, i32* null, i32 10)
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @buf2status_code(i8* %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %0, i32 3)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 0, i8* %6
%7 = call i64 @strtoul(i8* nocapture %4, i32* null, i32 10)
%8 = trunc i64 %7 to i16
ret i16 %8
}
/* Variables and functions */
int number_mm();
int number_percent(void) { return (number_mm() % 100) + 1; }


x86 assembly (clang, -O0):
<number_percent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <number_mm@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_percent>:
push   %rax
xor    %eax,%eax
call   1030 <number_mm@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @number_percent() {
%1 = call i32 (...) @number_mm()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @number_percent() {
%1 = tail call i32 (...) @number_mm()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}
void MergeLevelData(void *levelattr, void *childattr) {}


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

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

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

LLVM IR (-O2):
define void @MergeLevelData(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_destroy_selection_window();
void net_destroy() { net_destroy_selection_window(); }


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

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

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

LLVM IR (-O2):
define void @net_destroy() {
%1 = tail call i32 (...) @net_destroy_selection_window()
ret void
}
void out_hex(char a) {
  while (((*(volatile int *)((0x80000000 + 0x00))) & (0x0300)) > 0)
    ;
  a &= 0x0F;
  if (a >= 10) {
    a += 0x61;
  } else {
    a += 0x30;
  }
  *(volatile int *)((0x80000000 + 0x08)) = a;
}


x86 assembly (clang, -O0):
<out_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x80000000,%eax
mov    (%rax),%eax
and    $0x300,%eax
cmp    $0x0,%eax
jle    1124 <out_hex+0x24>
jmp    110a <out_hex+0xa>
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jl     114a <out_hex+0x4a>
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1154 <out_hex+0x54>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x80000008,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_hex>:
mov    $0x80000000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x300,(%rax)
jne    1110 <out_hex+0x10>
and    $0xf,%dil
lea    0x61(%rdi),%ecx
lea    0x30(%rdi),%edx
cmp    $0xa,%dil
movzbl %cl,%ecx
movzbl %dl,%edx
cmovae %ecx,%edx
movzbl %dl,%ecx
mov    %ecx,0x8(%rax)
ret

LLVM IR (-O0):
define void @out_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* inttoptr (i64 2147483648 to i32*)
%5 = and i32 %4, 768
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = and i32 %10, 15
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 10
br i1 %15, label %16, label %21
16: ; preds = %8
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = add nsw i32 %18, 97
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
br label %26
21: ; preds = %8
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 48
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %26
26: ; preds = %21, %16
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
store volatile i32 %28, i32* inttoptr (i64 2147483656 to i32*)
ret void
}

LLVM IR (-O2):
define void @out_hex(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 2147483648 to i32*)
%4 = and i32 %3, 768
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = and i8 %0, 15
%8 = icmp ugt i8 %7, 9
%9 = add nuw nsw i8 %7, 97
%10 = or i8 %7, 48
%11 = select i1 %8, i8 %9, i8 %10
%12 = zext i8 %11 to i32
store volatile i32 %12, i32* inttoptr (i64 2147483656 to i32*)
ret void
}
unsigned long b4_to_u32r(unsigned char *b) {
  unsigned long l;
  l = b[3];
  l += (unsigned)b[2] << 8;
  l += (unsigned)b[1] << 16;
  l += (unsigned)b[0] << 24;
  return l;
}


x86 assembly (clang, -O0):
<b4_to_u32r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
mov    %eax,%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%eax
mov    %eax,%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    %eax,%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b4_to_u32r>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @b4_to_u32r(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
store i64 %7, i64* %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = zext i32 %12 to i64
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 16
%21 = zext i32 %20 to i64
%22 = load i64, i64* %3
%23 = add i64 %22, %21
store i64 %23, i64* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 24
%29 = zext i32 %28 to i64
%30 = load i64, i64* %3
%31 = add i64 %30, %29
store i64 %31, i64* %3
%32 = load i64, i64* %3
ret i64 %32
}

LLVM IR (-O2):
define i64 @b4_to_u32r(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 8
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 16
%14 = or i64 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %14, %17
ret i64 %18
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ machine;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
scalar_t__ uname(struct utsname *);
int main(void) {
  struct utsname buf;
  if (uname(&buf) != 0 || strcmp(buf.machine, "cris") != 0)
    abort();
  printf("pass\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <uname@plt>
cmp    $0x0,%rax
jne    118b <main+0x3b>
mov    -0x8(%rbp),%edi
lea    0xe84(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1192 <main+0x42>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1050 <uname@plt>
test   %rax,%rax
jne    1185 <main+0x35>
mov    (%rsp),%edi
lea    0xe98(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1185 <main+0x35>
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.utsname = type { i32 }
@.str = [5 x i8] c"cris\00"
@.str.1 = [6 x i8] c"pass\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.utsname
store i32 0, i32* %1
%3 = call i64 @uname(%struct.utsname* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i64 @strcmp(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5, %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %5
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
@.str = [5 x i8] c"cris\00"
@str = [5 x i8] c"pass\00"
define i32 @main() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i64 @uname(%struct.utsname* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i64 @strcmp(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %5, %0
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %5
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%14 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
__attribute__((weak)) extern void __aeabi_memclr(void *dest, size_t n) {
  memset(dest, 0, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memclr>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define weak void @__aeabi_memclr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memclr(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ help();
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("usage: %s [rows columns [mines]]\n", name);
  printf("\tPlay minesweeper.\n");
  help();
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <help@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <help@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"usage: %s [rows columns [mines]]\0A\00"
@.str.1 = [20 x i8] c"\09Play minesweeper.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @help()
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"usage: %s [rows columns [mines]]\0A\00"
@str = [19 x i8] c"\09Play minesweeper.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @help()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ getpid();
uint64_t getMachineId() { return (uint64_t)getpid() % (2 << ((16))); }


x86 assembly (clang, -O0):
<getMachineId>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    $0x20000,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMachineId>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0x1ffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffe0000,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getMachineId() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = srem i32 %2, 131072
ret i32 %3
}

LLVM IR (-O2):
define i32 @getMachineId() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = srem i32 %2, 131072
ret i32 %3
}
void gtk_tree_model_sort_get_type() {}


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

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

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

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

/* Variables and functions */
int encode_signed8(uint8_t *apdu, int8_t value) {
  apdu[0] = (uint8_t)value;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @encode_signed8(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
store i64 %5, i64* %7
ret i32 1
}

LLVM IR (-O2):
define i32 @encode_signed8(i64* nocapture writeonly %0, i64 %1) {
store i64 %1, i64* %0
ret i32 1
}
/* Variables and functions */
int rand();
int getRandomNumber(int upTo) {
  int result = 0;
  result = (rand() % upTo);
  return (result);
}


x86 assembly (clang, -O0):
<getRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomNumber>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getRandomNumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @getRandomNumber(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
void swap(int *n1, int *n2) {
  int temp;
  temp = *n1;
  *n1 = *n2;
  *n2 = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}