#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*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int InputInfo(char stuName[][20], char stuID[][10]) {
  int stuNum, i;
  printf("Please input the number of students. \n");
  scanf("%d", &stuNum);
  getchar();
  printf("Please input the information of students.\n");
  for (i = 0; i < stuNum; i++) {
    scanf("%s", stuID[i]);
    scanf("%s", stuName[i]);
  }
  return stuNum;
}


x86 assembly (clang, -O0):
<InputInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11cc <InputInfo+0x9c>
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x18(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1178 <InputInfo+0x48>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InputInfo>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11c0 <InputInfo+0x90>
lea    0xe84(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
add    $0xa,%r14
add    $0x14,%r12
cmp    %rax,%rbx
jl     1190 <InputInfo+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Please input the number of students. \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"Please input the information of students.\0A\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @InputInfo([20 x i8]* %0, [10 x i8]* %1) {
%3 = alloca [20 x i8]*
%4 = alloca [10 x i8]*
%5 = alloca i32
%6 = alloca i32
store [20 x i8]* %0, [20 x i8]** %3
store [10 x i8]* %1, [10 x i8]** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%9 = call i32 (...) @getchar()
%10 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %11
11: ; preds = %28, %2
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %31
15: ; preds = %11
%16 = load [10 x i8]*, [10 x i8]** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %16, i64 %18
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %19, i64 0, i64 0
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = load [20 x i8]*, [20 x i8]** %3
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %22, i64 %24
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %15
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %11
31: ; preds = %11
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%s\00"
@str = [38 x i8] c"Please input the number of students. \00"
@str.4 = [42 x i8] c"Please input the information of students.\00"
define i32 @InputInfo([20 x i8]* %0, [10 x i8]* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = call i32 (...) @getchar()
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %2, %11
%12 = phi i64 [ %17, %11 ], [ 0, %2 ]
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 %12, i64 0
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %12, i64 0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = add nuw nsw i64 %12, 1
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %11, label %21
21: ; preds = %11, %2
%22 = phi i32 [ %9, %2 ], [ %18, %11 ]
ret i32 %22
}