#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 /*<<< orphan*/ _and_(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cond(char *, char *, char *);
char *construct_delete(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exec_nonquery(char *);
char *format_string(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strdup(char *);
char *strtok(char *, char *);
int /*<<< orphan*/ where(int /*<<< orphan*/);
void rm_assign_task(char *id, char *rm) {
  if (rm != NULL) {
    char *aux = strdup(rm);
    char *temp = strtok(aux, ",");
    char *delete = NULL;
    while (temp != NULL) {
      delete = NULL;
      char *user_name = format_string(temp);
      delete = construct_delete(
          "GP_ASIGNACIONES",
          where(_and_(cond("NOMBRE_USUARIO_ASIG", "=", user_name),
                      cond("ID_ASIG", "=", id))));
      exec_nonquery(delete);
      free(user_name);
      free(delete);
      printf("- Deasigned user %s\n", temp);
      temp = strtok(NULL, ",");
    }
  }
}


x86 assembly (clang, -O0):
<rm_assign_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     12a1 <rm_assign_task+0x101>
mov    -0x10(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe2d(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     129c <rm_assign_task+0xfc>
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <format_string@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
lea    0xe03(%rip),%rdi
lea    0xe10(%rip),%rsi
call   1040 <cond@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xdff(%rip),%rdi
lea    0xdf6(%rip),%rsi
call   1040 <cond@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   10a0 <_and_@plt>
mov    %eax,%edi
call   1060 <where@plt>
mov    %eax,%esi
lea    0xdb3(%rip),%rdi
call   1070 <construct_delete@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1080 <exec_nonquery@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rsi
lea    0xdb2(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd72(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,-0x20(%rbp)
jmp    11e4 <rm_assign_task+0x44>
jmp    12a1 <rm_assign_task+0x101>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_assign_task>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1285 <rm_assign_task+0xe5>
mov    %rdi,%r15
mov    %rsi,%rdi
call   10c0 <strdup@plt>
lea    0xe3a(%rip),%rsi
mov    %rax,%rdi
call   10b0 <strtok@plt>
test   %rax,%rax
je     1285 <rm_assign_task+0xe5>
mov    %rax,%rbx
lea    0xe45(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1090 <format_string@plt>
mov    %rax,%r12
lea    0xe10(%rip),%rdi
mov    %r13,%rsi
mov    %rax,%rdx
call   1040 <cond@plt>
mov    %eax,%r14d
lea    0xe11(%rip),%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1040 <cond@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   10a0 <_and_@plt>
mov    %eax,%edi
call   1060 <where@plt>
lea    0xdc8(%rip),%rdi
mov    %eax,%esi
call   1070 <construct_delete@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1080 <exec_nonquery@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
lea    0xdcd(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %edi,%edi
lea    0xd8c(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11f0 <rm_assign_task+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
@.str.1 = [16 x i8] c"GP_ASIGNACIONES\00"
@.str.2 = [20 x i8] c"NOMBRE_USUARIO_ASIG\00"
@.str.3 = [2 x i8] c"=\00"
@.str.4 = [8 x i8] c"ID_ASIG\00"
@.str.5 = [21 x i8] c"- Deasigned user %s\0A\00"
define void @rm_assign_task(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %39
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i8* @strdup(i8* %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = call i8* @strtok(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %15, i8** %6
store i8* null, i8** %7
br label %16
16: ; preds = %19, %11
%17 = load i8*, i8** %6
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %38
19: ; preds = %16
store i8* null, i8** %7
%20 = load i8*, i8** %6
%21 = call i8* @format_string(i8* %20)
store i8* %21, i8** %8
%22 = load i8*, i8** %8
%23 = call i32 @cond(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %3
%25 = call i32 @cond(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = call i32 @_and_(i32 %23, i32 %25)
%27 = call i32 @where(i32 %26)
%28 = call i8* @construct_delete(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %27)
store i8* %28, i8** %7
%29 = load i8*, i8** %7
%30 = call i32 @exec_nonquery(i8* %29)
%31 = load i8*, i8** %8
%32 = call i32 @free(i8* %31)
%33 = load i8*, i8** %7
%34 = call i32 @free(i8* %33)
%35 = load i8*, i8** %6
%36 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %35)
%37 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %37, i8** %6
br label %16
38: ; preds = %16
br label %39
39: ; preds = %38, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
@.str.1 = [16 x i8] c"GP_ASIGNACIONES\00"
@.str.2 = [20 x i8] c"NOMBRE_USUARIO_ASIG\00"
@.str.3 = [2 x i8] c"=\00"
@.str.4 = [8 x i8] c"ID_ASIG\00"
@.str.5 = [21 x i8] c"- Deasigned user %s\0A\00"
define void @rm_assign_task(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %22, label %4
4: ; preds = %2
%5 = tail call i8* @strdup(i8* %1)
%6 = tail call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %22, label %8
8: ; preds = %4, %8
%9 = phi i8* [ %20, %8 ], [ %6, %4 ]
%10 = tail call i8* @format_string(i8* %9)
%11 = tail call i32 @cond(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = tail call i32 @cond(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%13 = tail call i32 @_and_(i32 %11, i32 %12)
%14 = tail call i32 @where(i32 %13)
%15 = tail call i8* @construct_delete(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = tail call i32 @exec_nonquery(i8* %15)
%17 = tail call i32 @free(i8* %10)
%18 = tail call i32 @free(i8* %15)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%20 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %8
22: ; preds = %8, %4, %2
ret void
}