#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ initialize_py_ops();
char *print_py_opcodes(char *, size_t);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
char *py_check(char *, size_t *);
void py(char *file) {
  size_t len;
  initialize_py_ops();
  char *file_contents = py_check(file, &len);
  char *stripped = file_contents + 12;
  putchar('\n');
  stripped = print_py_opcodes(stripped, len);
  putchar('\n');
  puts("; End of binary information.");
  free(file_contents);
}


x86 assembly (clang, -O0):
<py>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1070 <initialize_py_ops@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <py_check@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x20(%rbp)
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <print_py_opcodes@plt>
mov    %rax,-0x20(%rbp)
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xe44(%rip),%rdi
call   1050 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<py>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1070 <initialize_py_ops@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1080 <py_check@plt>
mov    %rax,%rbx
lea    0xc(%rax),%r14
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    (%rsp),%rsi
mov    %r14,%rdi
call   1060 <print_py_opcodes@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xe59(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"; End of binary information.\00"
define void @py(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = call i32 (...) @initialize_py_ops()
%7 = load i8*, i8** %2
%8 = call i8* @py_check(i8* %7, i64* %3)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 12
store i8* %10, i8** %5
%11 = call i32 @putchar(i8 signext 10)
%12 = load i8*, i8** %5
%13 = load i64, i64* %3
%14 = call i8* @print_py_opcodes(i8* %12, i64 %13)
store i8* %14, i8** %5
%15 = call i32 @putchar(i8 signext 10)
%16 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %4
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"; End of binary information.\00"
define void @py(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = tail call i32 (...) @initialize_py_ops()
%5 = call i8* @py_check(i8* %0, i64* %2)
%6 = getelementptr inbounds i8, i8* %5, i64 12
%7 = call i32 @putchar(i8 signext 10)
%8 = load i64, i64* %2
%9 = call i8* @print_py_opcodes(i8* %6, i64 %8)
%10 = call i32 @putchar(i8 signext 10)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @free(i8* %5)
ret void
}