#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 */
struct cli {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, ...);
int atoi(char *);
int /*<<< orphan*/ cli_send(struct cli *, char *, scalar_t__);
int /*<<< orphan*/ free(char *);
scalar_t__ strlen(char *);
int _set_integer(struct cli *cli, int argc, char *argv[]) {
  {
    char *__tmp;
    asprintf(&__tmp, "this is a set int cmd"
                     "\n\r");
    cli_send(cli, __tmp, strlen(__tmp) + 1);
    free(__tmp);
  };
  {
    char *__tmp;
    asprintf(&__tmp,
             "argc = %d"
             "\n\r",
             argc);
    cli_send(cli, __tmp, strlen(__tmp) + 1);
    free(__tmp);
  };
  if (argc <= 0) {
    {
      char *__tmp;
      asprintf(&__tmp, "> "
                       "argc <= 0 is invalid"
                       "\n\r");
      cli_send(cli, __tmp, strlen(__tmp) + 1);
      free(__tmp);
    };
    return (-1);
  }
  {
    char *__tmp;
    asprintf(&__tmp,
             "argv[0] = %s"
             "\n\r",
             argv[0]);
    cli_send(cli, __tmp, strlen(__tmp) + 1);
    free(__tmp);
  };
  int money = atoi(argv[0]);
  {
    char *__tmp;
    asprintf(&__tmp,
             "my money = %d dollars"
             "\n\r",
             money);
    cli_send(cli, __tmp, strlen(__tmp) + 1);
    free(__tmp);
  };
  return (0);
}


x86 assembly (clang, -O0):
<_set_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x28(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1070 <cli_send@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%edx
lea    -0x30(%rbp),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1070 <cli_send@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x14(%rbp)
jg     1257 <_set_integer+0x107>
lea    -0x38(%rbp),%rdi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1070 <cli_send@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    131f <_set_integer+0x1cf>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
lea    -0x40(%rbp),%rdi
lea    0xdd4(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1070 <cli_send@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%edx
lea    -0x50(%rbp),%rdi
lea    0xd7d(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x90(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1070 <cli_send@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_integer>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%r12
lea    0xe95(%rip),%rsi
xor    %r14d,%r14d
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <cli_send@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
lea    0xe71(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <cli_send@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
test   %ebp,%ebp
jle    1264 <_set_integer+0x114>
mov    (%r15),%rdx
lea    0xe50(%rip),%rsi
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <cli_send@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    (%r15),%rdi
call   1060 <atoi@plt>
lea    0xe1e(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <cli_send@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
jmp    12a3 <_set_integer+0x153>
lea    0xdb9(%rip),%rsi
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <cli_send@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.cli = type { i32 }
@.str = [24 x i8] c"this is a set int cmd\0A\0D\00"
@.str.1 = [12 x i8] c"argc = %d\0A\0D\00"
@.str.2 = [25 x i8] c"> argc <= 0 is invalid\0A\0D\00"
@.str.3 = [15 x i8] c"argv[0] = %s\0A\0D\00"
@.str.4 = [24 x i8] c"my money = %d dollars\0A\0D\00"
define i32 @_set_integer(%struct.cli* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.cli*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
store %struct.cli* %0, %struct.cli** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%14 = call i32 (i8**, i8*, ...) @asprintf(i8** %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%15 = load %struct.cli*, %struct.cli** %5
%16 = load i8*, i8** %8
%17 = load i8*, i8** %8
%18 = call i64 @strlen(i8* %17)
%19 = add nsw i64 %18, 1
%20 = call i32 @cli_send(%struct.cli* %15, i8* %16, i64 %19)
%21 = load i8*, i8** %8
%22 = call i32 @free(i8* %21)
%23 = load i32, i32* %6
%24 = call i32 (i8**, i8*, ...) @asprintf(i8** %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = load %struct.cli*, %struct.cli** %5
%26 = load i8*, i8** %9
%27 = load i8*, i8** %9
%28 = call i64 @strlen(i8* %27)
%29 = add nsw i64 %28, 1
%30 = call i32 @cli_send(%struct.cli* %25, i8* %26, i64 %29)
%31 = load i8*, i8** %9
%32 = call i32 @free(i8* %31)
%33 = load i32, i32* %6
%34 = icmp sle i32 %33, 0
br i1 %34, label %35, label %45
35: ; preds = %3
%36 = call i32 (i8**, i8*, ...) @asprintf(i8** %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%37 = load %struct.cli*, %struct.cli** %5
%38 = load i8*, i8** %10
%39 = load i8*, i8** %10
%40 = call i64 @strlen(i8* %39)
%41 = add nsw i64 %40, 1
%42 = call i32 @cli_send(%struct.cli* %37, i8* %38, i64 %41)
%43 = load i8*, i8** %10
%44 = call i32 @free(i8* %43)
store i32 -1, i32* %4
br label %72
45: ; preds = %3
%46 = load i8**, i8*** %7
%47 = getelementptr inbounds i8*, i8** %46, i64 0
%48 = load i8*, i8** %47
%49 = call i32 (i8**, i8*, ...) @asprintf(i8** %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %48)
%50 = load %struct.cli*, %struct.cli** %5
%51 = load i8*, i8** %11
%52 = load i8*, i8** %11
%53 = call i64 @strlen(i8* %52)
%54 = add nsw i64 %53, 1
%55 = call i32 @cli_send(%struct.cli* %50, i8* %51, i64 %54)
%56 = load i8*, i8** %11
%57 = call i32 @free(i8* %56)
%58 = load i8**, i8*** %7
%59 = getelementptr inbounds i8*, i8** %58, i64 0
%60 = load i8*, i8** %59
%61 = call i32 @atoi(i8* %60)
store i32 %61, i32* %12
%62 = load i32, i32* %12
%63 = call i32 (i8**, i8*, ...) @asprintf(i8** %13, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %62)
%64 = load %struct.cli*, %struct.cli** %5
%65 = load i8*, i8** %13
%66 = load i8*, i8** %13
%67 = call i64 @strlen(i8* %66)
%68 = add nsw i64 %67, 1
%69 = call i32 @cli_send(%struct.cli* %64, i8* %65, i64 %68)
%70 = load i8*, i8** %13
%71 = call i32 @free(i8* %70)
store i32 0, i32* %4
br label %72
72: ; preds = %45, %35
%73 = load i32, i32* %4
ret i32 %73
}

LLVM IR (-O2):
%struct.cli = type { i32 }
@.str = [24 x i8] c"this is a set int cmd\0A\0D\00"
@.str.1 = [12 x i8] c"argc = %d\0A\0D\00"
@.str.2 = [25 x i8] c"> argc <= 0 is invalid\0A\0D\00"
@.str.3 = [15 x i8] c"argv[0] = %s\0A\0D\00"
@.str.4 = [24 x i8] c"my money = %d dollars\0A\0D\00"
define i32 @_set_integer(%struct.cli* %0, i32 %1, i8** nocapture %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = bitcast i8** %4 to i8*
%10 = call i32 (i8**, i8*, ...) @asprintf(i8** %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* dereferenceable(1) %11)
%13 = add nsw i64 %12, 1
%14 = call i32 @cli_send(%struct.cli* %0, i8* %11, i64 %13)
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
%17 = bitcast i8** %5 to i8*
%18 = call i32 (i8**, i8*, ...) @asprintf(i8** %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%19 = load i8*, i8** %5
%20 = call i64 @strlen(i8* dereferenceable(1) %19)
%21 = add nsw i64 %20, 1
%22 = call i32 @cli_send(%struct.cli* %0, i8* %19, i64 %21)
%23 = load i8*, i8** %5
%24 = call i32 @free(i8* %23)
%25 = icmp slt i32 %1, 1
br i1 %25, label %26, label %35
26: ; preds = %3
%27 = bitcast i8** %6 to i8*
%28 = call i32 (i8**, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%29 = load i8*, i8** %6
%30 = call i64 @strlen(i8* dereferenceable(1) %29)
%31 = add nsw i64 %30, 1
%32 = call i32 @cli_send(%struct.cli* %0, i8* %29, i64 %31)
%33 = load i8*, i8** %6
%34 = call i32 @free(i8* %33)
br label %55
35: ; preds = %3
%36 = bitcast i8** %7 to i8*
%37 = load i8*, i8** %2
%38 = call i32 (i8**, i8*, ...) @asprintf(i8** %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = load i8*, i8** %7
%40 = call i64 @strlen(i8* dereferenceable(1) %39)
%41 = add nsw i64 %40, 1
%42 = call i32 @cli_send(%struct.cli* %0, i8* %39, i64 %41)
%43 = load i8*, i8** %7
%44 = call i32 @free(i8* %43)
%45 = load i8*, i8** %2
%46 = call i32 @atoi(i8* %45)
%47 = bitcast i8** %8 to i8*
%48 = call i32 (i8**, i8*, ...) @asprintf(i8** %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%49 = load i8*, i8** %8
%50 = call i64 @strlen(i8* dereferenceable(1) %49)
%51 = add nsw i64 %50, 1
%52 = call i32 @cli_send(%struct.cli* %0, i8* %49, i64 %51)
%53 = load i8*, i8** %8
%54 = call i32 @free(i8* %53)
br label %55
55: ; preds = %35, %26
%56 = phi i32 [ -1, %26 ], [ 0, %35 ]
ret i32 %56
}