#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*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void input(int num[], char name[10][8]) {
  int i;
  for (i = 0; i < 10; i++) {
    printf("input NO.: ");
    scanf("%d", &num[i]);
    printf("input name: ");
    getchar();
    gets(name[i]);
  }
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11bd <input+0x7d>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe89(%rip),%rdi
call   1060 <scanf@plt>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1050 <gets@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <input+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeaa(%rip),%r12
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0xea7(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xe98(%rip),%r13
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r14,%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x4(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x8(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x8(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x10(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0xc(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x18(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x10(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x20(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x14(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x28(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x18(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x30(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x1c(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x38(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x20(%rbx),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0x40(%r14),%rdi
call   1050 <gets@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0x24,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %r13,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x48,%r14
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1050 <gets@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"input NO.: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"input name: \00"
define void @input(i32* %0, [8 x i8]* %1) {
%3 = alloca i32*
%4 = alloca [8 x i8]*
%5 = alloca i32
store i32* %0, i32** %3
store [8 x i8]* %1, [8 x i8]** %4
store i32 0, i32* %5
br label %6
6: ; preds = %24, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (...) @getchar()
%18 = load [8 x i8]*, [8 x i8]** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 %20
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %21, i64 0, i64 0
%23 = call i32 @gets(i8* %22)
br label %24
24: ; preds = %9
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"input NO.: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"input name: \00"
define void @input(i32* %0, [8 x i8]* %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @getchar()
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%8 = tail call i32 @gets(i8* %7)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds i32, i32* %0, i64 1
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 (...) @getchar()
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 1, i64 0
%15 = tail call i32 @gets(i8* %14)
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%17 = getelementptr inbounds i32, i32* %0, i64 2
%18 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %17)
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%20 = tail call i32 (...) @getchar()
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 2, i64 0
%22 = tail call i32 @gets(i8* %21)
%23 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%24 = getelementptr inbounds i32, i32* %0, i64 3
%25 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%27 = tail call i32 (...) @getchar()
%28 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 3, i64 0
%29 = tail call i32 @gets(i8* %28)
%30 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%31 = getelementptr inbounds i32, i32* %0, i64 4
%32 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %31)
%33 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%34 = tail call i32 (...) @getchar()
%35 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 4, i64 0
%36 = tail call i32 @gets(i8* %35)
%37 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%38 = getelementptr inbounds i32, i32* %0, i64 5
%39 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %38)
%40 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%41 = tail call i32 (...) @getchar()
%42 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 5, i64 0
%43 = tail call i32 @gets(i8* %42)
%44 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%45 = getelementptr inbounds i32, i32* %0, i64 6
%46 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %45)
%47 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%48 = tail call i32 (...) @getchar()
%49 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 6, i64 0
%50 = tail call i32 @gets(i8* %49)
%51 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%52 = getelementptr inbounds i32, i32* %0, i64 7
%53 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %52)
%54 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%55 = tail call i32 (...) @getchar()
%56 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 7, i64 0
%57 = tail call i32 @gets(i8* %56)
%58 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%59 = getelementptr inbounds i32, i32* %0, i64 8
%60 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %59)
%61 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%62 = tail call i32 (...) @getchar()
%63 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 8, i64 0
%64 = tail call i32 @gets(i8* %63)
%65 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%66 = getelementptr inbounds i32, i32* %0, i64 9
%67 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %66)
%68 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%69 = tail call i32 (...) @getchar()
%70 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 9, i64 0
%71 = tail call i32 @gets(i8* %70)
ret void
}