#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 */
typedef int /*<<< orphan*/ sqlite3_stmt;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ SQLITE_NULL;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
char *sqlite3_column_text(int /*<<< orphan*/ *, int);
scalar_t__ sqlite3_column_type(int /*<<< orphan*/ *, int);
void check_ambig_text_column(sqlite3_stmt *stmt, char *columnname, int column,
                             FILE *logfile) {
  if (sqlite3_column_type(stmt, column) != SQLITE_NULL) {
    fprintf(logfile, "%s: %s\n", columnname, sqlite3_column_text(stmt, column));
  }
}


x86 assembly (clang, -O0):
<check_ambig_text_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <sqlite3_column_type@plt>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     1196 <check_ambig_text_column+0x66>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <sqlite3_column_text@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
lea    0xe6f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ambig_text_column>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <sqlite3_column_type@plt>
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%rax
jne    1160 <check_ambig_text_column+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <sqlite3_column_text@plt>
lea    0xe8f(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@SQLITE_NULL = global i64 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @check_ambig_text_column(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = call i64 @sqlite3_column_type(i32* %9, i32 %10)
%12 = load i64, i64* @SQLITE_NULL
%13 = icmp ne i64 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %4
%15 = load i32*, i32** %8
%16 = load i8*, i8** %6
%17 = load i32*, i32** %5
%18 = load i32, i32* %7
%19 = call i8* @sqlite3_column_text(i32* %17, i32 %18)
%20 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %19)
br label %21
21: ; preds = %14, %4
ret void
}

LLVM IR (-O2):
@SQLITE_NULL = global i64 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @check_ambig_text_column(i32* %0, i8* %1, i32 %2, i32* nocapture %3) {
%5 = tail call i64 @sqlite3_column_type(i32* %0, i32 %2)
%6 = load i64, i64* @SQLITE_NULL
%7 = icmp eq i64 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i8* @sqlite3_column_text(i32* %0, i32 %2)
%10 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %9)
br label %11
11: ; preds = %8, %4
ret void
}