#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 /*<<< orphan*/ scanf(char *, double *);
void standard_read_point(int n, double *x) {
  int k;
  for (k = 0; k < n; k++) {
    printf("Give the real part for x[%d] : ", k);
    scanf("%lf", &x[2 * k]);
    printf("Give the imaginary part for x[%d] : ", k);
    scanf("%lf", &x[2 * k + 1]);
  }
  if (1 > 0) {
    printf("The coordinates of the point :\n");
    for (k = 0; k < n; k++)
      printf("x[%d] = %.15e  %.15e\n", k, x[2 * k], x[2 * k + 1]);
  }
}


x86 assembly (clang, -O0):
<standard_read_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b3 <standard_read_point+0x93>
mov    -0x14(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe80(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <standard_read_point+0x16>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    121a <standard_read_point+0xfa>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe64(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c8 <standard_read_point+0xa8>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_read_point>:
test   %edi,%edi
jle    1212 <standard_read_point+0xe2>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %edi,0x4(%rsp)
mov    %edi,%r15d
lea    0xecc(%rip),%r13
lea    0xec9(%rip),%r12
mov    %rsi,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe89(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rbx),%rsi
mov    %r13,%rdi
call   1050 <scanf@plt>
add    $0x1,%r14
add    $0x10,%rbx
cmp    %r14,%r15
jne    1170 <standard_read_point+0x40>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0x4(%rsp)
jle    1203 <standard_read_point+0xd3>
add    $0x8,%rbp
xor    %ebx,%ebx
lea    0xe77(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  0x0(%rbp),%xmm1
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x1,%rbx
add    $0x10,%rbp
cmp    %rbx,%r15
jne    11e0 <standard_read_point+0xb0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe46(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Give the real part for x[%d] : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [37 x i8] c"Give the imaginary part for x[%d] : \00"
@.str.3 = [32 x i8] c"The coordinates of the point :\0A\00"
@.str.4 = [22 x i8] c"x[%d] = %.15e %.15e\0A\00"
define void @standard_read_point(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %28, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = load i32, i32* %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load double*, double** %4
%14 = load i32, i32* %5
%15 = mul nsw i32 2, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %13, i64 %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %17)
%19 = load i32, i32* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = load double*, double** %4
%22 = load i32, i32* %5
%23 = mul nsw i32 2, %22
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %21, i64 %25
%27 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %26)
br label %28
28: ; preds = %10
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %6
31: ; preds = %6
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %33
33: ; preds = %53, %31
%34 = load i32, i32* %5
%35 = load i32, i32* %3
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %56
37: ; preds = %33
%38 = load i32, i32* %5
%39 = load double*, double** %4
%40 = load i32, i32* %5
%41 = mul nsw i32 2, %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %39, i64 %42
%44 = load double, double* %43
%45 = load double*, double** %4
%46 = load i32, i32* %5
%47 = mul nsw i32 2, %46
%48 = add nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %45, i64 %49
%51 = load double, double* %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %38, double %44, double %51)
br label %53
53: ; preds = %37
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %33
56: ; preds = %33
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Give the real part for x[%d] : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [37 x i8] c"Give the imaginary part for x[%d] : \00"
@.str.4 = [22 x i8] c"x[%d] = %.15e %.15e\0A\00"
@str = [31 x i8] c"The coordinates of the point :\00"
define void @standard_read_point(i32 %0, double* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %37
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %19, %8 ]
%10 = trunc i64 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = shl nuw nsw i64 %9, 1
%13 = getelementptr inbounds double, double* %1, i64 %12
%14 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%16 = or i64 %12, 1
%17 = getelementptr inbounds double, double* %1, i64 %16
%18 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %17)
%19 = add nuw nsw i64 %9, 1
%20 = icmp eq i64 %19, %7
br i1 %20, label %21, label %8
21: ; preds = %8
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br i1 %3, label %23, label %37
23: ; preds = %21
%24 = zext i32 %0 to i64
br label %25
25: ; preds = %23, %25
%26 = phi i64 [ 0, %23 ], [ %35, %25 ]
%27 = shl nuw nsw i64 %26, 1
%28 = getelementptr inbounds double, double* %1, i64 %27
%29 = load double, double* %28
%30 = or i64 %27, 1
%31 = getelementptr inbounds double, double* %1, i64 %30
%32 = load double, double* %31
%33 = trunc i64 %26 to i32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %33, double %29, double %32)
%35 = add nuw nsw i64 %26, 1
%36 = icmp eq i64 %35, %24
br i1 %36, label %37, label %25
37: ; preds = %25, %4, %21
ret void
}