#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 /*<<< orphan*/ scanf(char *, float *);
int main() {
  float number;
  printf("Insira um numero: ");
  scanf("%f", &number);
  int rounded = (int)(number + 0.5f);
  if (rounded % 2) {
    printf("%d %d", rounded - 1, rounded + 1);
  } else {
    printf("%d %d", rounded - 2, rounded + 2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeab(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1194 <main+0x74>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <main+0x8e>
mov    -0xc(%rbp),%esi
sub    $0x2,%esi
mov    -0xc(%rbp),%edx
add    $0x2,%edx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
addss  0xeb2(%rip),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,%ecx
and    $0x1,%ecx
mov    %eax,%esi
or     $0xfffffffe,%esi
cmp    $0x1,%ecx
mov    %eax,%edx
adc    $0x0,%edx
add    %eax,%esi
add    $0x1,%edx
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Insira um numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fadd float %6, 5.000000e-01
%8 = fptosi float %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %0
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %16)
br label %24
18: ; preds = %0
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %22)
br label %24
24: ; preds = %18, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Insira um numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fadd float %5, 5.000000e-01
%7 = fptosi float %6 to i32
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
%10 = or i32 %7, -2
%11 = select i1 %9, i32 2, i32 1
%12 = add nsw i32 %10, %7
%13 = add nsw i32 %11, %7
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}