#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*/ areaperi(int, float *, float *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int radius;
  float area, perimeter;
  printf("\nEnter radius of a circle: ");
  scanf("%d", &radius);
  areaperi(radius, &area, &perimeter);
  printf("Area = %f", area);
  printf("\nPerimeter = %f", perimeter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <areaperi@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <areaperi@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0AEnter radius of a circle: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Area = %f\00"
@.str.3 = [16 x i8] c"\0APerimeter = %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @areaperi(i32 %6, float* %2, float* %3)
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0AEnter radius of a circle: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Area = %f\00"
@.str.3 = [16 x i8] c"\0APerimeter = %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = call i32 @areaperi(i32 %9, float* %2, float* %3)
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %15)
ret i32 0
}