#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 */
float alfa(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, const char *argv[]) {
  int i, n;
  float x, y, menor = 181, numero;
  printf("Digite o numero de loops\n");
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    printf("Digite um valor para o x \n");
    scanf("%f", &x);
    printf("Digite um valor para o y \n");
    scanf("%f", &y);
    if (x == 0 && y == 0) {
      printf("O valor digitado é invalido");
      i--;
    } else {
      if (x >= 0 && y >= 0) {
        numero = alfa(x, y);
        if (numero < menor) {
          menor = numero;
        }
      } else {
        printf("O valor digitado é invalido");
        i--;
      }
    }
  }
  printf("O menor valor é %f\n", menor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1297 <main+0x167>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe81(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1210 <main+0xe0>
jp     1210 <main+0xe0>
movss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1210 <main+0xe0>
jp     1210 <main+0xe0>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1284 <main+0x154>
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1268 <main+0x138>
movss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1268 <main+0x138>
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
call   1050 <alfa@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm1
movss  -0x24(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1263 <main+0x133>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    127f <main+0x14f>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1284 <main+0x154>
jmp    1289 <main+0x159>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117a <main+0x4a>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1233 <main+0xf3>
movss  0xe80(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
lea    0xec8(%rip),%r14
lea    0xe73(%rip),%rbx
lea    0x14(%rsp),%r15
lea    0xecf(%rip),%r12
lea    0x10(%rsp),%r13
xor    %ebp,%ebp
jmp    11ca <main+0x8a>
nopl   0x0(%rax)
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jge    1241 <main+0x101>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
movss  0x10(%rsp),%xmm1
jne    1211 <main+0xd1>
jp     1211 <main+0xd1>
ucomiss %xmm2,%xmm1
jne    1211 <main+0xd1>
jnp    11b0 <main+0x70>
ucomiss %xmm2,%xmm0
jb     11b0 <main+0x70>
ucomiss %xmm2,%xmm1
jb     11b0 <main+0x70>
call   1060 <alfa@plt>
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    11c1 <main+0x81>
movss  %xmm0,0x8(%rsp)
jmp    11c1 <main+0x81>
movss  0xdc5(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Digite o numero de loops\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Digite um valor para o x \0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [27 x i8] c"Digite um valor para o y \0A\00"
@.str.5 = [29 x i8] c"O valor digitado \C3\A9 invalido\00"
@.str.6 = [21 x i8] c"O menor valor \C3\A9 %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 1.810000e+02, float* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
store i32 0, i32* %6
br label %14
14: ; preds = %54, %2
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %57
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %8)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %9)
%23 = load float, float* %8
%24 = fcmp oeq float %23, 0.000000e+00
br i1 %24, label %25, label %32
25: ; preds = %18
%26 = load float, float* %9
%27 = fcmp oeq float %26, 0.000000e+00
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* %6
%31 = add nsw i32 %30, -1
store i32 %31, i32* %6
br label %53
32: ; preds = %25, %18
%33 = load float, float* %8
%34 = fcmp oge float %33, 0.000000e+00
br i1 %34, label %35, label %48
35: ; preds = %32
%36 = load float, float* %9
%37 = fcmp oge float %36, 0.000000e+00
br i1 %37, label %38, label %48
38: ; preds = %35
%39 = load float, float* %8
%40 = load float, float* %9
%41 = call float @alfa(float %39, float %40)
store float %41, float* %11
%42 = load float, float* %11
%43 = load float, float* %10
%44 = fcmp olt float %42, %43
br i1 %44, label %45, label %47
45: ; preds = %38
%46 = load float, float* %11
store float %46, float* %10
br label %47
47: ; preds = %45, %38
br label %52
48: ; preds = %35, %32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%50 = load i32, i32* %6
%51 = add nsw i32 %50, -1
store i32 %51, i32* %6
br label %52
52: ; preds = %48, %47
br label %53
53: ; preds = %52, %28
br label %54
54: ; preds = %53
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
br label %14
57: ; preds = %14
%58 = load float, float* %10
%59 = fpext float %58 to double
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), double %59)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.5 = [29 x i8] c"O valor digitado \C3\A9 invalido\00"
@.str.6 = [21 x i8] c"O menor valor \C3\A9 %f\0A\00"
@str = [25 x i8] c"Digite o numero de loops\00"
@str.7 = [26 x i8] c"Digite um valor para o x \00"
@str.8 = [26 x i8] c"Digite um valor para o y \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = bitcast i32* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = bitcast float* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %45
13: ; preds = %2, %39
%14 = phi i32 [ %42, %39 ], [ 0, %2 ]
%15 = phi float [ %40, %39 ], [ 1.810000e+02, %2 ]
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%20 = load float, float* %4
%21 = fcmp oeq float %20, 0.000000e+00
%22 = load float, float* %5
%23 = fcmp oeq float %22, 0.000000e+00
%24 = select i1 %21, i1 %23, i1 false
br i1 %24, label %25, label %28
25: ; preds = %13
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%27 = add nsw i32 %14, -1
br label %39
28: ; preds = %13
%29 = fcmp oge float %20, 0.000000e+00
%30 = fcmp oge float %22, 0.000000e+00
%31 = select i1 %29, i1 %30, i1 false
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = call float @alfa(float %20, float %22)
%34 = fcmp olt float %33, %15
br i1 %34, label %35, label %39
35: ; preds = %32
br label %39
36: ; preds = %28
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%38 = add nsw i32 %14, -1
br label %39
39: ; preds = %25, %32, %35, %36
%40 = phi float [ %15, %25 ], [ %33, %35 ], [ %15, %32 ], [ %15, %36 ]
%41 = phi i32 [ %27, %25 ], [ %14, %35 ], [ %14, %32 ], [ %38, %36 ]
%42 = add nsw i32 %41, 1
%43 = load i32, i32* %3
%44 = icmp slt i32 %42, %43
br i1 %44, label %13, label %45
45: ; preds = %39, %2
%46 = phi float [ 1.810000e+02, %2 ], [ %40, %39 ]
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), double %47)
ret i32 0
}