#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 u_int;

/* Variables and functions */
int packet_get_int();
char *packet_get_string(int /*<<< orphan*/ *);
char **xmalloc(int);
char **input_userauth_info_response() {
  int i;
  u_int nresp;
  char **response = NULL;
  nresp = packet_get_int();
  if (nresp > 0) {
    response = xmalloc(nresp * sizeof(char *));
    for (i = 0; i < nresp; i++)
      response[i] = packet_get_string(NULL);
  }
  return response;
}


x86 assembly (clang, -O0):
<input_userauth_info_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <packet_get_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11a5 <input_userauth_info_response+0x75>
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a0 <input_userauth_info_response+0x70>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <packet_get_string@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <input_userauth_info_response+0x3e>
jmp    11a5 <input_userauth_info_response+0x75>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_userauth_info_response>:
push   %r15
push   %r14
push   %rbx
xor    %r15d,%r15d
xor    %eax,%eax
call   1050 <packet_get_int@plt>
test   %eax,%eax
jle    1174 <input_userauth_info_response+0x44>
mov    %eax,%r14d
lea    0x0(,%r14,8),%edi
call   1030 <xmalloc@plt>
mov    %rax,%r15
mov    %r14d,%r14d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <packet_get_string@plt>
mov    %rax,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1160 <input_userauth_info_response+0x30>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8** @input_userauth_info_response() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8**
store i8** null, i8*** %3
%4 = call i32 (...) @packet_get_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %27
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call i8** @xmalloc(i32 %11)
store i8** %12, i8*** %3
store i32 0, i32* %1
br label %13
13: ; preds = %23, %7
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = call i8* @packet_get_string(i32* null)
%19 = load i8**, i8*** %3
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
store i8* %18, i8** %22
br label %23
23: ; preds = %17
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %13
26: ; preds = %13
br label %27
27: ; preds = %26, %0
%28 = load i8**, i8*** %3
ret i8** %28
}

LLVM IR (-O2):
define i8** @input_userauth_info_response() {
%1 = tail call i32 (...) @packet_get_int()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = shl i32 %1, 3
%5 = tail call i8** @xmalloc(i32 %4)
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %3, %7
%8 = phi i64 [ 0, %3 ], [ %11, %7 ]
%9 = tail call i8* @packet_get_string(i32* null)
%10 = getelementptr inbounds i8*, i8** %5, i64 %8
store i8* %9, i8** %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %0
%14 = phi i8** [ null, %0 ], [ %5, %7 ]
ret i8** %14
}