#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*/ mostraNumero(int, int);
int obterTemperatura();
int /*<<< orphan*/ setup();
int main() {
  int temp = 0;
  setup();
  while (1) {
    int d1 = 0;
    int d2 = 0;
    int d3 = 0;
    int d4 = 0;
    temp = obterTemperatura();
    if (temp > 0) {
      d1 = 1;
    }
    if (temp > 10)
      d1 = 2;
    mostraNumero(d1, 4);
    mostraNumero(d2, 3);
    mostraNumero(d3, 2);
    mostraNumero(d4, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <setup@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <obterTemperatura@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1184 <main+0x54>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    1195 <main+0x65>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1040 <mostraNumero@plt>
mov    -0x10(%rbp),%edi
mov    $0x3,%esi
call   1040 <mostraNumero@plt>
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1040 <mostraNumero@plt>
mov    -0x18(%rbp),%edi
mov    $0x1,%esi
call   1040 <mostraNumero@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <setup@plt>
mov    $0x2,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1030 <obterTemperatura@plt>
xor    %edi,%edi
test   %eax,%eax
setg   %dil
cmp    $0xb,%eax
cmovge %ebx,%edi
mov    $0x4,%esi
call   1040 <mostraNumero@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <mostraNumero@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <mostraNumero@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <mostraNumero@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%7 = call i32 (...) @setup()
br label %8
8: ; preds = %0, %17
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%9 = call i32 (...) @obterTemperatura()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 2, i32* %3
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %3
%19 = call i32 @mostraNumero(i32 %18, i32 4)
%20 = load i32, i32* %4
%21 = call i32 @mostraNumero(i32 %20, i32 3)
%22 = load i32, i32* %5
%23 = call i32 @mostraNumero(i32 %22, i32 2)
%24 = load i32, i32* %6
%25 = call i32 @mostraNumero(i32 %24, i32 1)
br label %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @obterTemperatura()
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, 10
%7 = select i1 %6, i32 2, i32 %5
%8 = tail call i32 @mostraNumero(i32 %7, i32 4)
%9 = tail call i32 @mostraNumero(i32 0, i32 3)
%10 = tail call i32 @mostraNumero(i32 0, i32 2)
%11 = tail call i32 @mostraNumero(i32 0, i32 1)
br label %2
}