#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 *, long);
int /*<<< orphan*/ scanf(char *, long *, long *);
main() {
  long int n1, n2;
  scanf("%ld %ld", &n1, &n2);
  if (n1 == n2) {
    printf("The perimeter of the square is %ld m.\n", ((n1 * 2) + (n2 * 2)));
    printf("The area of the square is %ld m2.\n", (n1 * n2));
  } else {
    printf("The perimeter of the rectangle is %ld m.\n", ((n1 * 2) + (n2 * 2)));
    printf("The area of the rectangle is %ld m2.\n", (n1 * n2));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    118a <main+0x6a>
mov    -0x10(%rbp),%rsi
shl    $0x1,%rsi
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <main+0x9e>
mov    -0x10(%rbp),%rsi
shl    $0x1,%rsi
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rax
cmp    %rax,%rsi
jne    116d <main+0x4d>
shl    $0x2,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
imul   0x10(%rsp),%rsi
lea    0xec4(%rip),%rdi
jmp    1194 <main+0x74>
add    %rsi,%rax
add    %rax,%rax
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
imul   0x10(%rsp),%rsi
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [39 x i8] c"The perimeter of the square is %ld m.\0A\00"
@.str.2 = [35 x i8] c"The area of the square is %ld m2.\0A\00"
@.str.3 = [42 x i8] c"The perimeter of the rectangle is %ld m.\0A\00"
@.str.4 = [38 x i8] c"The area of the rectangle is %ld m2.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %19
8: ; preds = %0
%9 = load i64, i64* %2
%10 = mul nsw i64 %9, 2
%11 = load i64, i64* %3
%12 = mul nsw i64 %11, 2
%13 = add nsw i64 %10, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = load i64, i64* %2
%16 = load i64, i64* %3
%17 = mul nsw i64 %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 %17)
br label %30
19: ; preds = %0
%20 = load i64, i64* %2
%21 = mul nsw i64 %20, 2
%22 = load i64, i64* %3
%23 = mul nsw i64 %22, 2
%24 = add nsw i64 %21, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i64 %24)
%26 = load i64, i64* %2
%27 = load i64, i64* %3
%28 = mul nsw i64 %26, %27
%29 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 %28)
br label %30
30: ; preds = %19, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [39 x i8] c"The perimeter of the square is %ld m.\0A\00"
@.str.2 = [35 x i8] c"The area of the square is %ld m2.\0A\00"
@.str.3 = [42 x i8] c"The perimeter of the rectangle is %ld m.\0A\00"
@.str.4 = [38 x i8] c"The area of the rectangle is %ld m2.\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %0
%10 = shl i64 %6, 2
%11 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 %10)
%12 = load i64, i64* %1
%13 = load i64, i64* %2
%14 = mul nsw i64 %13, %12
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 %14)
br label %24
16: ; preds = %0
%17 = add i64 %7, %6
%18 = shl i64 %17, 1
%19 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i64 %18)
%20 = load i64, i64* %1
%21 = load i64, i64* %2
%22 = mul nsw i64 %21, %20
%23 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 %22)
br label %24
24: ; preds = %16, %9
ret i32 0
}