#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 explanation_matrix(void) {
  printf("\n");
  printf("Select a number to \n");
  printf("Calculate square's perimeter          : 1  \n");
  printf("Calculate rectangle's perimeter       : 2  \n");
  printf("Calculate right triangle's perimeter  : 3  \n");
  printf("Calculate cycle's perimeter           : 4  \n");
  printf("Exit the program                      : 0  \n");
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<explanation_matrix>:
push   %rbp
mov    %rsp,%rbp
lea    0xfd9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
lea    0xf24(%rip),%rdi
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
call   1030 <printf@plt>
lea    0xf66(%rip),%rdi
call   1030 <printf@plt>
lea    0xf85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<explanation_matrix>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
lea    0xf16(%rip),%rdi
call   1040 <puts@plt>
lea    0xf36(%rip),%rdi
call   1040 <puts@plt>
lea    0xf56(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [21 x i8] c"Select a number to \0A\00"
@.str.2 = [45 x i8] c"Calculate square's perimeter : 1 \0A\00"
@.str.3 = [45 x i8] c"Calculate rectangle's perimeter : 2 \0A\00"
@.str.4 = [45 x i8] c"Calculate right triangle's perimeter : 3 \0A\00"
@.str.5 = [45 x i8] c"Calculate cycle's perimeter : 4 \0A\00"
@.str.6 = [45 x i8] c"Exit the program : 0 \0A\00"
define i32 @explanation_matrix() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Select a number to \00"
@str.7 = [44 x i8] c"Calculate square's perimeter : 1 \00"
@str.8 = [44 x i8] c"Calculate rectangle's perimeter : 2 \00"
@str.9 = [44 x i8] c"Calculate right triangle's perimeter : 3 \00"
@str.10 = [44 x i8] c"Calculate cycle's perimeter : 4 \00"
@str.11 = [44 x i8] c"Exit the program : 0 \00"
define i32 @explanation_matrix() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}