xunge/DecIR huggingface dataset:
int __attribute__((target("arch=tremont"))) foo(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 5
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 5
}
void _wool_unbundled_mf(void) {}


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

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

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

LLVM IR (-O2):
define void @_wool_unbundled_mf() {
ret void
}
int test_imm_24int8_reg(signed char val) {
  return ((val) & (0x24 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_24int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x24,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_24int8_reg>:
test   $0x24,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_24int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 36
%6 = icmp ne i32 %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_24int8_reg(i8 signext %0) {
%2 = and i8 %0, 36
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void OutputToDebugTerminal(char *instruction_name) {
  printf("%s\n", instruction_name);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @OutputToDebugTerminal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void __DELETE_java_nio_charset_CharsetEncoder(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_nio_charset_CharsetEncoder(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 @__DELETE_java_nio_charset_CharsetEncoder(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *mg_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *mg_strdup(const char *str) { return mg_strndup(str, strlen(str)); }


x86 assembly (clang, -O0):
<mg_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <mg_strndup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <mg_strndup@plt>

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

LLVM IR (-O2):
define i8* @mg_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @mg_strndup(i8* %0, i32 %2)
ret i8* %3
}
int main() {
  int a;
  int b;
  a = 1;
  b = a + 2;
  return b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ cleanUpVertexEnum();
void cleanUpLinSupport() { cleanUpVertexEnum(); }


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

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

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

LLVM IR (-O2):
define void @cleanUpLinSupport() {
%1 = tail call i32 (...) @cleanUpVertexEnum()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ X509_FLAG_COMPAT;
int X509_REQ_print_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XN_FLAG_COMPAT;
int X509_REQ_print(BIO *bp, X509_REQ *x) {
  return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
}


x86 assembly (clang, -O0):
<X509_REQ_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
call   1030 <X509_REQ_print_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_REQ_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <X509_REQ_print_ex@plt>

LLVM IR (-O0):
@XN_FLAG_COMPAT = global i32 0
@X509_FLAG_COMPAT = global i32 0
define i32 @X509_REQ_print(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* @XN_FLAG_COMPAT
%8 = load i32, i32* @X509_FLAG_COMPAT
%9 = call i32 @X509_REQ_print_ex(i32* %5, i32* %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@XN_FLAG_COMPAT = global i32 0
@X509_FLAG_COMPAT = global i32 0
define i32 @X509_REQ_print(i32* %0, i32* %1) {
%3 = load i32, i32* @XN_FLAG_COMPAT
%4 = load i32, i32* @X509_FLAG_COMPAT
%5 = tail call i32 @X509_REQ_print_ex(i32* %0, i32* %1, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid(unsigned int *, unsigned int *, unsigned int *,
                           unsigned int *);
__attribute__((always_)) void cpuid(unsigned int op, unsigned int *eax,
                                    unsigned int *ebx, unsigned int *ecx,
                                    unsigned int *edx) {
  *eax = op;
  *ecx = 0;
  __cpuid(eax, ebx, ecx, edx);
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <__cpuid@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    %edi,(%rsi)
movl   $0x0,(%rcx)
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <__cpuid@plt>

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32*, i32** %9
store i32 0, i32* %13
%14 = load i32*, i32** %7
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = call i32 @__cpuid(i32* %14, i32* %15, i32* %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
store i32 %0, i32* %1
store i32 0, i32* %3
%6 = tail call i32 @__cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
long recur_Fact(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  long int fact;
  printf("Enter number to get factorial of: ");
  scanf("%d", &number);
  fact = recur_Fact(number);
  printf("Factorial of %d is:  %ld\n", number, fact);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <recur_Fact@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"Enter number to get factorial of: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Factorial of %d is: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i64 @recur_Fact(i32 %6)
store i64 %7, i64* %3
%8 = load i32, i32* %2
%9 = load i64, i64* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Enter number to get factorial of: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Factorial of %d is: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @recur_Fact(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %7, i64 %6)
ret i32 0
}
/* Type definitions */
struct peer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ peer_broadcast_all_tx(struct peer *);
int peer_send_getblocks(struct peer *);
int peer_send_mempool(struct peer *);
int peer_on_ready(struct peer *peer) {
  int res;
  res = peer_send_mempool(peer);
  if (res) {
    return res;
  }
  peer_broadcast_all_tx(peer);
  return peer_send_getblocks(peer);
}


x86 assembly (clang, -O0):
<peer_on_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <peer_send_mempool@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115d <peer_on_ready+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <peer_on_ready+0x42>
mov    -0x10(%rbp),%rdi
call   1030 <peer_broadcast_all_tx@plt>
mov    -0x10(%rbp),%rdi
call   1040 <peer_send_getblocks@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peer_on_ready>:
push   %rbx
mov    %rdi,%rbx
call   1050 <peer_send_mempool@plt>
test   %eax,%eax
je     113f <peer_on_ready+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <peer_broadcast_all_tx@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <peer_send_getblocks@plt>

LLVM IR (-O0):
%struct.peer = type { i32 }
define i32 @peer_on_ready(%struct.peer* %0) {
%2 = alloca i32
%3 = alloca %struct.peer*
%4 = alloca i32
store %struct.peer* %0, %struct.peer** %3
%5 = load %struct.peer*, %struct.peer** %3
%6 = call i32 @peer_send_mempool(%struct.peer* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load %struct.peer*, %struct.peer** %3
%13 = call i32 @peer_broadcast_all_tx(%struct.peer* %12)
%14 = load %struct.peer*, %struct.peer** %3
%15 = call i32 @peer_send_getblocks(%struct.peer* %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.peer = type { i32 }
define i32 @peer_on_ready(%struct.peer* %0) {
%2 = tail call i32 @peer_send_mempool(%struct.peer* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @peer_broadcast_all_tx(%struct.peer* %0)
%6 = tail call i32 @peer_send_getblocks(%struct.peer* %0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ %2, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void *logger_not_avail(int err) {
  fprintf(stderr, "Logger not available now: %d\n", err);
  exit(err);
  return NULL;
}


x86 assembly (clang, -O0):
<logger_not_avail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<logger_not_avail>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Logger not available now: %d\0A\00"
define i8* @logger_not_avail(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Logger not available now: %d\0A\00"
define noalias i8* @logger_not_avail(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello, World");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void FLUSHOUT() {
  fflush(stdout);
  return;
}


x86 assembly (clang, -O0):
<FLUSHOUT>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLUSHOUT>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @FLUSHOUT() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @FLUSHOUT() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CRL_DIST_POINTS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ CRL_DIST_POINTS_it;
CRL_DIST_POINTS *d2i_CRL_DIST_POINTS(CRL_DIST_POINTS **a,
                                     const unsigned char **in, long len) {
  return (CRL_DIST_POINTS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                          &CRL_DIST_POINTS_it);
}


x86 assembly (clang, -O0):
<d2i_CRL_DIST_POINTS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_CRL_DIST_POINTS>:
mov    0x2ed9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@CRL_DIST_POINTS_it = global i32 0
define i32* @d2i_CRL_DIST_POINTS(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @CRL_DIST_POINTS_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@CRL_DIST_POINTS_it = global i32 0
define i32* @d2i_CRL_DIST_POINTS(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @CRL_DIST_POINTS_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int beers;
int /*<<< orphan*/ chug(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
main() {
  register beers;
  for (beers = (99); beers; chug(beers--))
    puts("");
  puts("\nTime to buy more beer!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x63,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1171 <main+0x41>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
call   1030 <chug@plt>
jmp    1146 <main+0x16>
lea    0xe88(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x63,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %ebx,%edi
call   1030 <chug@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x10>
lea    0xe93(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [25 x i8] c"\0ATime to buy more beer!\0A\00"
@beers = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 99, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
%11 = call i32 @chug(i32 %9)
br label %3
12: ; preds = %3
%13 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"\0ATime to buy more beer!\0A\00"
@beers = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 99, %0 ], [ %4, %1 ]
%3 = tail call i32 @putchar(i32 10)
%4 = add nsw i32 %2, -1
%5 = tail call i32 @chug(i32 %2)
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int rtcClearPeriodicEvent(void) {
  (*((volatile unsigned int *const)(0x40010a00 + 0x10))) &= (1 << 8);
  return 0;
}


x86 assembly (clang, -O0):
<rtcClearPeriodicEvent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40010a10,%eax
mov    (%rax),%ecx
and    $0x100,%ecx
mov    $0x40010a10,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcClearPeriodicEvent>:
andl   $0x100,0x40010a10
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rtcClearPeriodicEvent() {
%1 = load volatile i32, i32* inttoptr (i64 1073809936 to i32*)
%2 = and i32 %1, 256
store volatile i32 %2, i32* inttoptr (i64 1073809936 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @rtcClearPeriodicEvent() {
%1 = load volatile i32, i32* inttoptr (i64 1073809936 to i32*)
%2 = and i32 %1, 256
store volatile i32 %2, i32* inttoptr (i64 1073809936 to i32*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char);
int /*<<< orphan*/ expr(int);
int symbol();
void pexpr() {
  if (symbol() == 6) {
    expr(15);
    if (symbol() == 7)
      return;
  }
  error('()');
}


x86 assembly (clang, -O0):
<pexpr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <symbol@plt>
cmp    $0x6,%eax
jne    1168 <pexpr+0x38>
mov    $0xf,%edi
call   1030 <expr@plt>
mov    $0x0,%al
call   1050 <symbol@plt>
cmp    $0x7,%eax
jne    1163 <pexpr+0x33>
jmp    1172 <pexpr+0x42>
jmp    1168 <pexpr+0x38>
mov    $0x29,%edi
call   1040 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pexpr>:
push   %rax
xor    %eax,%eax
call   1050 <symbol@plt>
cmp    $0x6,%eax
jne    1155 <pexpr+0x25>
mov    $0xf,%edi
call   1030 <expr@plt>
xor    %eax,%eax
call   1050 <symbol@plt>
cmp    $0x7,%eax
jne    1155 <pexpr+0x25>
pop    %rax
ret
mov    $0x29,%edi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
define void @pexpr() {
%1 = call i32 (...) @symbol()
%2 = icmp eq i32 %1, 6
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i32 @expr(i32 15)
%5 = call i32 (...) @symbol()
%6 = icmp eq i32 %5, 7
br i1 %6, label %7, label %8
7: ; preds = %3
br label %11
8: ; preds = %3
br label %9
9: ; preds = %8, %0
%10 = call i32 @error(i8 signext 41)
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @pexpr() {
%1 = tail call i32 (...) @symbol()
%2 = icmp eq i32 %1, 6
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @expr(i32 15)
%5 = tail call i32 (...) @symbol()
%6 = icmp eq i32 %5, 7
br i1 %6, label %9, label %7
7: ; preds = %3, %0
%8 = tail call i32 @error(i8 signext 41)
br label %9
9: ; preds = %3, %7
ret void
}
void caller(void *arg) {
  void (*func)(void) = (void *)(void *)arg;
  func();
}


x86 assembly (clang, -O0):
<caller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller>:
jmp    *%rdi

LLVM IR (-O0):
define void @caller(i8* %0) {
%2 = alloca i8*
%3 = alloca void ()*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to void ()*
store void ()* %5, void ()** %3
%6 = load void ()*, void ()** %3
ret void
}

LLVM IR (-O2):
define void @caller(i8* nocapture %0) {
%2 = bitcast i8* %0 to void ()*
tail call void %2()
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *gnu_basename(const char *path) {
  const char *last_slash = strrchr(path, '/');
  if (!last_slash)
    return path;
  return last_slash + 1;
}


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

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

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

LLVM IR (-O2):
define i8* @gnu_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
double f_seal_ClampDegrees(double const);
double f_seal_AddDegrees(const double a, const double b) {
  return f_seal_ClampDegrees(a + b);
}


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

x86 assembly (clang, -O2):
<f_seal_AddDegrees>:
addsd  %xmm1,%xmm0
jmp    1030 <f_seal_ClampDegrees@plt>

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

LLVM IR (-O2):
define double @f_seal_AddDegrees(double %0, double %1) {
%3 = fadd double %0, %1
%4 = tail call double @f_seal_ClampDegrees(double %3)
ret double %4
}
int getpgrp() {}


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

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

LLVM IR (-O0):
define i32 @getpgrp() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @getpgrp() {
ret i32 undef
}
int execute_inotify_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_inotify_init() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
FILE *open_file(const char *filename, const char *mode) {
  FILE *fp;
  fp = fopen(filename, mode);
  if (fp == NULL) {
    printf("Error - can'jjt open or create file: %s\n", filename);
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <open_file+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <open_file+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Error - can'jjt open or create file: %s\0A\00"
define i32* @open_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [41 x i8] c"Error - can'jjt open or create file: %s\0A\00"
define noalias i32* @open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ floor(double);
scalar_t__ rand();
float get_random_number(int min, int max) {
  return (float)floor(
      (double)(min + (max - min + 1) * ((float)rand() / (float)RAND_MAX)));
}


x86 assembly (clang, -O0):
<get_random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtsi2ss %rax,%xmm2
mov    0x2e81(%rip),%rax
cvtsi2ssq (%rax),%xmm3
divss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <floor@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_number>:
push   %rax
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x4(%rsp)
sub    %edi,%esi
add    $0x1,%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2e96(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @get_random_number(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to float
%12 = call i64 (...) @rand()
%13 = sitofp i64 %12 to float
%14 = load i64, i64* @RAND_MAX
%15 = sitofp i64 %14 to float
%16 = fdiv float %13, %15
%17 = call float @llvm.fmuladd.f32(float %11, float %16, float %6)
%18 = fpext float %17 to double
%19 = call i64 @floor(double %18)
%20 = sitofp i64 %19 to float
ret float %20
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @get_random_number(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = sitofp i32 %5 to float
%7 = tail call i64 (...) @rand()
%8 = sitofp i64 %7 to float
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to float
%11 = fdiv float %8, %10
%12 = tail call float @llvm.fmuladd.f32(float %6, float %11, float %3)
%13 = fpext float %12 to double
%14 = tail call i64 @floor(double %13)
%15 = sitofp i64 %14 to float
ret float %15
}
/* Variables and functions */
char *malloc(size_t);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strcpy_new(const char *s) {
  size_t n = 1 + strlen(s);
  char *p = malloc(n * sizeof(char));
  strncpy(p, s, n);
  return p;
}


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

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

LLVM IR (-O0):
define i8* @strcpy_new(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 1, %6
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = mul i64 %9, 1
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = call i32 @strncpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @strcpy_new(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* @malloc(i64 %4)
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
adr0adrx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*((short *)10000000)) <=
      (((short *)(11111111 & ~(__alignof__(short) - 1)))[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movswl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac6,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1148 <adr0adrx1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <adr0adrx1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1>:
movzwl 0x989680,%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac6(%rcx,%rcx,1),%dx
setle  %al
ret

LLVM IR (-O0):
define i32 @adr0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 10000000 to i16*)
%17 = sext i16 %16 to i32
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i16, i16* inttoptr (i64 11111110 to i16*), i64 %19
%21 = load i16, i16* %20
%22 = sext i16 %21 to i32
%23 = icmp sle i32 %17, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @adr0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* inttoptr (i64 11111110 to i16*), i64 %8
%10 = load i16, i16* %9
%11 = icmp sle i16 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int iasecc_se_get_crt() { return -1408; }


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

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

LLVM IR (-O0):
define i32 @iasecc_se_get_crt() {
ret i32 -1408
}

LLVM IR (-O2):
define i32 @iasecc_se_get_crt() {
ret i32 -1408
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *fopen(const char *fname, const char *prot) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i32* @fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32* null
}
char dec2hex(short int c) {
  if (0 <= c && c <= 9) {
    return c + '0';
  } else if (10 <= c && c <= 15) {
    return c + 'A' - 10;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<dec2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1135 <dec2hex+0x35>
movswl -0x4(%rbp),%eax
cmp    $0x9,%eax
jg     1135 <dec2hex+0x35>
movswl -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1169 <dec2hex+0x69>
movswl -0x4(%rbp),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jg     1165 <dec2hex+0x65>
movswl -0x4(%rbp),%eax
cmp    $0xf,%eax
jg     1165 <dec2hex+0x65>
movswl -0x4(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1169 <dec2hex+0x69>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec2hex>:
cmp    $0x9,%di
ja     110c <dec2hex+0xc>
add    $0x30,%dil
jmp    111b <dec2hex+0x1b>
lea    -0xa(%rdi),%ecx
mov    $0xff,%al
cmp    $0x5,%cx
ja     111d <dec2hex+0x1d>
add    $0x37,%dil
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @dec2hex(i16 signext %0) {
%2 = icmp ult i16 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i16 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %12
6: ; preds = %1
%7 = add i16 %0, -10
%8 = icmp ult i16 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = trunc i16 %0 to i8
%11 = add nuw nsw i8 %10, 55
br label %12
12: ; preds = %6, %9, %3
%13 = phi i8 [ %5, %3 ], [ %11, %9 ], [ -1, %6 ]
ret i8 %13
}
_Complex double f27(void) {}


x86 assembly (clang, -O0):
<f27>:
push   %rbp
mov    %rsp,%rbp
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

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

LLVM IR (-O0):
define { double, double } @f27() {
%1 = alloca { double, double }
%2 = load { double, double }, { double, double }* %1
ret { double, double } %2
}

LLVM IR (-O2):
define { double, double } @f27() {
ret { double, double } undef
}
int fun800() { return 800; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x320,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x320,%eax
ret

LLVM IR (-O0):
define i32 @fun800() {
ret i32 800
}

LLVM IR (-O2):
define i32 @fun800() {
ret i32 800
}
/* Variables and functions */
int ENODEV;
int acpi_get_gpio(char *path, int pin) { return -ENODEV; }


x86 assembly (clang, -O0):
<acpi_get_gpio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<acpi_get_gpio>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @acpi_get_gpio(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
void half_success_tear_down(struct mu_test_desc *desc) {}


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

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

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

LLVM IR (-O2):
%struct.mu_test_desc = type opaque
define void @half_success_tear_down(%struct.mu_test_desc* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ CPLHaveRuntimeAVX2();
int main() {
  if (CPLHaveRuntimeAVX2()) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <CPLHaveRuntimeAVX2@plt>
cmp    $0x0,%rax
je     113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <main+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @CPLHaveRuntimeAVX2()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct oscap_stringlist_iterator {
  int dummy;
};
struct oscap_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oscap_iterator_reset(struct oscap_iterator *);
void oscap_stringlist_iterator_reset(struct oscap_stringlist_iterator *it) {
  oscap_iterator_reset(((struct oscap_iterator *)(it)));
}


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

x86 assembly (clang, -O2):
<oscap_stringlist_iterator_reset>:
jmp    1030 <oscap_iterator_reset@plt>

LLVM IR (-O0):
%struct.oscap_stringlist_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define void @oscap_stringlist_iterator_reset(%struct.oscap_stringlist_iterator* %0) {
%2 = alloca %struct.oscap_stringlist_iterator*
store %struct.oscap_stringlist_iterator* %0, %struct.oscap_stringlist_iterator** %2
%3 = load %struct.oscap_stringlist_iterator*, %struct.oscap_stringlist_iterator** %2
%4 = bitcast %struct.oscap_stringlist_iterator* %3 to %struct.oscap_iterator*
%5 = call i32 @oscap_iterator_reset(%struct.oscap_iterator* %4)
ret void
}

LLVM IR (-O2):
%struct.oscap_stringlist_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define void @oscap_stringlist_iterator_reset(%struct.oscap_stringlist_iterator* %0) {
%2 = bitcast %struct.oscap_stringlist_iterator* %0 to %struct.oscap_iterator*
%3 = tail call i32 @oscap_iterator_reset(%struct.oscap_iterator* %2)
ret void
}
/* Variables and functions */
float readFloat();
int /*<<< orphan*/ writeCommand(char *);
float battery(void) {
  float tension;
  writeCommand("BAT");
  tension = readFloat();
  return tension;
}


x86 assembly (clang, -O0):
<battery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <writeCommand@plt>
mov    $0x0,%al
call   1040 <readFloat@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<battery>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeCommand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <readFloat@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"BAT\00"
define float @battery() {
%1 = alloca float
%2 = call i32 @writeCommand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call float (...) @readFloat()
store float %3, float* %1
%4 = load float, float* %1
ret float %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"BAT\00"
define float @battery() {
%1 = tail call i32 @writeCommand(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call float (...) @readFloat()
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mul_epu32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_srli_epi64(int /*<<< orphan*/, int);
__m128i k_madd_epi32(__m128i a, __m128i b) {
  __m128i buf0, buf1;
  buf0 = _mm_mul_epu32(a, b);
  a = _mm_srli_epi64(a, 32);
  b = _mm_srli_epi64(b, 32);
  buf1 = _mm_mul_epu32(a, b);
  return _mm_add_epi64(buf0, buf1);
}


x86 assembly (clang, -O0):
<k_madd_epi32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_mul_epu32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
call   1030 <_mm_srli_epi64@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x20,%esi
call   1030 <_mm_srli_epi64@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_mul_epu32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <_mm_add_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_madd_epi32>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <_mm_mul_epu32@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    $0x20,%esi
call   1030 <_mm_srli_epi64@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x20,%esi
call   1030 <_mm_srli_epi64@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <_mm_mul_epu32@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <_mm_add_epi64@plt>

LLVM IR (-O0):
define i32 @k_madd_epi32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @_mm_mul_epu32(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = call i32 @_mm_srli_epi64(i32 %10, i32 32)
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @_mm_srli_epi64(i32 %12, i32 32)
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @_mm_mul_epu32(i32 %14, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @_mm_add_epi64(i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @k_madd_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mul_epu32(i32 %0, i32 %1)
%4 = tail call i32 @_mm_srli_epi64(i32 %0, i32 32)
%5 = tail call i32 @_mm_srli_epi64(i32 %1, i32 32)
%6 = tail call i32 @_mm_mul_epu32(i32 %4, i32 %5)
%7 = tail call i32 @_mm_add_epi64(i32 %3, i32 %6)
ret i32 %7
}
void gdk_threads_leave() {}


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

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

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

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