int main(int argc, char **argv) {
  char **x;
  if (!ini_open("testini")) {
    printf("no file\n");
    exit(1);
  }
  x = ini_read("survex", argv + 1);
  if (!x) {
    printf("no go\n");
    exit(1);
  }
  argv++;
  while (*argv) {
    printf("“%s” “%s”\n", *argv++, *x ? *x : "NULL");
    x++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1050 <ini_open@plt>
cmp    $0x0,%eax
jne    1185 <main+0x45>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <ini_read@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11c4 <main+0x84>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1249 <main+0x109>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1212 <main+0xd2>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1222 <main+0xe2>
lea    0xe19(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1222 <main+0xe2>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    11d0 <main+0x90>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r15
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1060 <ini_open@plt>
test   %eax,%eax
je     11e0 <main+0x90>
lea    0x8(%r15),%r14
lea    0xe8f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <ini_read@plt>
test   %eax,%eax
je     11e9 <main+0x99>
mov    (%r14),%rsi
test   %rsi,%rsi
je     11d4 <main+0x84>
movslq %eax,%r13
lea    0xe89(%rip),%r12
lea    0xe6f(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%r13,%rbx,1),%rdx
test   %rdx,%rdx
cmove  %r12,%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%r15,%rbx,1),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    11b0 <main+0x60>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe40(%rip),%rdi
jmp    11f0 <main+0xa0>
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"testini\00"
@.str.1 = [9 x i8] c"no file\0A\00"
@.str.2 = [7 x i8] c"survex\00"
@.str.3 = [7 x i8] c"no go\0A\00"
@.str.4 = [19 x i8] c"\E2\80\9C%s\E2\80\9D \E2\80\9C%s\E2\80\9D\0A\00"
@.str.5 = [5 x i8] c"NULL\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @ini_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ini_read to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %13)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8**
store i8** %16, i8*** %6
%17 = load i8**, i8*** %6
%18 = icmp ne i8** %17, null
br i1 %18, label %21, label %19
19: ; preds = %11
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
unreachable
21: ; preds = %11
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i32 1
store i8** %23, i8*** %5
br label %24
24: ; preds = %39, %21
%25 = load i8**, i8*** %5
%26 = load i8*, i8** %25
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %44
28: ; preds = %24
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i32 1
store i8** %30, i8*** %5
%31 = load i8*, i8** %29
%32 = load i8**, i8*** %6
%33 = load i8*, i8** %32
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %38
35: ; preds = %28
%36 = load i8**, i8*** %6
%37 = load i8*, i8** %36
br label %39
38: ; preds = %28
br label %39
39: ; preds = %38, %35
%40 = phi i8* [ %37, %35 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %38 ]
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %31, i8* %40)
%42 = load i8**, i8*** %6
%43 = getelementptr inbounds i8*, i8** %42, i32 1
store i8** %43, i8*** %6
br label %24
44: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"testini\00"
@.str.2 = [7 x i8] c"survex\00"
@.str.4 = [19 x i8] c"\E2\80\9C%s\E2\80\9D \E2\80\9C%s\E2\80\9D\0A\00"
@.str.5 = [5 x i8] c"NULL\00"
@str = [8 x i8] c"no file\00"
@str.6 = [6 x i8] c"no go\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ini_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ini_read to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.6, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
13: ; preds = %7
%14 = load i8*, i8** %8
%15 = icmp eq i8* %14, null
br i1 %15, label %31, label %16
16: ; preds = %13
%17 = sext i32 %9 to i64
%18 = inttoptr i64 %17 to i8**
br label %19
19: ; preds = %16, %19
%20 = phi i8* [ %29, %19 ], [ %14, %16 ]
%21 = phi i8** [ %28, %19 ], [ %8, %16 ]
%22 = phi i8** [ %27, %19 ], [ %18, %16 ]
%23 = load i8*, i8** %22
%24 = icmp eq i8* %23, null
%25 = select i1 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %23
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %20, i8* %25)
%27 = getelementptr inbounds i8*, i8** %22, i64 1
%28 = getelementptr inbounds i8*, i8** %21, i64 1
%29 = load i8*, i8** %28
%30 = icmp eq i8* %29, null
br i1 %30, label %31, label %19
31: ; preds = %19, %13
ret i32 0
}