#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 *, int);
void eliminar_cliente_id(int id) {
  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[100] = "delete from clientes where idclientes=";
  char buffer[512];
  sprintf(buffer, "%s %d;", sentencia, id);
  mysql_query(conexion, buffer);
  mysql_close(conexion);
}


x86 assembly (clang, -O0):
<eliminar_cliente_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe8b(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe84(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe7e(%rip),%rax
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <mysql_init@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
xor    %r9d,%r9d
xor    %eax,%eax
movq   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1050 <mysql_real_connect@plt>
lea    -0xb0(%rbp),%rdi
lea    0xe4d(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x2b0(%rbp),%rdi
lea    -0xb0(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xe1b(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x2b0(%rbp),%rsi
call   1030 <mysql_query@plt>
mov    -0x10(%rbp),%rdi
call   1060 <mysql_close@plt>
add    $0x2c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eliminar_cliente_id>:
push   %rbp
push   %r14
push   %rbx
sub    $0x270,%rsp
mov    %edi,%r14d
xor    %edi,%edi
call   1060 <mysql_init@plt>
mov    %rax,%rbx
lea    0xe91(%rip),%rsi
lea    0xe94(%rip),%rdx
lea    0xe92(%rip),%rcx
lea    0xe90(%rip),%r8
mov    %rax,%rdi
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1040 <mysql_real_connect@plt>
add    $0x10,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe72(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe56(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xe33(%rip),%rsi
lea    0x70(%rsp),%rbp
mov    %rsp,%rdx
mov    %rbp,%rdi
mov    %r14d,%ecx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <mysql_query@plt>
mov    %rbx,%rdi
call   1050 <mysql_close@plt>
add    $0x270,%rsp
pop    %rbx
pop    %r14
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"
@__const.eliminar_cliente_id.sentencia = [100 x i8] c"delete from clientes where idclientes=\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.4 = [7 x i8] c"%s %d;\00"
define void @eliminar_cliente_id(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [100 x i8]
%11 = alloca [512 x i8]
store i32 %0, i32* %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8** %9
%12 = call i32* @mysql_init(i32* null)
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = call i32 @mysql_real_connect(i32* %13, i8* %14, i8* %15, i8* %16, i8* %17, i32 0, i32* null, i32 0)
%19 = bitcast [100 x i8]* %10 to i8*
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%22 = load i32, i32* %2
%23 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %21, i32 %22)
%24 = load i32*, i32** %3
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%26 = call i32 @mysql_query(i32* %24, i8* %25)
%27 = load i32*, i32** %3
%28 = call i32 @mysql_close(i32* %27)
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"
@__const.eliminar_cliente_id.sentencia = [100 x i8] c"delete from clientes where idclientes=\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.4 = [7 x i8] c"%s %d;\00"
define void @eliminar_cliente_id(i32 %0) {
%2 = alloca [100 x i8]
%3 = alloca [512 x i8]
%4 = tail call i32* @mysql_init(i32* null)
%5 = tail call i32 @mysql_real_connect(i32* %4, 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)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6, i32 %0)
%9 = call i32 @mysql_query(i32* %4, i8* %7)
%10 = call i32 @mysql_close(i32* %4)
ret void
}