#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 */
char *getenv(char *);
int /*<<< orphan*/ pm_message(char *, ...);
void showVersion(void) {
  pm_message("Using libnetpbm from Netpbm Version: %s", "Netpbm 10.75.99");
  pm_message("Compiled %s by user \"%s\"", "Ter Ago 16 03:51:48 BRT 2016",
             "wagner");
  pm_message("BSD defined");
  {
    const char *rgbdef;
    pm_message("RGB_ENV='%s'", "RGBDEF");
    rgbdef = getenv("RGBDEF");
    if (rgbdef)
      pm_message("RGBENV= '%s' (env vbl set to '%s')", "RGBDEF", rgbdef);
    else
      pm_message("RGBENV= '%s' (env vbl is unset)", "RGBDEF");
  }
}


x86 assembly (clang, -O0):
<showVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xef2(%rip),%rsi
mov    $0x0,%al
call   1040 <pm_message@plt>
lea    0xef4(%rip),%rdi
lea    0xf06(%rip),%rsi
lea    0xf1c(%rip),%rdx
mov    $0x0,%al
call   1040 <pm_message@plt>
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1040 <pm_message@plt>
lea    0xf13(%rip),%rdi
lea    0xf19(%rip),%rsi
mov    $0x0,%al
call   1040 <pm_message@plt>
lea    0xf0b(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11b5 <showVersion+0x95>
mov    -0x8(%rbp),%rdx
lea    0xef3(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x0,%al
call   1040 <pm_message@plt>
jmp    11ca <showVersion+0xaa>
lea    0xefc(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1040 <pm_message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showVersion>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xef9(%rip),%rsi
xor    %eax,%eax
call   1040 <pm_message@plt>
lea    0xefb(%rip),%rdi
lea    0xf0d(%rip),%rsi
lea    0xf23(%rip),%rdx
xor    %eax,%eax
call   1040 <pm_message@plt>
lea    0xf1c(%rip),%rdi
xor    %eax,%eax
call   1040 <pm_message@plt>
lea    0xf1a(%rip),%rdi
lea    0xf20(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <pm_message@plt>
mov    %rbx,%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     119e <showVersion+0x7e>
lea    0xf09(%rip),%rdi
lea    0xefb(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1040 <pm_message@plt>
lea    0xf13(%rip),%rdi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <pm_message@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Using libnetpbm from Netpbm Version: %s\00"
@.str.1 = [16 x i8] c"Netpbm 10.75.99\00"
@.str.2 = [25 x i8] c"Compiled %s by user \22%s\22\00"
@.str.3 = [29 x i8] c"Ter Ago 16 03:51:48 BRT 2016\00"
@.str.4 = [7 x i8] c"wagner\00"
@.str.5 = [12 x i8] c"BSD defined\00"
@.str.6 = [13 x i8] c"RGB_ENV='%s'\00"
@.str.7 = [7 x i8] c"RGBDEF\00"
@.str.8 = [35 x i8] c"RGBENV= '%s' (env vbl set to '%s')\00"
@.str.9 = [32 x i8] c"RGBENV= '%s' (env vbl is unset)\00"
define void @showVersion() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%5 = call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%6 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i8*, i8** %1
%11 = call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %10)
br label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Using libnetpbm from Netpbm Version: %s\00"
@.str.1 = [16 x i8] c"Netpbm 10.75.99\00"
@.str.2 = [25 x i8] c"Compiled %s by user \22%s\22\00"
@.str.3 = [29 x i8] c"Ter Ago 16 03:51:48 BRT 2016\00"
@.str.4 = [7 x i8] c"wagner\00"
@.str.5 = [12 x i8] c"BSD defined\00"
@.str.6 = [13 x i8] c"RGB_ENV='%s'\00"
@.str.7 = [7 x i8] c"RGBDEF\00"
@.str.8 = [35 x i8] c"RGBENV= '%s' (env vbl set to '%s')\00"
@.str.9 = [32 x i8] c"RGBENV= '%s' (env vbl is unset)\00"
define void @showVersion() {
%1 = tail call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = tail call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %5)
br label %11
9: ; preds = %0
%10 = tail call i32 (i8*, ...) @pm_message(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}