#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*/ float_eg();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_twocomp();
int /*<<< orphan*/ simple_show_a();
int /*<<< orphan*/ simple_show_b();
int /*<<< orphan*/ string_leg();
int /*<<< orphan*/ string_ueg();
int strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ test_show_bytes(int);
int main(int argc, char *argv[]) {
  int val = 12345;
  if (argc > 1) {
    val = strtol(argv[1], NULL, 0);
    printf("calling test_show_bytes\n");
    test_show_bytes(val);
  } else {
    printf("calling show_twocomp\n");
    show_twocomp();
    printf("Calling simple_show_a\n");
    simple_show_a();
    printf("Calling simple_show_b\n");
    simple_show_b();
    printf("Calling float_eg\n");
    float_eg();
    printf("Calling string_ueg\n");
    string_ueg();
    printf("Calling string_leg\n");
    string_leg();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3039,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11e6 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1080 <strtol@plt>
mov    %eax,-0x14(%rbp)
lea    0xe2c(%rip),%rdi
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
call   10b0 <test_show_bytes@plt>
jmp    1258 <main+0xc8>
lea    0xe2c(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10a0 <show_twocomp@plt>
lea    0xe2f(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1090 <simple_show_a@plt>
lea    0xe33(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1050 <simple_show_b@plt>
lea    0xe37(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <float_eg@plt>
lea    0xe36(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1030 <string_ueg@plt>
lea    0xe37(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <string_leg@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     11ba <main+0x2a>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <strtol@plt>
mov    %eax,%ebx
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   10b0 <test_show_bytes@plt>
jmp    122c <main+0x9c>
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10a0 <show_twocomp@plt>
lea    0xe41(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <simple_show_a@plt>
lea    0xe44(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <simple_show_b@plt>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <float_eg@plt>
lea    0xe45(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <string_ueg@plt>
lea    0xe45(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <string_leg@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"calling test_show_bytes\0A\00"
@.str.1 = [22 x i8] c"calling show_twocomp\0A\00"
@.str.2 = [23 x i8] c"Calling simple_show_a\0A\00"
@.str.3 = [23 x i8] c"Calling simple_show_b\0A\00"
@.str.4 = [18 x i8] c"Calling float_eg\0A\00"
@.str.5 = [20 x i8] c"Calling string_ueg\0A\00"
@.str.6 = [20 x i8] c"Calling string_leg\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 12345, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, 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 @strtol(i8* %12, i32* null, i32 0)
store i32 %13, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %6
%16 = call i32 @test_show_bytes(i32 %15)
br label %30
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 (...) @show_twocomp()
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (...) @simple_show_a()
%22 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 (...) @simple_show_b()
%24 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 (...) @float_eg()
%26 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 (...) @string_ueg()
%28 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 (...) @string_leg()
br label %30
30: ; preds = %17, %9
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"calling show_twocomp\00"
@str.7 = [22 x i8] c"Calling simple_show_a\00"
@str.8 = [22 x i8] c"Calling simple_show_b\00"
@str.9 = [17 x i8] c"Calling float_eg\00"
@str.10 = [19 x i8] c"Calling string_ueg\00"
@str.11 = [19 x i8] c"Calling string_leg\00"
@str.12 = [24 x i8] c"calling test_show_bytes\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtol(i8* nocapture %6, i32* null, i32 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
%9 = tail call i32 @test_show_bytes(i32 %7)
br label %23
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 (...) @show_twocomp()
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.7, i64 0, i64 0))
%14 = tail call i32 (...) @simple_show_a()
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
%16 = tail call i32 (...) @simple_show_b()
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
%18 = tail call i32 (...) @float_eg()
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
%20 = tail call i32 (...) @string_ueg()
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
%22 = tail call i32 (...) @string_leg()
br label %23
23: ; preds = %10, %4
ret i32 0
}