#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_ROW;
typedef int /*<<< orphan*/ MYSQL_RES;
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int /*<<< orphan*/ mysql_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ *mysql_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ mysql_query(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ mysql_real_connect(int /*<<< orphan*/ *, char *, char *,
                                      char *, char *, int /*<<< orphan*/,
                                      int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, float,
                           char *, char *);
void insertar_nvo_bien(char *nombre, char *cliente, float monto,
                       char *fecha_ini, char *fecha_fin) {
  MYSQL *conexion;
  MYSQL_RES *R;
  MYSQL_ROW COL;
  char *servidor = "localhost";
  char *usuario = "root";
  char *pass = "1234";
  char *base = "casaempenio";
  conexion = mysql_init(NULL);
  mysql_real_connect(conexion, servidor, usuario, pass, base, 0, NULL, 0);
  char *sentencia =
      "insert into "
      "bienes(nombreBien,nombreCliente,monto,fecha_inicio,fecha_final) values(";
  char buffer[500];
  sprintf(buffer, "%s'%s','%s',%f,'%s','%s'); ", sentencia, nombre, cliente,
          monto, fecha_ini, fecha_fin);
  mysql_query(conexion, buffer);
  mysql_close(conexion);
}


x86 assembly (clang, -O0):
<insertar_nvo_bien>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    0xe89(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe88(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe82(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe7c(%rip),%rax
mov    %rax,-0x60(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <mysql_init@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
xor    %r9d,%r9d
xor    %eax,%eax
movq   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1040 <mysql_real_connect@plt>
lea    0xe42(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    -0x260(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
movss  -0x14(%rbp),%xmm0
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%rax
lea    0xe6b(%rip),%rsi
mov    %rax,(%rsp)
call   1070 <sprintf@plt>
mov    -0x30(%rbp),%rdi
lea    -0x260(%rbp),%rsi
call   1030 <mysql_query@plt>
mov    -0x30(%rbp),%rdi
call   1050 <mysql_close@plt>
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertar_nvo_bien>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
movss  %xmm0,0xc(%rsp)
mov    %rsi,%r12
mov    %rdi,%r13
xor    %edi,%edi
call   1060 <mysql_init@plt>
mov    %rax,%rbx
lea    0xe7c(%rip),%rsi
lea    0xe7f(%rip),%rdx
lea    0xe7d(%rip),%rcx
lea    0xe7b(%rip),%r8
mov    %rax,%rdi
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1040 <mysql_real_connect@plt>
add    $0x8,%rsp
lea    0xec1(%rip),%rsi
lea    0xe66(%rip),%rdx
lea    0x18(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rcx
mov    %r12,%r8
movss  0x14(%rsp),%xmm0
mov    %r15,%r9
push   %r14
call   1070 <sprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <mysql_query@plt>
mov    %rbx,%rdi
call   1050 <mysql_close@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"localhost\00"
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [5 x i8] c"1234\00"
@.str.3 = [12 x i8] c"casaempenio\00"
@.str.4 = [84 x i8] c"insert into bienes(nombreBien,nombreCliente,monto,fecha_inicio,fecha_final) values(\00"
@.str.5 = [28 x i8] c"%s'%s','%s',%f,'%s','%s'); \00"
define void @insertar_nvo_bien(i8* %0, i8* %1, float %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca float
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca [500 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store float %2, float* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %15
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %16
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8** %17
%20 = call i32* @mysql_init(i32* null)
store i32* %20, i32** %11
%21 = load i32*, i32** %11
%22 = load i8*, i8** %14
%23 = load i8*, i8** %15
%24 = load i8*, i8** %16
%25 = load i8*, i8** %17
%26 = call i32 @mysql_real_connect(i32* %21, i8* %22, i8* %23, i8* %24, i8* %25, i32 0, i32* null, i32 0)
store i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.4, i64 0, i64 0), i8** %18
%27 = getelementptr inbounds [500 x i8], [500 x i8]* %19, i64 0, i64 0
%28 = load i8*, i8** %18
%29 = load i8*, i8** %6
%30 = load i8*, i8** %7
%31 = load float, float* %8
%32 = load i8*, i8** %9
%33 = load i8*, i8** %10
%34 = call i32 @sprintf(i8* %27, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* %28, i8* %29, i8* %30, float %31, i8* %32, i8* %33)
%35 = load i32*, i32** %11
%36 = getelementptr inbounds [500 x i8], [500 x i8]* %19, i64 0, i64 0
%37 = call i32 @mysql_query(i32* %35, i8* %36)
%38 = load i32*, i32** %11
%39 = call i32 @mysql_close(i32* %38)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"localhost\00"
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [5 x i8] c"1234\00"
@.str.3 = [12 x i8] c"casaempenio\00"
@.str.4 = [84 x i8] c"insert into bienes(nombreBien,nombreCliente,monto,fecha_inicio,fecha_final) values(\00"
@.str.5 = [28 x i8] c"%s'%s','%s',%f,'%s','%s'); \00"
define void @insertar_nvo_bien(i8* %0, i8* %1, float %2, i8* %3, i8* %4) {
%6 = alloca [500 x i8]
%7 = tail call i32* @mysql_init(i32* null)
%8 = tail call i32 @mysql_real_connect(i32* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0, i32* null, i32 0)
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%10 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %1, float %2, i8* %3, i8* %4)
%11 = call i32 @mysql_query(i32* %7, i8* %9)
%12 = call i32 @mysql_close(i32* %7)
ret void
}