#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*/ multiplicar(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int ler(void) {
  int n1 = 0, n2 = 0;
  do {
    printf("Digite o primeiro numero: ");
    scanf("%d", &n1);
    if (n1 <= 0)
      printf("Voce deve digitar um valor maior que zero!");
  } while (n1 <= 0);
  do {
    printf("Digite o segundo numero: ");
    scanf("%d", &n2);
    if (n2 <= 0)
      printf("Voce deve digitar um valor maior que zero!");
  } while (n2 <= 0);
  multiplicar(n1, n2);
}


x86 assembly (clang, -O0):
<ler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jg     1178 <ler+0x48>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <ler+0x4d>
cmpl   $0x0,-0x8(%rbp)
jle    1146 <ler+0x16>
jmp    118c <ler+0x5c>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jg     11be <ler+0x8e>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11c3 <ler+0x93>
cmpl   $0x0,-0xc(%rbp)
jle    118c <ler+0x5c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <multiplicar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ler>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xeb2(%rip),%r14
lea    0xec6(%rip),%r15
mov    %rsp,%rbx
lea    0xebf(%rip),%r12
nop
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,(%rsp)
jg     1187 <ler+0x57>
mov    %r12,%rdi
call   1030 <printf@plt>
cmpl   $0x0,(%rsp)
jle    1160 <ler+0x30>
lea    0xebb(%rip),%r14
lea    0xe86(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe7d(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jg     11db <ler+0xab>
mov    %r12,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    11b0 <ler+0x80>
mov    (%rsp),%edi
call   1040 <multiplicar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Digite o primeiro numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"Voce deve digitar um valor maior que zero!\00"
@.str.3 = [26 x i8] c"Digite o segundo numero: \00"
define i32 @ler() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %4
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 0
br i1 %14, label %4, label %15
15: ; preds = %12
br label %16
16: ; preds = %24, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %16
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = icmp sle i32 %25, 0
br i1 %26, label %16, label %27
27: ; preds = %24
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = call i32 @multiplicar(i32 %28, i32 %29)
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [27 x i8] c"Digite o primeiro numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"Voce deve digitar um valor maior que zero!\00"
@.str.3 = [26 x i8] c"Digite o segundo numero: \00"
define i32 @ler() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %10, %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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* %1)
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %10
br label %15
15: ; preds = %14, %20
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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 slt i32 %18, 1
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 1
br i1 %23, label %15, label %24
24: ; preds = %15, %20
%25 = phi i32 [ %22, %20 ], [ %18, %15 ]
%26 = load i32, i32* %1
%27 = call i32 @multiplicar(i32 %26, i32 %25)
ret i32 undef
}