#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 */
void *arrinput(char *, char *, int);
float atof(char *);
int atoi(char *);
char *input(char *);
int /*<<< orphan*/ print_array(char *, char *, ...);
int /*<<< orphan*/ printf(char *, int, float, char *);
void main() {
  int n = atoi(input("Enter an integer: "));
  float f = atof(input("Enter a float no.: "));
  char *s = input("");
  int *a = arrinput("Enter 5 integers: ", "%d ", 5);
  float *b = arrinput("Enter 5 float no.s: ", " %f", 5);
  printf("n = %d\nf = %f\ns : %s\n", n, f, s);
  print_array("a[] array is: \n", "  %d ", a, 5);
  print_array("b[] array is: \n", "%.2f", b, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe91(%rip),%rdi
call   1030 <input@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe8d(%rip),%rdi
call   1030 <input@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
movss  %xmm0,-0x8(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <input@plt>
mov    %rax,-0x10(%rbp)
lea    0xe78(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x5,%edx
call   1070 <arrinput@plt>
mov    %rax,-0x18(%rbp)
lea    0xe6f(%rip),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x5,%edx
call   1070 <arrinput@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%esi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
lea    0xe60(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe66(%rip),%rdi
lea    0xe6f(%rip),%rsi
mov    $0x5,%ecx
mov    $0x0,%al
call   1050 <print_array@plt>
mov    -0x20(%rbp),%rdx
lea    0xe5e(%rip),%rdi
lea    0xe67(%rip),%rsi
mov    $0x5,%ecx
mov    $0x0,%al
call   1050 <print_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xe92(%rip),%rdi
call   1030 <input@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%r14d
lea    0xe8e(%rip),%rdi
call   1030 <input@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
movss  %xmm0,0x4(%rsp)
lea    0xed9(%rip),%rdi
call   1030 <input@plt>
mov    %rax,%rbx
lea    0xe79(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x5,%edx
call   1070 <arrinput@plt>
mov    %rax,%rbp
lea    0xe71(%rip),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x5,%edx
call   1070 <arrinput@plt>
mov    %rax,%r15
lea    0xe6f(%rip),%rdi
mov    %r14d,%esi
movss  0x4(%rsp),%xmm0
mov    %rbx,%rdx
call   1060 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    0xe76(%rip),%rsi
mov    %rbp,%rdx
mov    $0x5,%ecx
xor    %eax,%eax
call   1050 <print_array@plt>
lea    0xe66(%rip),%rdi
lea    0xe6f(%rip),%rsi
mov    %r15,%rdx
mov    $0x5,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <print_array@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Enter an integer: \00"
@.str.1 = [20 x i8] c"Enter a float no.: \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [19 x i8] c"Enter 5 integers: \00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [21 x i8] c"Enter 5 float no.s: \00"
@.str.6 = [4 x i8] c" %f\00"
@.str.7 = [22 x i8] c"n = %d\0Af = %f\0As : %s\0A\00"
@.str.8 = [16 x i8] c"a[] array is: \0A\00"
@.str.9 = [6 x i8] c" %d \00"
@.str.10 = [16 x i8] c"b[] array is: \0A\00"
@.str.11 = [5 x i8] c"%.2f\00"
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca float*
%6 = call i8* @input(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @atoi(i8* %6)
store i32 %7, i32* %1
%8 = call i8* @input(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = call float @atof(i8* %8)
store float %9, float* %2
%10 = call i8* @input(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
store i8* %10, i8** %3
%11 = call i8* @arrinput(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 5)
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %4
%13 = call i8* @arrinput(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 5)
%14 = bitcast i8* %13 to float*
store float* %14, float** %5
%15 = load i32, i32* %1
%16 = load float, float* %2
%17 = load i8*, i8** %3
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %15, float %16, i8* %17)
%19 = load i32*, i32** %4
%20 = call i32 (i8*, i8*, ...) @print_array(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32* %19, i32 5)
%21 = load float*, float** %5
%22 = call i32 (i8*, i8*, ...) @print_array(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), float* %21, i32 5)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter an integer: \00"
@.str.1 = [20 x i8] c"Enter a float no.: \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [19 x i8] c"Enter 5 integers: \00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [21 x i8] c"Enter 5 float no.s: \00"
@.str.6 = [4 x i8] c" %f\00"
@.str.7 = [22 x i8] c"n = %d\0Af = %f\0As : %s\0A\00"
@.str.8 = [16 x i8] c"a[] array is: \0A\00"
@.str.9 = [6 x i8] c" %d \00"
@.str.10 = [16 x i8] c"b[] array is: \0A\00"
@.str.11 = [5 x i8] c"%.2f\00"
define void @main() {
%1 = tail call i8* @input(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @atoi(i8* %1)
%3 = tail call i8* @input(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call float @atof(i8* %3)
%5 = tail call i8* @input(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i8* @arrinput(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 5)
%7 = tail call i8* @arrinput(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 5)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %2, float %4, i8* %5)
%9 = tail call i32 (i8*, i8*, ...) @print_array(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %6, i32 5)
%10 = tail call i32 (i8*, i8*, ...) @print_array(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* %7, i32 5)
ret void
}