#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
void Read(int xn[], int txn, int hn[], int thn) {
  int i;
  printf("\n\n");
  for (i = 0; i < txn; i++) {
    printf("xn(%d): ", i);
    scanf("%d", &xn[i]);
  }
  fflush(stdin);
  printf("\n");
  for (i = 0; i < thn; i++) {
    printf("hn(%d): ", i);
    scanf("%d", &hn[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a1 <Read+0x71>
mov    -0x20(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115b <Read+0x2b>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    120a <Read+0xda>
mov    -0x20(%rbp),%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe15(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11c4 <Read+0x94>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,0x4(%rsp)
mov    %rdx,%r13
mov    %esi,%ebx
mov    %rdi,%rbp
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
jle    11b4 <Read+0x64>
mov    %ebx,%r14d
lea    0xe7f(%rip),%r15
lea    0xe81(%rip),%r12
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
add    $0x1,%rbx
add    $0x4,%rbp
cmp    %rbx,%r14
jne    1190 <Read+0x40>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1214 <Read+0xc4>
mov    %eax,%ebp
lea    0xe2f(%rip),%r14
lea    0xe25(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
add    $0x1,%rbx
add    $0x4,%r13
cmp    %rbx,%rbp
jne    11f0 <Read+0xa0>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [9 x i8] c"xn(%d): \00"
@.str.2 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [9 x i8] c"hn(%d): \00"
define void @Read(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %9
br label %11
11: ; preds = %23, %4
%12 = load i32, i32* %9
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i32, i32* %9
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32*, i32** %5
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %21)
br label %23
23: ; preds = %15
%24 = load i32, i32* %9
%25 = add nsw i32 %24, 1
store i32 %25, i32* %9
br label %11
26: ; preds = %11
%27 = load i32, i32* @stdin
%28 = call i32 @fflush(i32 %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %9
br label %30
30: ; preds = %42, %26
%31 = load i32, i32* %9
%32 = load i32, i32* %8
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %45
34: ; preds = %30
%35 = load i32, i32* %9
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %35)
%37 = load i32*, i32** %7
%38 = load i32, i32* %9
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %37, i64 %39
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %40)
br label %42
42: ; preds = %34
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %30
45: ; preds = %30
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"xn(%d): \00"
@.str.2 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.4 = [9 x i8] c"hn(%d): \00"
@str = [2 x i8] c"\0A\00"
define void @Read(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %15, %9 ]
%11 = trunc i64 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %4
%18 = load i32, i32* @stdin
%19 = tail call i32 @fflush(i32 %18)
%20 = tail call i32 @putchar(i32 10)
%21 = icmp sgt i32 %3, 0
br i1 %21, label %22, label %32
22: ; preds = %17
%23 = zext i32 %3 to i64
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ 0, %22 ], [ %30, %24 ]
%26 = trunc i64 %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds i32, i32* %2, i64 %25
%29 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %28)
%30 = add nuw nsw i64 %25, 1
%31 = icmp eq i64 %30, %23
br i1 %31, label %32, label %24
32: ; preds = %24, %17
%33 = tail call i32 @putchar(i32 10)
ret void
}