#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;

/* Variables and functions */
int /*<<< orphan*/ MySAR_macro_print_msg(char *, int, int, char *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ mysql_stmt_error(int /*<<< orphan*/ *);
int mysql_stmt_execute(int /*<<< orphan*/ *);
int MySAR_execute_stmt(MYSQL_STMT *stmt) {
  int st;
  if ((st = mysql_stmt_execute(stmt)) != 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",
        215, 0x02, "FATAL: Statement Error: %s", mysql_stmt_error(stmt));
  ;
  return st;
}


x86 assembly (clang, -O0):
<MySAR_execute_stmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mysql_stmt_execute@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     117a <MySAR_execute_stmt+0x4a>
mov    -0x8(%rbp),%rdi
call   1030 <mysql_stmt_error@plt>
mov    %eax,%r8d
lea    0xe9c(%rip),%rdi
mov    $0xd7,%esi
mov    $0x2,%edx
lea    0xf2c(%rip),%rcx
call   1040 <MySAR_macro_print_msg@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySAR_execute_stmt>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <mysql_stmt_execute@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1169 <MySAR_execute_stmt+0x39>
mov    %rbx,%rdi
call   1030 <mysql_stmt_error@plt>
lea    0xeb0(%rip),%rdi
lea    0xf4a(%rip),%rcx
mov    $0xd7,%esi
mov    $0x2,%edx
mov    %eax,%r8d
call   1040 <MySAR_macro_print_msg@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 = [27 x i8] c"FATAL: Statement Error: %s\00"
define i32 @MySAR_execute_stmt(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @mysql_stmt_execute(i32* %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = call i32 @mysql_stmt_error(i32* %8)
%10 = call i32 @MySAR_macro_print_msg(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i32 215, i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
ret i32 %12
}

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 = [27 x i8] c"FATAL: Statement Error: %s\00"
define i32 @MySAR_execute_stmt(i32* %0) {
%2 = tail call i32 @mysql_stmt_execute(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @mysql_stmt_error(i32* %0)
%6 = tail call i32 @MySAR_macro_print_msg(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i32 215, i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret i32 %2
}