#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 *, int *);
main() {
  int n1 = 0, n2 = 0, n3 = 0;
n1:
  printf("\nDigite um numero positivo, não nulo e multiplo de 3: ");
  scanf("%d", &n1);
  if (!(n1 > 0 && (n1 % 3) == 0)) {
    printf("\nErro: condição nao atendida");
    goto n1;
  }
n2:
  printf("\nDigite um numero positivo e não nulo: ");
  scanf("%d", &n2);
  if (!(n2 > 0)) {
    printf("\nErro: condição nao atendida");
    goto n2;
  }
n3:
  printf("\nDigite um numero positivo, não nulo e par: ");
  scanf("%d", &n3);
  if (n3 > 0) {
    if (n3 % 2 != 0)
      n3++;
  } else {
    printf("\nErro: condição nao atendida");
    goto n3;
  }
  if (n1 == n2 || n1 == n3 || n3 == n2) {
    printf("\nErro: há numeros iguais.  Reiniciando.\n\n\n");
    goto n1;
  }
  printf("\nFim (%d, %d, %d)", n1, n2, n3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1180 <main+0x60>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1193 <main+0x73>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1144 <main+0x24>
jmp    1198 <main+0x78>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jg     11d3 <main+0xb3>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1198 <main+0x78>
jmp    11d8 <main+0xb8>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4b(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
jle    1222 <main+0x102>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     121d <main+0xfd>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1235 <main+0x115>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1259 <main+0x139>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1259 <main+0x139>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    126c <main+0x14c>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1144 <main+0x24>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xedb(%rip),%rbx
lea    0xef6(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xf13(%rip),%rbp
lea    0xc(%rsp),%r14
lea    0xebf(%rip),%r15
jmp    118a <main+0x5a>
xchg   %ax,%ax
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x14(%rsp),%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%edx
mov    %ecx,%eax
sub    %edx,%eax
test   %rcx,%rcx
jle    1180 <main+0x50>
test   %eax,%eax
jne    1180 <main+0x50>
xchg   %ax,%ax
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x10(%rsp)
jg     120a <main+0xda>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d0 <main+0xa0>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    1200 <main+0xd0>
test   $0x1,%cl
je     1233 <main+0x103>
add    $0x1,%ecx
mov    %ecx,0xc(%rsp)
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
cmp    %edx,%esi
je     1247 <main+0x117>
cmp    %ecx,%esi
je     1247 <main+0x117>
cmp    %edx,%ecx
jne    1258 <main+0x128>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
jmp    118a <main+0x5a>
lea    0xe52(%rip),%rdi
xor    %eax,%eax
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 = [56 x i8] c"\0ADigite um numero positivo, n\C3\A3o nulo e multiplo de 3: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"\0AErro: condi\C3\A7\C3\A3o nao atendida\00"
@.str.3 = [41 x i8] c"\0ADigite um numero positivo e n\C3\A3o nulo: \00"
@.str.4 = [46 x i8] c"\0ADigite um numero positivo, n\C3\A3o nulo e par: \00"
@.str.5 = [44 x i8] c"\0AErro: h\C3\A1 numeros iguais. Reiniciando.\0A\0A\0A\00"
@.str.6 = [18 x i8] c"\0AFim (%d, %d, %d)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %52, %14, %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i32, i32* %2
%12 = srem i32 %11, 3
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10, %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %5
16: ; preds = %10
br label %17
17: ; preds = %22, %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %17
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %17
24: ; preds = %17
br label %25
25: ; preds = %38, %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %25
%31 = load i32, i32* %4
%32 = srem i32 %31, 2
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %37
37: ; preds = %34, %30
br label %40
38: ; preds = %25
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %25
40: ; preds = %37
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = icmp eq i32 %41, %42
br i1 %43, label %52, label %44
44: ; preds = %40
%45 = load i32, i32* %2
%46 = load i32, i32* %4
%47 = icmp eq i32 %45, %46
br i1 %47, label %52, label %48
48: ; preds = %44
%49 = load i32, i32* %4
%50 = load i32, i32* %3
%51 = icmp eq i32 %49, %50
br i1 %51, label %52, label %54
52: ; preds = %48, %44, %40
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
br label %5
54: ; preds = %48
%55 = load i32, i32* %2
%56 = load i32, i32* %3
%57 = load i32, i32* %4
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %55, i32 %56, i32 %57)
%59 = load i32, i32* %1
ret i32 %59
}

LLVM IR (-O2):
@.str = [56 x i8] c"\0ADigite um numero positivo, n\C3\A3o nulo e multiplo de 3: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"\0AErro: condi\C3\A7\C3\A3o nao atendida\00"
@.str.3 = [41 x i8] c"\0ADigite um numero positivo e n\C3\A3o nulo: \00"
@.str.4 = [46 x i8] c"\0ADigite um numero positivo, n\C3\A3o nulo e par: \00"
@.str.6 = [18 x i8] c"\0AFim (%d, %d, %d)\00"
@str = [43 x i8] c"\0AErro: h\C3\A1 numeros iguais. Reiniciando.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %7
7: ; preds = %22, %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
%12 = srem i32 %10, 3
%13 = icmp eq i32 %12, 0
%14 = and i1 %11, %13
br i1 %14, label %15, label %20
15: ; preds = %7
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %23, label %28
20: ; preds = %7
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %55
br label %7
23: ; preds = %28, %15
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%26 = load i32, i32* %3
%27 = icmp sgt i32 %26, 0
br i1 %27, label %34, label %40
28: ; preds = %15, %28
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%32 = load i32, i32* %2
%33 = icmp sgt i32 %32, 0
br i1 %33, label %23, label %28
34: ; preds = %40, %23
%35 = phi i32 [ %26, %23 ], [ %44, %40 ]
%36 = and i32 %35, 1
%37 = icmp eq i32 %36, 0
br i1 %37, label %46, label %38
38: ; preds = %34
%39 = add nuw nsw i32 %35, 1
store i32 %39, i32* %3
br label %46
40: ; preds = %23, %40
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%44 = load i32, i32* %3
%45 = icmp sgt i32 %44, 0
br i1 %45, label %34, label %40
46: ; preds = %34, %38
%47 = phi i32 [ %35, %34 ], [ %39, %38 ]
%48 = load i32, i32* %1
%49 = load i32, i32* %2
%50 = icmp eq i32 %48, %49
br i1 %50, label %55, label %51
51: ; preds = %46
%52 = icmp eq i32 %48, %47
%53 = icmp eq i32 %47, %49
%54 = select i1 %52, i1 true, i1 %53
br i1 %54, label %55, label %57
55: ; preds = %51, %46
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %22
57: ; preds = %51
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %48, i32 %49, i32 %47)
ret i32 0
}