#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*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/);
void enter(int *p) {
  int i;
  for (i = 0; i < 5; i++) {
    printf("Enter the %d integer:", i);
    scanf("%d", p++);
  }
}


x86 assembly (clang, -O0):
<enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1177 <enter+0x57>
mov    -0xc(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <enter+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%rbx
lea    0xece(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0x4(%rbx),%r12d
lea    0xecf(%rip),%r15
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0x8(%rbx),%ebp
mov    %r15,%rdi
mov    %r12d,%esi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xc(%rbx),%r12d
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
add    $0x10,%ebx
mov    %r15,%rdi
mov    %r12d,%esi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the %d integer:\00"
@.str.1 = [3 x i8] c"%d\00"
define void @enter(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %2
%12 = ptrtoint i32* %10 to i32
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter the %d integer:\00"
@.str.1 = [3 x i8] c"%d\00"
define void @enter(i32* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = ptrtoint i32* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = ptrtoint i32* %3 to i64
%10 = trunc i64 %9 to i32
%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* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = ptrtoint i32* %8 to i64
%15 = trunc i64 %14 to i32
%16 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 3)
%18 = getelementptr inbounds i32, i32* %0, i64 4
%19 = ptrtoint i32* %13 to i64
%20 = trunc i64 %19 to i32
%21 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4)
%23 = ptrtoint i32* %18 to i64
%24 = trunc i64 %23 to i32
%25 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %24)
ret void
}