#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 /*<<< orphan*/ cli_send(struct cli *, char *, scalar_t__);
int /*<<< orphan*/ free(char *);
scalar_t__ strlen(char *);
int _get_info(struct cli *cli, int argc, char *argv[]) {
  int money = 100;
  {
    char *__tmp;
    asprintf(&__tmp, "this is a get info cmd"
                     "\n\r");
    cli_send(cli, __tmp, strlen(__tmp) + 1);
    free(__tmp);
  };
  {
    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):
<_get_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
lea    -0x28(%rbp),%rdi
lea    0xe9b(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1060 <cli_send@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%edx
lea    -0x30(%rbp),%rdi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1060 <cli_send@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_info>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeb2(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    (%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <cli_send@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
lea    0xe96(%rip),%rsi
mov    %rsp,%rdi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    (%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <cli_send@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.cli = type { i32 }
@.str = [25 x i8] c"this is a get info cmd\0A\0D\00"
@.str.1 = [24 x i8] c"my money = %d dollars\0A\0D\00"
define i32 @_get_info(%struct.cli* %0, i32 %1, i8** %2) {
%4 = alloca %struct.cli*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store %struct.cli* %0, %struct.cli** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
store i32 100, i32* %7
%10 = call i32 (i8**, i8*, ...) @asprintf(i8** %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.cli*, %struct.cli** %4
%12 = load i8*, i8** %8
%13 = load i8*, i8** %8
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @cli_send(%struct.cli* %11, i8* %12, i64 %15)
%17 = load i8*, i8** %8
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* %7
%20 = call i32 (i8**, i8*, ...) @asprintf(i8** %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load %struct.cli*, %struct.cli** %4
%22 = load i8*, i8** %9
%23 = load i8*, i8** %9
%24 = call i64 @strlen(i8* %23)
%25 = add nsw i64 %24, 1
%26 = call i32 @cli_send(%struct.cli* %21, i8* %22, i64 %25)
%27 = load i8*, i8** %9
%28 = call i32 @free(i8* %27)
ret i32 0
}

LLVM IR (-O2):
%struct.cli = type { i32 }
@.str = [25 x i8] c"this is a get info cmd\0A\0D\00"
@.str.1 = [24 x i8] c"my money = %d dollars\0A\0D\00"
define i32 @_get_info(%struct.cli* %0, i32 %1, i8** nocapture readnone %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 (i8**, i8*, ...) @asprintf(i8** %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* dereferenceable(1) %8)
%10 = add nsw i64 %9, 1
%11 = call i32 @cli_send(%struct.cli* %0, i8* %8, i64 %10)
%12 = load i8*, i8** %4
%13 = call i32 @free(i8* %12)
%14 = bitcast i8** %5 to i8*
%15 = call i32 (i8**, i8*, ...) @asprintf(i8** %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 100)
%16 = load i8*, i8** %5
%17 = call i64 @strlen(i8* dereferenceable(1) %16)
%18 = add nsw i64 %17, 1
%19 = call i32 @cli_send(%struct.cli* %0, i8* %16, i64 %18)
%20 = load i8*, i8** %5
%21 = call i32 @free(i8* %20)
ret i32 0
}