#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct TYPE_4__ {
  int e_entry;
  int e_phoff;
  int e_flags;
  int e_ehsize;
  int e_phentsize;
  int e_phnum;
  int e_shentsize;
  scalar_t__ e_shstrndx;
  scalar_t__ e_shnum;
  scalar_t__ e_shoff;
  void *e_version;
  int /*<<< orphan*/ e_machine;
  int /*<<< orphan*/ e_type;
  void **e_ident;
};
struct TYPE_3__ {
  int p_offset;
  int p_vaddr;
  int p_paddr;
  int p_filesz;
  int p_memsz;
  int p_flags;
  scalar_t__ p_align;
  int /*<<< orphan*/ p_type;
};
typedef int /*<<< orphan*/ Elf32_Shdr;
typedef TYPE_1__ Elf32_Phdr;
typedef TYPE_2__ Elf32_Ehdr;

/* Variables and functions */
size_t EI_ABIVERSION;
size_t EI_CLASS;
size_t EI_DATA;
size_t EI_MAG0;
size_t EI_OSABI;
size_t EI_VERSION;
void *ELFCLASS32;
void *ELFDATA2LSB;
int /*<<< orphan*/ ELFMAG;
void *ELFOSABI_NONE;
int /*<<< orphan*/ EM_MIPS;
int /*<<< orphan*/ ET_EXEC;
void *EV_CURRENT;
int PF_R;
int PF_W;
int PF_X;
int /*<<< orphan*/ PT_LOAD;
int /*<<< orphan*/ SELFMAG;
int /*<<< orphan*/ memcpy(void **, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char const *);
void gen_elf_header(uint8_t *hdr, int hdrlen, int datalen) {
  Elf32_Ehdr *ehdr;
  Elf32_Phdr *phdr;
  static const char *note = "Created with cb2util";
  memset(hdr, 0, hdrlen);
  ehdr = (Elf32_Ehdr *)hdr;
  memcpy(&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG);
  ehdr->e_ident[EI_CLASS] = ELFCLASS32;
  ehdr->e_ident[EI_DATA] = ELFDATA2LSB;
  ehdr->e_ident[EI_VERSION] = EV_CURRENT;
  ehdr->e_ident[EI_OSABI] = ELFOSABI_NONE;
  ehdr->e_ident[EI_ABIVERSION] = 0;
  ehdr->e_type = ET_EXEC;
  ehdr->e_machine = EM_MIPS;
  ehdr->e_version = EV_CURRENT;
  ehdr->e_entry = 0x01000000;
  ehdr->e_phoff = sizeof(Elf32_Ehdr);
  ehdr->e_shoff = 0;
  ehdr->e_flags = 0x20924001;
  ehdr->e_ehsize = sizeof(Elf32_Ehdr);
  ehdr->e_phentsize = sizeof(Elf32_Phdr);
  ehdr->e_phnum = 1;
  ehdr->e_shentsize = sizeof(Elf32_Shdr);
  ehdr->e_shnum = 0;
  ehdr->e_shstrndx = 0;
  phdr = (Elf32_Phdr *)&hdr[ehdr->e_phoff];
  phdr->p_type = PT_LOAD;
  phdr->p_offset = hdrlen;
  phdr->p_vaddr = 0x01000000;
  phdr->p_paddr = 0x01000000;
  phdr->p_filesz = datalen;
  phdr->p_memsz = datalen;
  phdr->p_flags = PF_X | PF_W | PF_R;
  phdr->p_align = 0;
  strcpy((char *)&hdr[sizeof(Elf32_Ehdr) + sizeof(Elf32_Phdr)], note);
}


x86 assembly (clang, -O0):
<gen_elf_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rdi
mov    0x2e61(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
mov    0x2df7(%rip),%rax
mov    (%rax),%edx
call   1050 <memcpy@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rax
mov    0x2de7(%rip),%rcx
mov    (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    0x2e41(%rip),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rax
mov    0x2ddf(%rip),%rcx
mov    (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    0x2df1(%rip),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rax
mov    0x2db7(%rip),%rcx
mov    (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    0x2df1(%rip),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rax
mov    0x2da7(%rip),%rcx
mov    (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rax
mov    0x2d99(%rip),%rcx
mov    (%rcx),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    0x2d57(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x44(%rax)
mov    0x2d17(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x40(%rax)
mov    0x2d77(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x38(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1000000,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x50,0x4(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,0x30(%rax)
mov    -0x18(%rbp),%rax
movl   $0x20924001,0x8(%rax)
mov    -0x18(%rbp),%rax
movl   $0x50,0xc(%rax)
mov    -0x18(%rbp),%rax
movl   $0x28,0x10(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,0x14(%rax)
mov    -0x18(%rbp),%rax
movl   $0x4,0x18(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,0x28(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq 0x4(%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd6(%rip),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1000000,0x4(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1000000,0x8(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    0x2cab(%rip),%rax
mov    (%rax),%ecx
mov    0x2c42(%rip),%rax
or     (%rax),%ecx
mov    0x2c31(%rip),%rax
or     (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x8(%rbp),%rdi
add    $0x1e0,%rdi
mov    0x2cda(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_elf_header>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%rdi
shl    $0x3,%rdi
add    0x48(%rbx),%rdi
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
mov    0x2e11(%rip),%rax
mov    (%rax),%edx
call   1050 <memcpy@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%rax
mov    0x48(%rbx),%rcx
mov    0x2e05(%rip),%rdx
mov    (%rdx),%rdx
mov    %rax,(%rcx,%rdx,8)
mov    0x2e5f(%rip),%rax
mov    (%rax),%rax
mov    0x48(%rbx),%rcx
mov    0x2e01(%rip),%rdx
mov    (%rdx),%rdx
mov    %rax,(%rcx,%rdx,8)
mov    0x2e13(%rip),%rax
mov    (%rax),%rcx
mov    0x48(%rbx),%rdx
mov    0x2ddd(%rip),%rsi
mov    (%rsi),%rsi
mov    %rcx,(%rdx,%rsi,8)
mov    0x2e17(%rip),%rcx
mov    (%rcx),%rcx
mov    0x48(%rbx),%rdx
mov    0x2dd1(%rip),%rsi
mov    (%rsi),%rsi
mov    %rcx,(%rdx,%rsi,8)
mov    0x48(%rbx),%rcx
mov    0x2dc7(%rip),%rdx
mov    (%rdx),%rdx
movq   $0x0,(%rcx,%rdx,8)
mov    0x2d85(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x44(%rbx)
mov    0x2d49(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x40(%rbx)
mov    (%rax),%rax
mov    %rax,0x38(%rbx)
movabs $0x5001000000,%rax
mov    %rax,(%rbx)
movq   $0x0,0x30(%rbx)
movaps 0xdd1(%rip),%xmm0
movups %xmm0,0x8(%rbx)
movl   $0x4,0x18(%rbx)
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rbx)
mov    0x2d70(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x160(%rbx)
mov    %ebp,0x140(%rbx)
movabs $0x100000001000000,%rax
mov    %rax,0x144(%rbx)
mov    %r14d,0x14c(%rbx)
mov    %r14d,0x150(%rbx)
mov    0x2d54(%rip),%rax
mov    0x2ced(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2cda(%rip),%rax
or     (%rax),%ecx
mov    %ecx,0x154(%rbx)
movq   $0x0,0x158(%rbx)
add    $0x1e0,%rbx
lea    0xd61(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i8*, i32, i32, i8** }
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i64, i32 }
@gen_elf_header.note = internal global i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0)
@.str = [21 x i8] c"Created with cb2util\00"
@EI_MAG0 = global i64 0
@ELFMAG = global i32 0
@SELFMAG = global i32 0
@ELFCLASS32 = global i8* null
@EI_CLASS = global i64 0
@ELFDATA2LSB = global i8* null
@EI_DATA = global i64 0
@EV_CURRENT = global i8* null
@EI_VERSION = global i64 0
@ELFOSABI_NONE = global i8* null
@EI_OSABI = global i64 0
@EI_ABIVERSION = global i64 0
@ET_EXEC = global i32 0
@EM_MIPS = global i32 0
@PT_LOAD = global i32 0
@PF_X = global i32 0
@PF_W = global i32 0
@PF_R = global i32 0
define void @gen_elf_header(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.TYPE_4__*
%8 = alloca %struct.TYPE_3__*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32 @memset(i32* %9, i32 0, i32 %10)
%12 = load i32*, i32** %4
%13 = bitcast i32* %12 to %struct.TYPE_4__*
store %struct.TYPE_4__* %13, %struct.TYPE_4__** %7
%14 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %14, i32 0, i32 13
%16 = load i8**, i8*** %15
%17 = load i64, i64* @EI_MAG0
%18 = getelementptr inbounds i8*, i8** %16, i64 %17
%19 = load i32, i32* @ELFMAG
%20 = load i32, i32* @SELFMAG
%21 = call i32 @memcpy(i8** %18, i32 %19, i32 %20)
%22 = load i8*, i8** @ELFCLASS32
%23 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%24 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i32 0, i32 13
%25 = load i8**, i8*** %24
%26 = load i64, i64* @EI_CLASS
%27 = getelementptr inbounds i8*, i8** %25, i64 %26
store i8* %22, i8** %27
%28 = load i8*, i8** @ELFDATA2LSB
%29 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%30 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %29, i32 0, i32 13
%31 = load i8**, i8*** %30
%32 = load i64, i64* @EI_DATA
%33 = getelementptr inbounds i8*, i8** %31, i64 %32
store i8* %28, i8** %33
%34 = load i8*, i8** @EV_CURRENT
%35 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%36 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %35, i32 0, i32 13
%37 = load i8**, i8*** %36
%38 = load i64, i64* @EI_VERSION
%39 = getelementptr inbounds i8*, i8** %37, i64 %38
store i8* %34, i8** %39
%40 = load i8*, i8** @ELFOSABI_NONE
%41 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%42 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %41, i32 0, i32 13
%43 = load i8**, i8*** %42
%44 = load i64, i64* @EI_OSABI
%45 = getelementptr inbounds i8*, i8** %43, i64 %44
store i8* %40, i8** %45
%46 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%47 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %46, i32 0, i32 13
%48 = load i8**, i8*** %47
%49 = load i64, i64* @EI_ABIVERSION
%50 = getelementptr inbounds i8*, i8** %48, i64 %49
store i8* null, i8** %50
%51 = load i32, i32* @ET_EXEC
%52 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%53 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %52, i32 0, i32 12
store i32 %51, i32* %53
%54 = load i32, i32* @EM_MIPS
%55 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%56 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %55, i32 0, i32 11
store i32 %54, i32* %56
%57 = load i8*, i8** @EV_CURRENT
%58 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%59 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %58, i32 0, i32 10
store i8* %57, i8** %59
%60 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%61 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %60, i32 0, i32 0
store i32 16777216, i32* %61
%62 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%63 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %62, i32 0, i32 1
store i32 80, i32* %63
%64 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%65 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %64, i32 0, i32 9
store i64 0, i64* %65
%66 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%67 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %66, i32 0, i32 2
store i32 546455553, i32* %67
%68 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%69 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %68, i32 0, i32 3
store i32 80, i32* %69
%70 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%71 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %70, i32 0, i32 4
store i32 40, i32* %71
%72 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%73 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %72, i32 0, i32 5
store i32 1, i32* %73
%74 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%75 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %74, i32 0, i32 6
store i32 4, i32* %75
%76 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%77 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %76, i32 0, i32 8
store i64 0, i64* %77
%78 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%79 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %78, i32 0, i32 7
store i64 0, i64* %79
%80 = load i32*, i32** %4
%81 = load %struct.TYPE_4__*, %struct.TYPE_4__** %7
%82 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %81, i32 0, i32 1
%83 = load i32, i32* %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %80, i64 %84
%86 = bitcast i32* %85 to %struct.TYPE_3__*
store %struct.TYPE_3__* %86, %struct.TYPE_3__** %8
%87 = load i32, i32* @PT_LOAD
%88 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%89 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %88, i32 0, i32 7
store i32 %87, i32* %89
%90 = load i32, i32* %5
%91 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%92 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %91, i32 0, i32 0
store i32 %90, i32* %92
%93 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%94 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %93, i32 0, i32 1
store i32 16777216, i32* %94
%95 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%96 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %95, i32 0, i32 2
store i32 16777216, i32* %96
%97 = load i32, i32* %6
%98 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%99 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %98, i32 0, i32 3
store i32 %97, i32* %99
%100 = load i32, i32* %6
%101 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%102 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %101, i32 0, i32 4
store i32 %100, i32* %102
%103 = load i32, i32* @PF_X
%104 = load i32, i32* @PF_W
%105 = or i32 %103, %104
%106 = load i32, i32* @PF_R
%107 = or i32 %105, %106
%108 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%109 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %108, i32 0, i32 5
store i32 %107, i32* %109
%110 = load %struct.TYPE_3__*, %struct.TYPE_3__** %8
%111 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %110, i32 0, i32 6
store i64 0, i64* %111
%112 = load i32*, i32** %4
%113 = getelementptr inbounds i32, i32* %112, i64 120
%114 = bitcast i32* %113 to i8*
%115 = load i8*, i8** @gen_elf_header.note
%116 = call i32 @strcpy(i8* %114, i8* %115)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Created with cb2util\00"
@EI_MAG0 = global i64 0
@ELFMAG = global i32 0
@SELFMAG = global i32 0
@ELFCLASS32 = global i8* null
@EI_CLASS = global i64 0
@ELFDATA2LSB = global i8* null
@EI_DATA = global i64 0
@EV_CURRENT = global i8* null
@EI_VERSION = global i64 0
@ELFOSABI_NONE = global i8* null
@EI_OSABI = global i64 0
@EI_ABIVERSION = global i64 0
@ET_EXEC = global i32 0
@EM_MIPS = global i32 0
@PT_LOAD = global i32 0
@PF_X = global i32 0
@PF_W = global i32 0
@PF_R = global i32 0
define void @gen_elf_header(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @memset(i32* %0, i32 0, i32 %1)
%5 = getelementptr inbounds i32, i32* %0, i64 18
%6 = bitcast i32* %5 to i8***
%7 = load i8**, i8*** %6
%8 = load i64, i64* @EI_MAG0
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
%10 = load i32, i32* @ELFMAG
%11 = load i32, i32* @SELFMAG
%12 = tail call i32 @memcpy(i8** %9, i32 %10, i32 %11)
%13 = load i8*, i8** @ELFCLASS32
%14 = load i8**, i8*** %6
%15 = load i64, i64* @EI_CLASS
%16 = getelementptr inbounds i8*, i8** %14, i64 %15
store i8* %13, i8** %16
%17 = load i8*, i8** @ELFDATA2LSB
%18 = load i8**, i8*** %6
%19 = load i64, i64* @EI_DATA
%20 = getelementptr inbounds i8*, i8** %18, i64 %19
store i8* %17, i8** %20
%21 = load i8*, i8** @EV_CURRENT
%22 = load i8**, i8*** %6
%23 = load i64, i64* @EI_VERSION
%24 = getelementptr inbounds i8*, i8** %22, i64 %23
store i8* %21, i8** %24
%25 = load i8*, i8** @ELFOSABI_NONE
%26 = load i8**, i8*** %6
%27 = load i64, i64* @EI_OSABI
%28 = getelementptr inbounds i8*, i8** %26, i64 %27
store i8* %25, i8** %28
%29 = load i8**, i8*** %6
%30 = load i64, i64* @EI_ABIVERSION
%31 = getelementptr inbounds i8*, i8** %29, i64 %30
store i8* null, i8** %31
%32 = load i32, i32* @ET_EXEC
%33 = getelementptr inbounds i32, i32* %0, i64 17
store i32 %32, i32* %33
%34 = load i32, i32* @EM_MIPS
%35 = getelementptr inbounds i32, i32* %0, i64 16
store i32 %34, i32* %35
%36 = load i8*, i8** @EV_CURRENT
%37 = getelementptr inbounds i32, i32* %0, i64 14
%38 = bitcast i32* %37 to i8**
store i8* %36, i8** %38
store i32 16777216, i32* %0
%39 = getelementptr inbounds i32, i32* %0, i64 1
store i32 80, i32* %39
%40 = getelementptr inbounds i32, i32* %0, i64 12
%41 = bitcast i32* %40 to i64*
store i64 0, i64* %41
%42 = getelementptr inbounds i32, i32* %0, i64 2
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 546455553, i32 80, i32 40, i32 1>, <4 x i32>* %43
%44 = getelementptr inbounds i32, i32* %0, i64 6
store i32 4, i32* %44
%45 = getelementptr inbounds i32, i32* %0, i64 8
%46 = getelementptr inbounds i32, i32* %0, i64 80
%47 = bitcast i32* %45 to i8*
%48 = load i32, i32* @PT_LOAD
%49 = getelementptr inbounds i32, i32* %0, i64 88
store i32 %48, i32* %49
store i32 %1, i32* %46
%50 = getelementptr inbounds i32, i32* %0, i64 81
store i32 16777216, i32* %50
%51 = getelementptr inbounds i32, i32* %0, i64 82
store i32 16777216, i32* %51
%52 = getelementptr inbounds i32, i32* %0, i64 83
store i32 %2, i32* %52
%53 = getelementptr inbounds i32, i32* %0, i64 84
store i32 %2, i32* %53
%54 = load i32, i32* @PF_X
%55 = load i32, i32* @PF_W
%56 = or i32 %55, %54
%57 = load i32, i32* @PF_R
%58 = or i32 %56, %57
%59 = getelementptr inbounds i32, i32* %0, i64 85
store i32 %58, i32* %59
%60 = getelementptr inbounds i32, i32* %0, i64 86
%61 = bitcast i32* %60 to i64*
store i64 0, i64* %61
%62 = getelementptr inbounds i32, i32* %0, i64 120
%63 = bitcast i32* %62 to i8*
%64 = tail call i32 @strcpy(i8* %63, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}