void test_htpass_authenticate_user_unknown() {
  printf("=== RUN: %s\n", __func__);
  int rc = htpass_authenticate_user("./src/htpass_test.htpasswd", "george",
                                    "s3cret");
  printf("%s: barney - %d\n", __func__, rc);
  if (rc != 1)
    test_fail(__func__);
  printf("--- PASS: %s\n", __func__);
}


x86 assembly (clang, -O0):
<test_htpass_authenticate_user_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0xef3(%rip),%rsi
lea    0xef3(%rip),%rdx
mov    $0x0,%al
call   1030 <htpass_authenticate_user@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xee6(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
je     119c <test_htpass_authenticate_user_unknown+0x6c>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <test_fail@plt>
lea    0xeca(%rip),%rdi
lea    0xe63(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_htpass_authenticate_user_unknown>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0xecc(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0xef5(%rip),%rsi
lea    0xef5(%rip),%rdx
xor    %eax,%eax
call   1030 <htpass_authenticate_user@plt>
mov    %eax,%ebp
lea    0xeec(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
je     118f <test_htpass_authenticate_user_unknown+0x5f>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1050 <test_fail@plt>
lea    0xed7(%rip),%rdi
lea    0xe70(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"=== RUN: %s\0A\00"
@__func__.test_htpass_authenticate_user_unknown = [38 x i8] c"test_htpass_authenticate_user_unknown\00"
@.str.1 = [27 x i8] c"./src/htpass_test.htpasswd\00"
@.str.2 = [7 x i8] c"george\00"
@.str.3 = [7 x i8] c"s3cret\00"
@.str.4 = [17 x i8] c"%s: barney - %d\0A\00"
@.str.5 = [14 x i8] c"--- PASS: %s\0A\00"
define void @test_htpass_authenticate_user_unknown() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0))
%3 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @htpass_authenticate_user to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @test_fail to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"=== RUN: %s\0A\00"
@__func__.test_htpass_authenticate_user_unknown = [38 x i8] c"test_htpass_authenticate_user_unknown\00"
@.str.1 = [27 x i8] c"./src/htpass_test.htpasswd\00"
@.str.2 = [7 x i8] c"george\00"
@.str.3 = [7 x i8] c"s3cret\00"
@.str.4 = [17 x i8] c"%s: barney - %d\0A\00"
@.str.5 = [14 x i8] c"--- PASS: %s\0A\00"
define void @test_htpass_authenticate_user_unknown() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0))
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @htpass_authenticate_user to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %2, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @test_fail to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.test_htpass_authenticate_user_unknown, i64 0, i64 0))
ret void
}