xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void draw(int n, char sym) {
  int i;
  for (i = 0; i < n; ++i) {
    printf("%c", sym);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <draw+0x44>
movsbl -0x5(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <draw+0x18>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112c <draw+0x1c>
mov    %edi,%ebx
movsbl %sil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <draw+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @draw(i32 %0, i8 signext %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = sext i8 %1 to i32
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %9, %6 ]
%8 = tail call i32 @putchar(i32 %5)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
void foo(int x, int y) { y = x; }


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testing_restful_client_init();
void testing_common_init() { testing_restful_client_init(); }


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

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

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

LLVM IR (-O2):
define void @testing_common_init() {
%1 = tail call i32 (...) @testing_restful_client_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_rand();
int /*<<< orphan*/ printf(char *, int);
int rand();
int irand(int n) {
  init_rand();
  if (n < 0)
    printf("Negative n: %d\n", n);
  return rand() % n;
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init_rand@plt>
cmpl   $0x0,-0x4(%rbp)
jge    115b <irand+0x2b>
mov    -0x4(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <init_rand@plt>
test   %ebx,%ebx
jns    114c <irand+0x1c>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Negative n: %d\0A\00"
define i32 @irand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @init_rand()
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
%10 = call i32 (...) @rand()
%11 = load i32, i32* %2
%12 = srem i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"Negative n: %d\0A\00"
define i32 @irand(i32 %0) {
%2 = tail call i32 (...) @init_rand()
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
char *char_endianness(void) {
  unsigned char arr[sizeof(char)];
  if (sizeof(char) == 1) {
    return NULL;
  }
  memset(arr, 0, sizeof arr);
  arr[0] = 1;
  if (*((char *)arr) == 1) {
    return "little-endian";
  }
  memset(arr, 0, sizeof arr);
  arr[sizeof arr - 1] = 1;
  if (*((char *)arr) == 1) {
    return "big-endian";
  }
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @char_endianness() {
%1 = alloca [1 x i8]
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @char_endianness() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_add_all_algorithms_noconf();
int /*<<< orphan*/ OPENSSL_config(int /*<<< orphan*/ *);
int /*<<< orphan*/ OpenSSL_add_all_ciphers();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void OpenSSL_SSL_init(void) {
  SSL_library_init();
  SSL_load_error_strings();
  OPENSSL_config(NULL);
  OpenSSL_add_all_ciphers();
  OPENSSL_add_all_algorithms_noconf();
}


x86 assembly (clang, -O0):
<OpenSSL_SSL_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SSL_library_init@plt>
mov    $0x0,%al
call   1070 <SSL_load_error_strings@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <OPENSSL_config@plt>
mov    $0x0,%al
call   1060 <OpenSSL_add_all_ciphers@plt>
mov    $0x0,%al
call   1050 <OPENSSL_add_all_algorithms_noconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenSSL_SSL_init>:
push   %rax
xor    %eax,%eax
call   1040 <SSL_library_init@plt>
xor    %eax,%eax
call   1070 <SSL_load_error_strings@plt>
xor    %edi,%edi
call   1030 <OPENSSL_config@plt>
xor    %eax,%eax
call   1060 <OpenSSL_add_all_ciphers@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <OPENSSL_add_all_algorithms_noconf@plt>

LLVM IR (-O0):
define void @OpenSSL_SSL_init() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @SSL_load_error_strings()
%3 = call i32 @OPENSSL_config(i32* null)
%4 = call i32 (...) @OpenSSL_add_all_ciphers()
%5 = call i32 (...) @OPENSSL_add_all_algorithms_noconf()
ret void
}

LLVM IR (-O2):
define void @OpenSSL_SSL_init() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @SSL_load_error_strings()
%3 = tail call i32 @OPENSSL_config(i32* null)
%4 = tail call i32 (...) @OpenSSL_add_all_ciphers()
%5 = tail call i32 (...) @OPENSSL_add_all_algorithms_noconf()
ret void
}
/* Variables and functions */
int f461(int *);
int f462(int *p) { return f461(p); }


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

x86 assembly (clang, -O2):
<f462>:
jmp    1030 <f461@plt>

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

LLVM IR (-O2):
define i32 @f462(i32* %0) {
%2 = tail call i32 @f461(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  {
    int a = 1;
    printf("loacl: a = %d\n", a);
  }
  printf("gloabl: a = %d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed0(%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
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"loacl: a = %d\0A\00"
@.str.1 = [16 x i8] c"gloabl: a = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
int test(int x) { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
ret i32 42
}
/* Variables and functions */
int init_relaxed();
int __init_relaxed(char *input) { return init_relaxed(); }


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

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

LLVM IR (-O0):
define i32 @__init_relaxed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @init_relaxed()
ret i32 %3
}

LLVM IR (-O2):
define i32 @__init_relaxed(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @init_relaxed()
ret i32 %2
}
void llmnr_exit(struct endpoint *ep) {}


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

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

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

LLVM IR (-O2):
%struct.endpoint = type opaque
define void @llmnr_exit(%struct.endpoint* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail_and_exit();
char *strdup(char const *);
char *cc_strdup(char const *string) {
  char *dupe = strdup(string);
  if (!dupe)
    fail_and_exit();
  ;
  return dupe;
}


x86 assembly (clang, -O0):
<cc_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <cc_strdup+0x2b>
mov    $0x0,%al
call   1030 <fail_and_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <cc_strdup+0x15>
xor    %eax,%eax
call   1030 <fail_and_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @cc_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @fail_and_exit()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void setup_cr4(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_cr4() {
ret void
}
void memcg_release_pages(struct kmem_cache *s, int order) {}


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

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

LLVM IR (-O0):
%struct.kmem_cache = type opaque
define void @memcg_release_pages(%struct.kmem_cache* %0, i32 %1) {
%3 = alloca %struct.kmem_cache*
%4 = alloca i32
store %struct.kmem_cache* %0, %struct.kmem_cache** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @memcg_release_pages(%struct.kmem_cache* nocapture %0, i32 %1) {
ret void
}
void macscp_expr(void) {
  int foo = -1;
  foo = 0;
  foo = 1;
  foo = 2;
}


x86 assembly (clang, -O0):
<macscp_expr>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @macscp_expr() {
ret void
}
void platform_teardown() {}


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

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

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

LLVM IR (-O2):
define void @platform_teardown() {
ret void
}
int test_imm_ABint64_lowword_mem(long long *val) {
  return ((*val) & (0xAB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ABint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xab,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ABint64_lowword_mem>:
testb  $0xab,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ABint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 171
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_ABint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 171
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *getenv(char const *);
const char *qgetenv(const char *envname, const char *defstr) {
  const char *envstr = getenv(envname);
  return (envstr) ? envstr : defstr;
}


x86 assembly (clang, -O0):
<qgetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <qgetenv+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    114d <qgetenv+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qgetenv>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @qgetenv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @getenv(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %5
br label %14
12: ; preds = %2
%13 = load i8*, i8** %4
br label %14
14: ; preds = %12, %10
%15 = phi i8* [ %11, %10 ], [ %13, %12 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @qgetenv(i8* nocapture %0, i8* readnone %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %1, i8* %3
ret i8* %5
}
/* Variables and functions */
int open(char const *, int);
int /*<<< orphan*/ quit(char *);
int _open(const char *pathname, int flags) {
  int fd;
  if ((fd = open(pathname, flags)) == -1)
    quit("open() failed");
  return fd;
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
jne    1153 <_open+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <quit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open>:
push   %rbx
call   1040 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <_open+0x19>
lea    0xecc(%rip),%rdi
call   1030 <quit@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"open() failed\00"
define i32 @_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @quit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
void foo50() {}


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

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

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

LLVM IR (-O2):
define void @foo50() {
ret void
}
/* Variables and functions */
int f67(int *);
int f68(int *p) { return f67(p); }


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

x86 assembly (clang, -O2):
<f68>:
jmp    1030 <f67@plt>

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

LLVM IR (-O2):
define i32 @f68(i32* %0) {
%2 = tail call i32 @f67(i32* %0)
ret i32 %2
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
struct strbuf **strbuf_split_buf(char const *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ strlen(char const *);
struct strbuf **strbuf_split_str(const char *str, int delim, int max) {
  return strbuf_split_buf(str, strlen(str), delim, max);
}


x86 assembly (clang, -O0):
<strbuf_split_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <strbuf_split_buf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_split_str>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strbuf_split_buf@plt>

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

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define %struct.strbuf** @strbuf_split_str(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call %struct.strbuf** @strbuf_split_buf(i8* %0, i32 %4, i32 %1, i32 %2)
ret %struct.strbuf** %5
}
void gtk_label_get_use_markup() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_get_use_markup() {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
void handle_sig(int sig) { printf("[%d] : signal : [%d]\n", getpid(), sig); }


x86 assembly (clang, -O0):
<handle_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sig>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"[%d] : signal : [%d]\0A\00"
define void @handle_sig(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
long func_modulus(long *value1, long *value2) { return (*value1 % *value2); }


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

x86 assembly (clang, -O2):
<func_modulus>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     111b <func_modulus+0x1b>
cqto
idiv   %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @func_modulus(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = srem i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @func_modulus(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = srem i64 %3, %4
ret i64 %5
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *memory_calloc(void *(*calloc_fct)(size_t, size_t), size_t nmemb,
                    size_t size) {
  return (calloc_fct) ? calloc_fct(nmemb, size) : calloc(nmemb, size);
}


x86 assembly (clang, -O0):
<memory_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <memory_calloc+0x36>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %rax,-0x20(%rbp)
jmp    1157 <memory_calloc+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_calloc>:
test   %rdi,%rdi
je     1120 <memory_calloc+0x10>
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    *%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @memory_calloc(i8* (i64, i64)* %0, i64 %1, i64 %2) {
%4 = icmp eq i8* (i64, i64)* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i8* %0(i64 %1, i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i8* @calloc(i64 %1, i64 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
void configChanged() {}


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

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

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

LLVM IR (-O2):
define void @configChanged() {
ret void
}
void gtk_text_attributes_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_attributes_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RESHLm(int);
void RES1HLm() { RESHLm(0x02); }


x86 assembly (clang, -O0):
<RES1HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <RESHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RES1HLm>:
mov    $0x2,%edi
jmp    1030 <RESHLm@plt>

LLVM IR (-O0):
define void @RES1HLm() {
%1 = call i32 @RESHLm(i32 2)
ret void
}

LLVM IR (-O2):
define void @RES1HLm() {
%1 = tail call i32 @RESHLm(i32 2)
ret void
}
char *langRomTypeSfg05() { return "Yamaha SFG-05"; }


x86 assembly (clang, -O0):
<langRomTypeSfg05>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeSfg05>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Yamaha SFG-05\00"
define i8* @langRomTypeSfg05() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"Yamaha SFG-05\00"
define i8* @langRomTypeSfg05() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ gmx_isdcmds(int, char **);
int main(int argc, char *argv[]) {
  gmx_isdcmds(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_isdcmds(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void DestroyBitfield(char *bitfield) {
  if (bitfield)
    free(bitfield);
}


x86 assembly (clang, -O0):
<DestroyBitfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <DestroyBitfield+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DestroyBitfield>:
test   %rdi,%rdi
je     111a <DestroyBitfield+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @DestroyBitfield(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @DestroyBitfield(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int to_orig(int p) {
  if (p < 0)
    return p;
  return p - p % 3;
}


x86 assembly (clang, -O0):
<to_orig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111c <to_orig+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <to_orig+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_orig>:
mov    %edi,%eax
test   %edi,%edi
js     1118 <to_orig+0x18>
mov    %eax,%eax
mov    $0xaaaaaaab,%ecx
imul   %rax,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,2),%eax
ret

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

LLVM IR (-O2):
define i32 @to_orig(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = urem i32 %0, 3
%5 = sub nsw i32 %0, %4
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int stringEq(char *str1, char *str2) {
  if (strcmp(str1, str2) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<stringEq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <stringEq+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <stringEq+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @stringEq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SysCtlIntClear(uint32_t ui32Ints) {
  (*((volatile unsigned long *)(0x400FE058))) = ui32Ints;
}


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

x86 assembly (clang, -O2):
<SysCtlIntClear>:
mov    %rdi,0x400fe058
40
ret

LLVM IR (-O0):
define void @SysCtlIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782296 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782296 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _HibernateIntNumberGet();
void HibernateIntUnregister(void) {
  uint32_t ui32Int;
  ui32Int = _HibernateIntNumberGet();
  ;
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<HibernateIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <_HibernateIntNumberGet@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <IntDisable@plt>
mov    -0x4(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntUnregister>:
push   %rbx
xor    %eax,%eax
call   1040 <_HibernateIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @HibernateIntUnregister() {
%1 = alloca i32
%2 = call i32 (...) @_HibernateIntNumberGet()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @IntDisable(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @IntUnregister(i32 %5)
ret void
}

LLVM IR (-O2):
define void @HibernateIntUnregister() {
%1 = tail call i32 (...) @_HibernateIntNumberGet()
%2 = tail call i32 @IntDisable(i32 %1)
%3 = tail call i32 @IntUnregister(i32 %1)
ret void
}
/* Variables and functions */
char intToHexChar(char);
char *byteToHexString(char b, char *s) {
  s[0] = intToHexChar((b >> 4) & 0xf);
  s[1] = intToHexChar(b & 0xf);
  s[2] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<byteToHexString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movsbl %al,%edi
call   1030 <intToHexChar@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movsbl %al,%edi
call   1030 <intToHexChar@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteToHexString>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ebp,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <intToHexChar@plt>
mov    %al,(%rbx)
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <intToHexChar@plt>
mov    %al,0x1(%rbx)
movb   $0x0,0x2(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @byteToHexString(i8 signext %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 = sext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = and i32 %7, 15
%9 = trunc i32 %8 to i8
%10 = call signext i8 @intToHexChar(i8 signext %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = and i32 %14, 15
%16 = trunc i32 %15 to i8
%17 = call signext i8 @intToHexChar(i8 signext %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 0, i8* %21
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @byteToHexString(i8 signext %0, i8* returned writeonly %1) {
%3 = lshr i8 %0, 4
%4 = tail call signext i8 @intToHexChar(i8 signext %3)
store i8 %4, i8* %1
%5 = and i8 %0, 15
%6 = tail call signext i8 @intToHexChar(i8 signext %5)
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 2
store i8 0, i8* %8
ret i8* %1
}
/* Variables and functions */
float atan2(float, float);
int fabs(float);
float f_atan2(float y, float x) {
  return (fabs(y) < 1e-5 && fabs(x) < 1e-5) ? 0.0f : atan2(y, x);
}


x86 assembly (clang, -O0):
<f_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeb8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117f <f_atan2+0x5f>
movss  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe98(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117f <f_atan2+0x5f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1193 <f_atan2+0x73>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_atan2>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1040 <fabs@plt>
test   %eax,%eax
jg     1143 <f_atan2+0x23>
movss  (%rsp),%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    1154 <f_atan2+0x34>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
pop    %rax
jmp    1030 <atan2@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f_atan2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call i32 @fabs(float %5)
%7 = sitofp i32 %6 to double
%8 = fcmp olt double %7, 1.000000e-05
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load float, float* %4
%11 = call i32 @fabs(float %10)
%12 = sitofp i32 %11 to double
%13 = fcmp olt double %12, 1.000000e-05
br i1 %13, label %14, label %15
14: ; preds = %9
br label %19
15: ; preds = %9, %2
%16 = load float, float* %3
%17 = load float, float* %4
%18 = call float @atan2(float %16, float %17)
br label %19
19: ; preds = %15, %14
%20 = phi float [ 0.000000e+00, %14 ], [ %18, %15 ]
ret float %20
}

LLVM IR (-O2):
define float @f_atan2(float %0, float %1) {
%3 = tail call i32 @fabs(float %0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @fabs(float %1)
%7 = icmp slt i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5, %2
%9 = tail call float @atan2(float %0, float %1)
br label %10
10: ; preds = %5, %8
%11 = phi float [ %9, %8 ], [ 0.000000e+00, %5 ]
ret float %11
}
void g_key_file_get_value() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_get_value() {
ret void
}
int inevent_process(void) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @inevent_process() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arg_sf(void) { printf("sf\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"sf\00"
define void @arg_sf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
char *strcpy(char *dst, const char *src) {
  while (*src)
    *dst++ = *src++;
  *dst = 0;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcpy+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <strcpy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define noalias i8* @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* undef
}
double test_fdim(double x, double y) { return __builtin_fdim(x, y); }


x86 assembly (clang, -O0):
<test_fdim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fdim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fdim>:
jmp    1030 <fdim@plt>

LLVM IR (-O0):
define double @test_fdim(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 = call double @fdim(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @test_fdim(double %0, double %1) {
%3 = tail call double @fdim(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "\nUsage: primes method number {print}\n\n"
          "method: 	use either processes or threads to calculate primes\n"
          "		valid options: thread or process\n"
          "number: 	number of processes/threads to use\n"
          "		valid range processes: [1-%d] threads: [1-%d]\n\n",
          (int)200, (int)200);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    $0xc8,%ecx
mov    %ecx,%edx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0xc8,%edx
mov    $0xc8,%ecx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [228 x i8] c"\0AUsage: primes method number {print}\0A\0Amethod: \09use either processes or threads to calculate primes\0A\09\09valid options: thread or process\0Anumber: \09number of processes/threads to use\0A\09\09valid range processes: [1-%d] threads: [1-%d]\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([228 x i8], [228 x i8]* @.str, i64 0, i64 0), i32 200, i32 200)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [228 x i8] c"\0AUsage: primes method number {print}\0A\0Amethod: \09use either processes or threads to calculate primes\0A\09\09valid options: thread or process\0Anumber: \09number of processes/threads to use\0A\09\09valid range processes: [1-%d] threads: [1-%d]\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([228 x i8], [228 x i8]* @.str, i64 0, i64 0), i32 200, i32 200)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int m2_max(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}


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

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

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

LLVM IR (-O2):
define i32 @m2_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t h265hvcc_get_constraint_indicator(const uint8_t *p) {
  return ((uint64_t)p[6] << 40) | ((uint64_t)p[7] << 32) |
         ((uint64_t)p[8] << 24) | ((uint64_t)p[9] << 16) |
         ((uint64_t)p[10] << 8) | (uint64_t)p[11];
}


x86 assembly (clang, -O0):
<h265hvcc_get_constraint_indicator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    $0x28,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
mov    0x38(%rcx),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x40(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x48(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x50(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x58(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @h265hvcc_get_constraint_indicator(i64* nocapture readnone %0) {
ret i32 poison
}