#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void dohelp(int man) {
  puts("Usage: bef2elf input.bf output.elf");
  if (man) {
    puts("");
    puts("  program.bf should be an ASCII file, at most 80 columns by");
    puts("25 rows, containing no control characters except at the ends");
    puts("of lines. bef2elf will strip out any control characters");
    puts("(ASCII 31 or less).");
    puts("  bef2elf's output is a binary FungELF file. It consists of");
    puts("one text section, size (25,80), starting at (0,0), and containing");
    puts("the ASCII characters from program.bf. Ragged and missing lines");
    puts("are padded to (25,80) with spaces (ASCII 32). The global fill");
    puts("value is set to ASCII 32, and the program entry point is set");
    puts("to (0,0).");
    puts("  bef2elf's output will not do anything sensible by itself, because");
    puts("it fills all of memory with trap instructions. Running output.elf");
    puts("in simfunge should produce a simulator error about an infinite");
    puts("loop in TRP 32.");
  }
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<dohelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x4(%rbp)
je     11f5 <dohelp+0xd5>
lea    0x10e1(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf64(%rip),%rdi
call   1030 <puts@plt>
lea    0xf94(%rip),%rdi
call   1030 <puts@plt>
lea    0xfca(%rip),%rdi
call   1030 <puts@plt>
lea    0xffd(%rip),%rdi
call   1030 <puts@plt>
lea    0x102f(%rip),%rdi
call   1030 <puts@plt>
lea    0x1060(%rip),%rdi
call   1030 <puts@plt>
lea    0x105e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1096(%rip),%rdi
call   1030 <puts@plt>
lea    0x10cc(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ff(%rip),%rdi
call   1030 <puts@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dohelp>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
je     11f9 <dohelp+0xc9>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0xefb(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf58(%rip),%rdi
call   1040 <puts@plt>
lea    0xf60(%rip),%rdi
call   1040 <puts@plt>
lea    0xf90(%rip),%rdi
call   1040 <puts@plt>
lea    0xfc6(%rip),%rdi
call   1040 <puts@plt>
lea    0xff9(%rip),%rdi
call   1040 <puts@plt>
lea    0x102b(%rip),%rdi
call   1040 <puts@plt>
lea    0x105c(%rip),%rdi
call   1040 <puts@plt>
lea    0x105a(%rip),%rdi
call   1040 <puts@plt>
lea    0x1092(%rip),%rdi
call   1040 <puts@plt>
lea    0x10c8(%rip),%rdi
call   1040 <puts@plt>
lea    0x10fb(%rip),%rdi
call   1040 <puts@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: bef2elf input.bf output.elf\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [60 x i8] c" program.bf should be an ASCII file, at most 80 columns by\00"
@.str.3 = [61 x i8] c"25 rows, containing no control characters except at the ends\00"
@.str.4 = [56 x i8] c"of lines. bef2elf will strip out any control characters\00"
@.str.5 = [20 x i8] c"(ASCII 31 or less).\00"
@.str.6 = [60 x i8] c" bef2elf's output is a binary FungELF file. It consists of\00"
@.str.7 = [66 x i8] c"one text section, size (25,80), starting at (0,0), and containing\00"
@.str.8 = [63 x i8] c"the ASCII characters from program.bf. Ragged and missing lines\00"
@.str.9 = [62 x i8] c"are padded to (25,80) with spaces (ASCII 32). The global fill\00"
@.str.10 = [61 x i8] c"value is set to ASCII 32, and the program entry point is set\00"
@.str.11 = [10 x i8] c"to (0,0).\00"
@.str.12 = [68 x i8] c" bef2elf's output will not do anything sensible by itself, because\00"
@.str.13 = [66 x i8] c"it fills all of memory with trap instructions. Running output.elf\00"
@.str.14 = [63 x i8] c"in simfunge should produce a simulator error about an infinite\00"
@.str.15 = [16 x i8] c"loop in TRP 32.\00"
@EXIT_FAILURE = global i32 0
define void @dohelp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 @puts(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%18 = call i32 @puts(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.13, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.14, i64 0, i64 0))
%21 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0))
br label %22
22: ; preds = %6, %1
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: bef2elf input.bf output.elf\00"
@.str.2 = [60 x i8] c" program.bf should be an ASCII file, at most 80 columns by\00"
@.str.3 = [61 x i8] c"25 rows, containing no control characters except at the ends\00"
@.str.4 = [56 x i8] c"of lines. bef2elf will strip out any control characters\00"
@.str.5 = [20 x i8] c"(ASCII 31 or less).\00"
@.str.6 = [60 x i8] c" bef2elf's output is a binary FungELF file. It consists of\00"
@.str.7 = [66 x i8] c"one text section, size (25,80), starting at (0,0), and containing\00"
@.str.8 = [63 x i8] c"the ASCII characters from program.bf. Ragged and missing lines\00"
@.str.9 = [62 x i8] c"are padded to (25,80) with spaces (ASCII 32). The global fill\00"
@.str.10 = [61 x i8] c"value is set to ASCII 32, and the program entry point is set\00"
@.str.11 = [10 x i8] c"to (0,0).\00"
@.str.12 = [68 x i8] c" bef2elf's output will not do anything sensible by itself, because\00"
@.str.13 = [66 x i8] c"it fills all of memory with trap instructions. Running output.elf\00"
@.str.14 = [63 x i8] c"in simfunge should produce a simulator error about an infinite\00"
@.str.15 = [16 x i8] c"loop in TRP 32.\00"
@EXIT_FAILURE = global i32 0
define void @dohelp(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.13, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.14, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0))
br label %20
20: ; preds = %4, %1
%21 = load i32, i32* @EXIT_FAILURE
%22 = tail call i32 @exit(i32 %21)
unreachable
}