#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 */
int SQLITE_OK;
int /*<<< orphan*/ assert(int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, char const *,
                           char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
int unixLogErrorAtLine(int errcode, const char *zFunc, const char *zPath,
                       int iLine) {
  char *zErr;
  int iErrno = errno;
  zErr = strerror(iErrno);
  assert(errcode != SQLITE_OK);
  if (zPath == 0) {
    zPath = "";
  }
  fprintf(stderr, "myvfs.c:%d: (%d) %s(%s) - %s", iLine, iErrno, zFunc, zPath,
          zErr);
  return errcode;
}


x86 assembly (clang, -O0):
<unixLogErrorAtLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1050 <strerror@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
jne    118d <unixLogErrorAtLine+0x5d>
lea    0xe93(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x28(%rbp),%rax
lea    0xe51(%rip),%rsi
mov    %rax,(%rsp)
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unixLogErrorAtLine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %rdx,%rbp
mov    %rsi,%r14
mov    %edi,%r12d
mov    0x2e82(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1050 <strerror@plt>
mov    %rax,%r13
mov    0x2e87(%rip),%rax
xor    %edi,%edi
cmp    %r12d,(%rax)
setne  %dil
call   1030 <assert@plt>
test   %rbp,%rbp
lea    0xea3(%rip),%r9
cmovne %rbp,%r9
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    %r13,(%rsp)
lea    0xe6f(%rip),%rsi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %r14,%r8
call   1040 <fprintf@plt>
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
@SQLITE_OK = global i32 0
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [29 x i8] c"myvfs.c:%d: (%d) %s(%s) - %s\00"
define i32 @unixLogErrorAtLine(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i32, i32* @errno
store i32 %11, i32* %10
%12 = load i32, i32* %10
%13 = call i8* @strerror(i32 %12)
store i8* %13, i8** %9
%14 = load i32, i32* %5
%15 = load i32, i32* @SQLITE_OK
%16 = icmp ne i32 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %7
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %22
21: ; preds = %4
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %7
br label %22
22: ; preds = %21, %4
%23 = load i32, i32* @stderr
%24 = load i32, i32* %8
%25 = load i32, i32* %10
%26 = load i8*, i8** %6
%27 = load i8*, i8** %7
%28 = load i8*, i8** %9
%29 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %25, i8* %26, i8* %27, i8* %28)
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
@errno = global i32 0
@SQLITE_OK = global i32 0
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [29 x i8] c"myvfs.c:%d: (%d) %s(%s) - %s\00"
define i32 @unixLogErrorAtLine(i32 returned %0, i8* %1, i8* %2, i32 %3) {
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = load i32, i32* @SQLITE_OK
%8 = icmp ne i32 %7, %0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = icmp eq i8* %2, null
%12 = select i1 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %5, i8* %1, i8* %12, i8* %6)
ret i32 %0
}