#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*/ MYSQL_STMT;
typedef int /*<<< orphan*/ MYSQL_BIND;

/* Variables and functions */
int /*<<< orphan*/ MySAR_macro_print_msg(char *, int, int, char *,
                                         int /*<<< orphan*/);
int mysql_stmt_bind_result(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ mysql_stmt_error(int /*<<< orphan*/ *);
void MySAR_bind_stmt(MYSQL_STMT *stmt, MYSQL_BIND *bind) {
  int st;
  if ((st = mysql_stmt_bind_result(stmt, bind)) != 0)
    MySAR_macro_print_msg(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/coffnix/mysar-ng/refs/heads/master/bin/"
        "mysar-binary-importer/src/sql.c",
        226, 0x02, "FATAL: Statement Bind Error: %s", mysql_stmt_error(stmt));
  ;
}


x86 assembly (clang, -O0):
<MySAR_bind_stmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mysql_stmt_bind_result@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1182 <MySAR_bind_stmt+0x52>
mov    -0x8(%rbp),%rdi
call   1040 <mysql_stmt_error@plt>
mov    %eax,%r8d
lea    0xe94(%rip),%rdi
mov    $0xe2,%esi
mov    $0x2,%edx
lea    0xf24(%rip),%rcx
call   1050 <MySAR_macro_print_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySAR_bind_stmt>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mysql_stmt_bind_result@plt>
test   %eax,%eax
je     1166 <MySAR_bind_stmt+0x36>
mov    %rbx,%rdi
call   1040 <mysql_stmt_error@plt>
lea    0xeb4(%rip),%rdi
lea    0xf4e(%rip),%rcx
mov    $0xe2,%esi
mov    $0x2,%edx
mov    %eax,%r8d
pop    %rbx
jmp    1050 <MySAR_macro_print_msg@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/coffnix/mysar-ng/refs/heads/master/bin/mysar-binary-importer/src/sql.c\00"
@.str.1 = [32 x i8] c"FATAL: Statement Bind Error: %s\00"
define void @MySAR_bind_stmt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @mysql_stmt_bind_result(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = call i32 @mysql_stmt_error(i32* %11)
%13 = call i32 @MySAR_macro_print_msg(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i32 226, i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/coffnix/mysar-ng/refs/heads/master/bin/mysar-binary-importer/src/sql.c\00"
@.str.1 = [32 x i8] c"FATAL: Statement Bind Error: %s\00"
define void @MySAR_bind_stmt(i32* %0, i32* %1) {
%3 = tail call i32 @mysql_stmt_bind_result(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @mysql_stmt_error(i32* %0)
%7 = tail call i32 @MySAR_macro_print_msg(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i32 226, i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %2
ret void
}