#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*/ check_bank(int, int);
int /*<<< orphan*/ check_maxNodes(int);
int /*<<< orphan*/ mtdLib_str_getColByDelPos_int(char *, char, int, int *);
int mtdLib_str_getColNumbers(char *, char);
int /*<<< orphan*/ printf(char *, ...);
void process_client_message(char *messageLine) {
  char delimiter = ',';
  int nCol = mtdLib_str_getColNumbers(messageLine, delimiter);
  int a, b, q;
  a = b = q = 0;
  mtdLib_str_getColByDelPos_int(messageLine, delimiter, 1, &a);
  mtdLib_str_getColByDelPos_int(messageLine, delimiter, 2, &b);
  mtdLib_str_getColByDelPos_int(messageLine, delimiter, 3, &q);
  if (!check_bank(a, b)) {
    printf("\nNO2");
    printf(" a[%d] b[%d] q[%d]", a, b, q);
    return;
  }
  if (!check_maxNodes(q)) {
    printf("\nNO");
    printf(" a[%d] b[%d] q[%d]", a, b, q);
    return;
  } else {
    printf("\nYES");
    printf(" a[%d] b[%d] q[%d]", a, b, q);
    return;
  }
}


x86 assembly (clang, -O0):
<process_client_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x2c,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1070 <mtdLib_str_getColNumbers@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    -0x14(%rbp),%rcx
movsbl -0x9(%rbp),%esi
call   1060 <mtdLib_str_getColByDelPos_int@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
lea    -0x18(%rbp),%rcx
movsbl -0x9(%rbp),%esi
call   1060 <mtdLib_str_getColByDelPos_int@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%edx
lea    -0x1c(%rbp),%rcx
movsbl -0x9(%rbp),%esi
call   1060 <mtdLib_str_getColByDelPos_int@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <check_bank@plt>
cmp    $0x0,%eax
jne    1205 <process_client_message+0xb5>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1265 <process_client_message+0x115>
mov    -0x1c(%rbp),%edi
call   1040 <check_maxNodes@plt>
cmp    $0x0,%eax
jne    1240 <process_client_message+0xf0>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1265 <process_client_message+0x115>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_client_message>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x2c,%esi
call   1070 <mtdLib_str_getColNumbers@plt>
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
call   1060 <mtdLib_str_getColByDelPos_int@plt>
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    $0x2,%edx
call   1060 <mtdLib_str_getColByDelPos_int@plt>
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    $0x3,%edx
call   1060 <mtdLib_str_getColByDelPos_int@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <check_bank@plt>
test   %eax,%eax
je     11e6 <process_client_message+0x96>
mov    0x4(%rsp),%edi
call   1040 <check_maxNodes@plt>
test   %eax,%eax
je     11ef <process_client_message+0x9f>
lea    0xe38(%rip),%rdi
jmp    11f6 <process_client_message+0xa6>
lea    0xe13(%rip),%rdi
jmp    11f6 <process_client_message+0xa6>
lea    0xe22(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xdf5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0ANO2\00"
@.str.1 = [19 x i8] c" a[%d] b[%d] q[%d]\00"
@.str.2 = [4 x i8] c"\0ANO\00"
@.str.3 = [5 x i8] c"\0AYES\00"
define void @process_client_message(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
store i8 44, i8* %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %3
%10 = call i32 @mtdLib_str_getColNumbers(i8* %8, i8 signext %9)
store i32 %10, i32* %4
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %3
%13 = call i32 @mtdLib_str_getColByDelPos_int(i8* %11, i8 signext %12, i32 1, i32* %5)
%14 = load i8*, i8** %2
%15 = load i8, i8* %3
%16 = call i32 @mtdLib_str_getColByDelPos_int(i8* %14, i8 signext %15, i32 2, i32* %6)
%17 = load i8*, i8** %2
%18 = load i8, i8* %3
%19 = call i32 @mtdLib_str_getColByDelPos_int(i8* %17, i8 signext %18, i32 3, i32* %7)
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call i32 @check_bank(i32 %20, i32 %21)
%23 = icmp ne i32 %22, 0
br i1 %23, label %30, label %24
24: ; preds = %1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %26, i32 %27, i32 %28)
br label %46
30: ; preds = %1
%31 = load i32, i32* %7
%32 = call i32 @check_maxNodes(i32 %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %40, label %34
34: ; preds = %30
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %37, i32 %38)
br label %46
40: ; preds = %30
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = load i32, i32* %7
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %43, i32 %44)
br label %46
46: ; preds = %40, %34, %24
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0ANO2\00"
@.str.1 = [19 x i8] c" a[%d] b[%d] q[%d]\00"
@.str.2 = [4 x i8] c"\0ANO\00"
@.str.3 = [5 x i8] c"\0AYES\00"
define void @process_client_message(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = tail call i32 @mtdLib_str_getColNumbers(i8* %0, i8 signext 44)
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
store i32 0, i32* %2
%9 = call i32 @mtdLib_str_getColByDelPos_int(i8* %0, i8 signext 44, i32 1, i32* %2)
%10 = call i32 @mtdLib_str_getColByDelPos_int(i8* %0, i8 signext 44, i32 2, i32* %3)
%11 = call i32 @mtdLib_str_getColByDelPos_int(i8* %0, i8 signext 44, i32 3, i32* %4)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @check_bank(i32 %12, i32 %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
br label %38
22: ; preds = %1
%23 = load i32, i32* %4
%24 = call i32 @check_maxNodes(i32 %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
br label %38
32: ; preds = %22
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %35, i32 %36)
br label %38
38: ; preds = %32, %26, %16
ret void
}