#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*/ print(char *);
void ex6() {
  print("\n------------------------------\n");
  int a, b, c;
  float m;
  a = 1;
  b = 13;
  c = 15;
  print("Algoritmo 1: ");
  {
    m = a + b + c / 3;
    if (m > 10) {
      print("100");
    }
    print("programa encerrado");
  }
  print("\nAlgoritmo 2: ");
  {
    m = a + b + c;
    m = m / 3;
    if (m > 10) {
      print("100");
    }
    print("programa encerrado");
  }
  print("\n------------------------------\n");
}


x86 assembly (clang, -O0):
<ex6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee9(%rip),%rdi
call   1030 <print@plt>
movl   $0x1,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
lea    0xee9(%rip),%rdi
call   1030 <print@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe8a(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    118b <ex6+0x7b>
lea    0xeb1(%rip),%rdi
call   1030 <print@plt>
lea    0xea9(%rip),%rdi
call   1030 <print@plt>
lea    0xeb0(%rip),%rdi
call   1030 <print@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe42(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe28(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ed <ex6+0xdd>
lea    0xe4f(%rip),%rdi
call   1030 <print@plt>
lea    0xe47(%rip),%rdi
call   1030 <print@plt>
lea    0xe08(%rip),%rdi
call   1030 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex6>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    %r14,%rdi
call   1030 <print@plt>
lea    0xef7(%rip),%rdi
call   1030 <print@plt>
lea    0xef9(%rip),%rdi
call   1030 <print@plt>
lea    0xef1(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print@plt>
lea    0xef5(%rip),%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0A------------------------------\0A\00"
@.str.1 = [14 x i8] c"Algoritmo 1: \00"
@.str.2 = [4 x i8] c"100\00"
@.str.3 = [19 x i8] c"programa encerrado\00"
@.str.4 = [15 x i8] c"\0AAlgoritmo 2: \00"
define void @ex6() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
store i32 13, i32* %2
store i32 15, i32* %3
%6 = call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = sdiv i32 %10, 3
%12 = add nsw i32 %9, %11
%13 = sitofp i32 %12 to float
store float %13, float* %4
%14 = load float, float* %4
%15 = fcmp ogt float %14, 1.000000e+01
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %0
%19 = call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %3
%25 = add nsw i32 %23, %24
%26 = sitofp i32 %25 to float
store float %26, float* %4
%27 = load float, float* %4
%28 = fdiv float %27, 3.000000e+00
store float %28, float* %4
%29 = load float, float* %4
%30 = fcmp ogt float %29, 1.000000e+01
br i1 %30, label %31, label %33
31: ; preds = %18
%32 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31, %18
%34 = call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A------------------------------\0A\00"
@.str.1 = [14 x i8] c"Algoritmo 1: \00"
@.str.2 = [4 x i8] c"100\00"
@.str.3 = [19 x i8] c"programa encerrado\00"
@.str.4 = [15 x i8] c"\0AAlgoritmo 2: \00"
define void @ex6() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}