xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void fclose_nrv(void *fp) { fclose((FILE *)fp); }


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

x86 assembly (clang, -O2):
<fclose_nrv>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @fclose_nrv(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
struct mcs {
  int dummy;
};

/* Variables and functions */
struct mcs *init_mcs() {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.mcs = type { i32 }
define %struct.mcs* @init_mcs() {
ret %struct.mcs* null
}

LLVM IR (-O2):
%struct.mcs = type { i32 }
define noalias %struct.mcs* @init_mcs() {
ret %struct.mcs* null
}
/* Variables and functions */
int /*<<< orphan*/ UART0_putc(char);
void UART0_puts(char *s) {
  for (; *s != '\0'; s++) {
    UART0_putc(*s);
  }
}


x86 assembly (clang, -O0):
<UART0_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <UART0_puts+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <UART0_putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <UART0_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART0_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <UART0_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <UART0_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <UART0_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @UART0_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @UART0_putc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int chdir(char const *);
int main(int argc, const char *argv[]) {
  if (argc < 2)
    return (1);
  if (chdir(argv[1]) != -1)
    return (2);
  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)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
je     115e <main+0x4e>
movl   $0x2,-0x4(%rbp)
jmp    1165 <main+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1134 <main+0x24>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <chdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
setne  %al
add    %eax,%eax
add    $0x8,%rsp
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 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %17
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @chdir(i8* %12)
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 2, i32* %3
br label %17
16: ; preds = %9
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @chdir(i8* %6)
%8 = icmp eq i32 %7, -1
%9 = select i1 %8, i32 0, i32 2
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ 1, %2 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
size_t CRYPTO_secure_used(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @CRYPTO_secure_used() {
ret i64 0
}

LLVM IR (-O2):
define i64 @CRYPTO_secure_used() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ SHA1(char *, int, unsigned char *);
int SHA_DIGEST_LENGTH;
int /*<<< orphan*/ memcmp(unsigned char *, unsigned char *, int);
int verify_piece(char piece[], unsigned char expected_sha[], int piece_length) {
  unsigned char hash[SHA_DIGEST_LENGTH];
  SHA1(piece, piece_length, hash);
  return !memcmp(hash, expected_sha, SHA_DIGEST_LENGTH);
}


x86 assembly (clang, -O0):
<verify_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <SHA1@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6e(%rip),%rax
mov    (%rax),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_piece>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x2eb4(%rip),%r15
mov    (%r15),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %edx,%esi
mov    %rbx,%rdx
call   1040 <SHA1@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SHA_DIGEST_LENGTH = global i32 0
define i32 @verify_piece(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i32, i32* @SHA_DIGEST_LENGTH
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %7
%12 = alloca i8, i64 %10
store i64 %10, i64* %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = call i32 @SHA1(i8* %13, i32 %14, i8* %12)
%16 = load i8*, i8** %5
%17 = load i32, i32* @SHA_DIGEST_LENGTH
%18 = call i32 @memcmp(i8* %12, i8* %16, i32 %17)
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = load i8*, i8** %7
ret i32 %21
}

LLVM IR (-O2):
@SHA_DIGEST_LENGTH = global i32 0
define i32 @verify_piece(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @SHA_DIGEST_LENGTH
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = call i32 @SHA1(i8* %0, i32 %2, i8* %6)
%8 = load i32, i32* @SHA_DIGEST_LENGTH
%9 = call i32 @memcmp(i8* %6, i8* %1, i32 %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("Usage: %s [OPTIONS] PROGRAM\n", name);
  printf("Options:\n"
         "  -t TIME_LIMIT in ms, positive int only (default: 1000)\n"
         "  -m MEMORY_LIMIT in kb, positive int only (default: 131072)\n"
         "  -i INPUT_PATH\n"
         "  -o OUTPUT_PATH\n"
         "  -h print this help\n\n"
         "Output:\n"
         "  1. exited: WEXITSTATUS TIME(ms) MEMORY(KB)\n"
         "  2. killed: message\n"
         "Notes: PROGRAM must be compiled statically!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: %s [OPTIONS] PROGRAM\0A\00"
@.str.1 = [301 x i8] c"Options:\0A -t TIME_LIMIT in ms, positive int only (default: 1000)\0A -m MEMORY_LIMIT in kb, positive int only (default: 131072)\0A -i INPUT_PATH\0A -o OUTPUT_PATH\0A -h print this help\0A\0AOutput:\0A 1. exited: WEXITSTATUS TIME(ms) MEMORY(KB)\0A 2. killed: message\0ANotes: PROGRAM must be compiled statically!\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([301 x i8], [301 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: %s [OPTIONS] PROGRAM\0A\00"
@str = [300 x i8] c"Options:\0A -t TIME_LIMIT in ms, positive int only (default: 1000)\0A -m MEMORY_LIMIT in kb, positive int only (default: 131072)\0A -i INPUT_PATH\0A -o OUTPUT_PATH\0A -h print this help\0A\0AOutput:\0A 1. exited: WEXITSTATUS TIME(ms) MEMORY(KB)\0A 2. killed: message\0ANotes: PROGRAM must be compiled statically!\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([300 x i8], [300 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
int report_error(const char *str) {
  fprintf(stderr, "%s: %s\n", str, strerror(errno));
  return errno;
}


x86 assembly (clang, -O0):
<report_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_error>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea1(%rip),%r14
mov    (%r14),%edi
call   1040 <strerror@plt>
lea    0xeba(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    (%r14),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define i32 @report_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @errno
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define i32 @report_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @errno
ret i32 %6
}
/* Variables and functions */
float __nv_cospif(float);
float cospif(float __a) { return __nv_cospif(__a); }


x86 assembly (clang, -O0):
<cospif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_cospif@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cospif>:
jmp    1030 <__nv_cospif@plt>

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

LLVM IR (-O2):
define float @cospif(float %0) {
%2 = tail call float @__nv_cospif(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void outl(uint32_t value, uint16_t port) {}


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

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

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

LLVM IR (-O2):
define void @outl(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ nrf_802154_swi_notify_received(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/,
                                                  int /*<<< orphan*/);
void nrf_802154_notify_received(uint8_t *p_data, int8_t power, int8_t lqi) {
  nrf_802154_swi_notify_received(p_data, power, lqi);
}


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

x86 assembly (clang, -O2):
<nrf_802154_notify_received>:
jmp    1030 <nrf_802154_swi_notify_received@plt>

LLVM IR (-O0):
define void @nrf_802154_notify_received(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @nrf_802154_swi_notify_received(i32* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @nrf_802154_notify_received(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @nrf_802154_swi_notify_received(i32* %0, i32 %1, i32 %2)
ret void
}
int test_imm_8Buint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x8B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Buint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 139
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((always_)) unsigned int inl_p(unsigned short port) {
  unsigned int _v;
  asm volatile("in"
               "l"
               " %"
               "w"
               "1,%"
               ""
               "0"
               : "=a"(_v)
               : "Nd"(port));
  slow_down_io();
  return _v;
}


x86 assembly (clang, -O0):
<inl_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl_p>:
push   %rbx
mov    %edi,%edx
in     (%dx),%eax
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @inl_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @inl_p(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i32 %2
}
void CharToHex(unsigned int c, unsigned char *hexBuf) {
  const unsigned char *hexchar = (const unsigned char *)"0123456789ABCDEF";
  hexBuf[0] = hexchar[c >> 4];
  hexBuf[1] = hexchar[c & 0x0F];
}


x86 assembly (clang, -O0):
<CharToHex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharToHex>:
mov    %edi,%eax
mov    %rax,%rcx
shr    $0x4,%rcx
lea    0xef0(%rip),%rdx
mov    (%rcx,%rdx,1),%cl
mov    %cl,(%rsi)
and    $0xf,%eax
mov    (%rax,%rdx,1),%al
mov    %al,0x1(%rsi)
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define void @CharToHex(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = load i32, i32* %3
%8 = lshr i32 %7, 4
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8*, i8** %5
%15 = load i32, i32* %3
%16 = and i32 %15, 15
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 %19, i8* %21
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define void @CharToHex(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 4
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
store i8 %6, i8* %1
%7 = and i32 %0, 15
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
ret void
}
void Timer_Init() {}


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

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

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

LLVM IR (-O2):
define void @Timer_Init() {
ret void
}
long double return_long_double() { return 3.14; }


x86 assembly (clang, -O0):
<return_long_double>:
push   %rbp
mov    %rsp,%rbp
fldl   0xef6(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_long_double>:
fldl   0xefa(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @return_long_double() {
ret x86_fp80 0xK4000C8F5C28F5C28F800
}

LLVM IR (-O2):
define x86_fp80 @return_long_double() {
ret x86_fp80 0xK4000C8F5C28F5C28F800
}
void glActiveTexture(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glActiveTexture() {
ret void
}
/* Variables and functions */
int check_fa_mid(char const *);
int check_fa(char *unused) {
  const char c = 0;
  return check_fa_mid(&c);
}


x86 assembly (clang, -O0):
<check_fa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0x9(%rbp),%rdi
call   1030 <check_fa_mid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_fa>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <check_fa_mid@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_fa(i8* nocapture readnone %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @check_fa_mid(i8* %2)
ret i32 %3
}
/* Variables and functions */
unsigned char v_readl(int);
unsigned char Permedia2ReadData(void) {
  do {
    int delay = 5;
    unsigned char tmp;
    while (delay--) {
      tmp = v_readl(0x0018);
    };
  } while (0);
  return (v_readl(0x4008));
}


x86 assembly (clang, -O0):
<Permedia2ReadData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1145 <Permedia2ReadData+0x35>
mov    $0x18,%edi
call   1030 <v_readl@plt>
mov    %al,-0x5(%rbp)
jmp    111f <Permedia2ReadData+0xf>
jmp    114a <Permedia2ReadData+0x3a>
mov    $0x4008,%edi
call   1030 <v_readl@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Permedia2ReadData>:
push   %rax
mov    $0x18,%edi
call   1030 <v_readl@plt>
mov    $0x18,%edi
call   1030 <v_readl@plt>
mov    $0x18,%edi
call   1030 <v_readl@plt>
mov    $0x18,%edi
call   1030 <v_readl@plt>
mov    $0x18,%edi
call   1030 <v_readl@plt>
mov    $0x4008,%edi
pop    %rax
jmp    1030 <v_readl@plt>

LLVM IR (-O0):
define zeroext i8 @Permedia2ReadData() {
%1 = alloca i32
%2 = alloca i8
br label %3
3: ; preds = %0
store i32 5, i32* %1
br label %4
4: ; preds = %8, %3
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call zeroext i8 @v_readl(i32 24)
store i8 %9, i8* %2
br label %4
10: ; preds = %4
br label %11
11: ; preds = %10
%12 = call zeroext i8 @v_readl(i32 16392)
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @Permedia2ReadData() {
%1 = tail call zeroext i8 @v_readl(i32 24)
%2 = tail call zeroext i8 @v_readl(i32 24)
%3 = tail call zeroext i8 @v_readl(i32 24)
%4 = tail call zeroext i8 @v_readl(i32 24)
%5 = tail call zeroext i8 @v_readl(i32 24)
%6 = tail call zeroext i8 @v_readl(i32 16392)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int i = 0;
  float mas[5] = {1, 2, 3, 4, 5};
  for (i = 4; i >= 0; i--)
    printf("%f\n", mas[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x4,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     117a <main+0x6a>
movslq -0x8(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x3c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xefc(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xed4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xec8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xebc(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xeb0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.mas = [5 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00]
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x float]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [5 x float]* %3 to i8*
store i32 4, i32* %2
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 %10
%12 = load float, float* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 5.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 4.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 1.000000e+00)
ret i32 0
}
/* Type definitions */
typedef char *memchr;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *(memccpy)(void *restrict whither, const void *restrict whence, int c,
                size_t size) {
  char *stop = (memchr)(whence, c, size);
  void *r = NULL;
  if (stop != NULL)
    size = (size_t)(stop - (const char *)whence), r = whither + size;
  memcpy(whither, whence, size);
  return r;
}


x86 assembly (clang, -O0):
<memccpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     115d <memccpy+0x4d>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memccpy>:
push   %rbx
mov    %rcx,%rdx
sub    %rsi,%rdx
lea    (%rdi,%rdx,1),%rbx
test   %rcx,%rcx
cmove  %rcx,%rdx
cmove  %rcx,%rbx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @memccpy(i8* noalias %0, i8* noalias %1, i32 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i64, i64* %8
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %9
store i8* null, i8** %10
%15 = load i8*, i8** %9
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %26
17: ; preds = %4
%18 = load i8*, i8** %9
%19 = load i8*, i8** %6
%20 = ptrtoint i8* %18 to i64
%21 = ptrtoint i8* %19 to i64
%22 = sub i64 %20, %21
store i64 %22, i64* %8
%23 = load i8*, i8** %5
%24 = load i64, i64* %8
%25 = getelementptr i8, i8* %23, i64 %24
store i8* %25, i8** %10
br label %26
26: ; preds = %17, %4
%27 = load i8*, i8** %5
%28 = load i8*, i8** %6
%29 = load i64, i64* %8
%30 = call i32 @memcpy(i8* %27, i8* %28, i64 %29)
%31 = load i8*, i8** %10
ret i8* %31
}

LLVM IR (-O2):
define i8* @memccpy(i8* noalias %0, i8* noalias %1, i32 %2, i64 %3) {
%5 = icmp eq i64 %3, 0
%6 = ptrtoint i8* %1 to i64
%7 = sub i64 %3, %6
%8 = getelementptr i8, i8* %0, i64 %7
%9 = select i1 %5, i64 0, i64 %7
%10 = select i1 %5, i8* null, i8* %8
%11 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %9)
ret i8* %10
}
void gtk_menu_shell_select_item() {}


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

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

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

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

/* Variables and functions */
void SCB_CleanDCache_by_Addr(uint32_t *addr, int32_t dsize) {}


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

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

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

LLVM IR (-O2):
define void @SCB_CleanDCache_by_Addr(i32* nocapture %0, i32 %1) {
ret void
}
long fac0(int n) {
  if (n <= 1)
    return 1;
  else
    return n * fac0(n - 1);
}


x86 assembly (clang, -O0):
<fac0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1132 <fac0+0x22>
movq   $0x1,-0x8(%rbp)
jmp    1154 <fac0+0x44>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fac0@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fac0>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <fac0+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <fac0+0x20>
ret

LLVM IR (-O0):
define i64 @fac0(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i64 @fac0(i32 %11)
%13 = mul nsw i64 %9, %12
store i64 %13, i64* %2
br label %14
14: ; preds = %7, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @fac0(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %8, %5 ]
%7 = phi i64 [ 1, %3 ], [ %9, %5 ]
%8 = add nsw i64 %6, -1
%9 = mul nsw i64 %7, %6
%10 = icmp ult i64 %6, 3
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %9, %5 ]
ret i64 %12
}
/* Variables and functions */
scalar_t__ DBL_EPSILON;
scalar_t__ fabs(double);
int fct_real_eq(double v1, double v2) {
  return (int)(fabs(v1 - v2) < DBL_EPSILON);
}


x86 assembly (clang, -O0):
<fct_real_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct_real_eq>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    0x2ec7(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@DBL_EPSILON = global i64 0
define i32 @fct_real_eq(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 = fsub double %5, %6
%8 = call i64 @fabs(double %7)
%9 = load i64, i64* @DBL_EPSILON
%10 = icmp slt i64 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@DBL_EPSILON = global i64 0
define i32 @fct_real_eq(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i64 @fabs(double %3)
%5 = load i64, i64* @DBL_EPSILON
%6 = icmp slt i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("%i"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ put_unaligned_be16(int, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
uint32_t resp_read_media_serial(uint8_t *sno, uint8_t *buf, uint8_t *sam_stat) {
  uint32_t size = 38;
  snprintf((char *)&buf[4], size - 5, "%-34s", sno);
  put_unaligned_be16(size, &buf[2]);
  return size;
}


x86 assembly (clang, -O0):
<resp_read_media_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x26,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x1c(%rbp),%esi
sub    $0x5,%esi
mov    -0x8(%rbp),%rcx
lea    0xeac(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x2,%rsi
call   1040 <put_unaligned_be16@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resp_read_media_serial>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0x4(%rsi),%rdi
lea    0xece(%rip),%rdx
mov    $0x21,%esi
call   1030 <snprintf@plt>
add    $0x2,%rbx
mov    $0x26,%edi
mov    %rbx,%rsi
call   1040 <put_unaligned_be16@plt>
mov    $0x26,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%-34s\00"
define i32 @resp_read_media_serial(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 38, i32* %7
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = load i32, i32* %7
%11 = sub nsw i32 %10, 5
%12 = load i8*, i8** %4
%13 = call i32 @snprintf(i8* %9, i32 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %7
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = call i32 @put_unaligned_be16(i32 %14, i8* %16)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"%-34s\00"
define i32 @resp_read_media_serial(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 4
%5 = tail call i32 @snprintf(i8* %4, i32 33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = tail call i32 @put_unaligned_be16(i32 38, i8* %6)
ret i32 38
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ctor3() { printf("Create3!\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Create3!\00"
define void @ctor3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int);
int /*<<< orphan*/ main2(int);
int main(void) {
  check_vect();
  main1(32 - 7);
  main2(32 - 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    $0x19,%edi
call   1040 <main1@plt>
mov    $0x1d,%edi
call   1050 <main2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x19,%edi
call   1040 <main1@plt>
mov    $0x1d,%edi
call   1050 <main2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_vect()
%3 = call i32 @main1(i32 25)
%4 = call i32 @main2(i32 29)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 25)
%3 = tail call i32 @main2(i32 29)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_write(int);
void avr_end() {
  serial_write(4);
  while (1) {
  };
}


x86 assembly (clang, -O0):
<avr_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <serial_write@plt>
jmp    111e <avr_end+0xe>

x86 assembly (clang, -O2):
<avr_end>:
push   %rax
mov    $0x4,%edi
call   1030 <serial_write@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <avr_end+0x10>

LLVM IR (-O0):
define void @avr_end() {
%1 = call i32 @serial_write(i32 4)
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @avr_end() {
%1 = tail call i32 @serial_write(i32 4)
br label %2
2: ; preds = %0, %2
br label %2
}
void infinite_for_loop_Good() {
  int arr[5];
  int x = 0;
  for (x;;) {
  }
  arr[10] = 0;
}


x86 assembly (clang, -O0):
<infinite_for_loop_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x24(%rbp)
jmp    110b <infinite_for_loop_Good+0xb>

x86 assembly (clang, -O2):
<infinite_for_loop_Good>:
jmp    1100 <infinite_for_loop_Good>

LLVM IR (-O0):
define void @infinite_for_loop_Good() {
%1 = alloca [5 x i32]
%2 = alloca i32
store i32 0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %0
br label %4
}

LLVM IR (-O2):
define void @infinite_for_loop_Good() {
br label %1
1: ; preds = %1, %0
br label %1
}
unsigned int __fixunssfsi(float a __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__fixunssfsi(float %0) {
ret i32 0
}
void foo352(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo352(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Run_Current_Sensor();
int /*<<< orphan*/ Run_Temp_Sensor();
int /*<<< orphan*/ Run_Volt_Sensor();
void PWM_Cmds_Run(void) {
  Run_Current_Sensor();
  Run_Temp_Sensor();
  Run_Volt_Sensor();
}


x86 assembly (clang, -O0):
<PWM_Cmds_Run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Run_Current_Sensor@plt>
mov    $0x0,%al
call   1040 <Run_Temp_Sensor@plt>
mov    $0x0,%al
call   1050 <Run_Volt_Sensor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWM_Cmds_Run>:
push   %rax
xor    %eax,%eax
call   1030 <Run_Current_Sensor@plt>
xor    %eax,%eax
call   1040 <Run_Temp_Sensor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <Run_Volt_Sensor@plt>

LLVM IR (-O0):
define void @PWM_Cmds_Run() {
%1 = call i32 (...) @Run_Current_Sensor()
%2 = call i32 (...) @Run_Temp_Sensor()
%3 = call i32 (...) @Run_Volt_Sensor()
ret void
}

LLVM IR (-O2):
define void @PWM_Cmds_Run() {
%1 = tail call i32 (...) @Run_Current_Sensor()
%2 = tail call i32 (...) @Run_Temp_Sensor()
%3 = tail call i32 (...) @Run_Volt_Sensor()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int cg_free(void *data) {
  if (data != NULL) {
    free(data);
    ;
    return 0;
  }
  return 1;
}


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

x86 assembly (clang, -O2):
<cg_free>:
test   %rdi,%rdi
je     1122 <cg_free+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cg_free(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 = %1, %3
%6 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %6
}
void ft_striter(char *s, void (*f)(char *)) {
  while (*s != 0)
    f(s++);
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113a <ft_striter+0x3a>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    1110 <ft_striter+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1123 <ft_striter+0x23>
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1110 <ft_striter+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
tail call void %1(i8* %6)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t prog0_suf(uint32_t x, uint32_t y) { return x + y; }


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

x86 assembly (clang, -O2):
<prog0_suf>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @prog0_suf(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* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @prog0_suf(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char sentence[1000];
  scanf("%[^\n]s", sentence);
  create_letter_distribution_diagram(sentence);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @create_letter_distribution_diagram(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cbc_getCurrentThreadBuffer();
int /*<<< orphan*/ cbc_printThreadStackTrace(int /*<<< orphan*/);
void cbc_printCurrentStackTrace() {
  cbc_printThreadStackTrace(cbc_getCurrentThreadBuffer());
}


x86 assembly (clang, -O0):
<cbc_printCurrentStackTrace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cbc_getCurrentThreadBuffer@plt>
mov    %eax,%edi
call   1040 <cbc_printThreadStackTrace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbc_printCurrentStackTrace>:
push   %rax
xor    %eax,%eax
call   1030 <cbc_getCurrentThreadBuffer@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cbc_printThreadStackTrace@plt>

LLVM IR (-O0):
define void @cbc_printCurrentStackTrace() {
%1 = call i32 (...) @cbc_getCurrentThreadBuffer()
%2 = call i32 @cbc_printThreadStackTrace(i32 %1)
ret void
}

LLVM IR (-O2):
define void @cbc_printCurrentStackTrace() {
%1 = tail call i32 (...) @cbc_getCurrentThreadBuffer()
%2 = tail call i32 @cbc_printThreadStackTrace(i32 %1)
ret void
}
int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @sysfs_move_dir(%struct.kobject* nocapture readnone %0, %struct.kobject* nocapture readnone %1) {
ret i32 0
}
unsigned char tcp_step_send() {}


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

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

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

LLVM IR (-O2):
define zeroext i8 @tcp_step_send() {
ret i8 undef
}