int main(int argc, char *argv[]) {
  char buf[4096];
  int len;
  if (argc != 3) {
    printf("usage: %s <vhostname> <propname>\n", argv[0]);
    return -1;
  }
  if ((len = zfor_getvconf(argv[1], argv[2], buf, sizeof(buf))) < 0) {
    printf("Failed to get property '%s' for virtual host '%s'!\n", argv[2],
           argv[1]);
    return -1;
  }
  printf("(%d) %*s\n", len, len, buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1164 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e8 <main+0xc8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    -0x1010(%rbp),%rdx
mov    $0x1000,%ecx
mov    $0x0,%al
call   1040 <zfor_getvconf@plt>
mov    %eax,-0x1014(%rbp)
cmp    $0x0,%eax
jge    11c0 <main+0xa0>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e8 <main+0xc8>
mov    -0x1014(%rbp),%esi
mov    -0x1014(%rbp),%edx
lea    -0x1010(%rbp),%rcx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x1008,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1165 <main+0x45>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
xor    %ebp,%ebp
mov    %rsp,%rdx
mov    $0x1000,%ecx
xor    %eax,%eax
call   1040 <zfor_getvconf@plt>
test   %eax,%eax
js     1178 <main+0x58>
lea    0xf01(%rip),%rdi
mov    %rsp,%rcx
mov    %eax,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1193 <main+0x73>
mov    (%rbx),%rsi
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    118e <main+0x6e>
mov    0x8(%rbx),%rdx
mov    0x10(%rbx),%rsi
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"usage: %s <vhostname> <propname>\0A\00"
@.str.1 = [52 x i8] c"Failed to get property '%s' for virtual host '%s'!\0A\00"
@.str.2 = [10 x i8] c"(%d) %*s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4096 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 -1, i32* %3
br label %38
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%23 = call i32 (i8*, i8*, i8*, i64, ...) bitcast (i32 (...)* @zfor_getvconf to i32 (i8*, i8*, i8*, i64, ...)*)(i8* %18, i8* %21, i8* %22, i64 4096)
store i32 %23, i32* %7
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %15
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %28, i8* %31)
store i32 -1, i32* %3
br label %38
33: ; preds = %15
%34 = load i32, i32* %7
%35 = load i32, i32* %7
%36 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %35, i8* %36)
store i32 0, i32* %3
br label %38
38: ; preds = %33, %25, %10
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str = [34 x i8] c"usage: %s <vhostname> <propname>\0A\00"
@.str.1 = [52 x i8] c"Failed to get property '%s' for virtual host '%s'!\0A\00"
@.str.2 = [10 x i8] c"(%d) %*s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 3
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %22
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = call i32 (i8*, i8*, i8*, i64, ...) bitcast (i32 (...)* @zfor_getvconf to i32 (i8*, i8*, i8*, i64, ...)*)(i8* %11, i8* %13, i8* %4, i64 4096)
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %9
%17 = load i8*, i8** %12
%18 = load i8*, i8** %10
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %18)
br label %22
20: ; preds = %9
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %14, i8* %4)
br label %22
22: ; preds = %20, %16, %6
%23 = phi i32 [ -1, %6 ], [ -1, %16 ], [ 0, %20 ]
ret i32 %23
}