#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 mystery(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int x;
  int y;
  do {
    printf("%s", "Enter two positive integers: ");
    scanf("%d%d", &x, &y);
    if (y <= 0 || x <= 0) {
      printf(
          "%s",
          "Sono accettati solo valore maggiori di 0, ripetere l'inserimento\n");
    }
  } while (y >= 1 && x >= 1);
  printf("The result id %u\n", mystery(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    117c <main+0x4c>
cmpl   $0x0,-0x8(%rbp)
jg     1191 <main+0x61>
lea    0xe7d(%rip),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1196 <main+0x66>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     11af <main+0x7f>
cmpl   $0x1,-0x8(%rbp)
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113f <main+0xf>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mystery@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%r14
lea    0xeaa(%rip),%r15
lea    0xec1(%rip),%r12
lea    0x4(%rsp),%r13
mov    %rsp,%rbx
lea    0xec9(%rip),%rbp
nop
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%esi
test   %esi,%esi
jle    119a <main+0x5a>
mov    0x4(%rsp),%edi
test   %edi,%edi
jg     11a9 <main+0x69>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edi
test   %esi,%esi
jle    11b1 <main+0x71>
test   %edi,%edi
jg     1170 <main+0x30>
call   1060 <mystery@plt>
lea    0xe69(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [30 x i8] c"Enter two positive integers: \00"
@.str.2 = [5 x i8] c"%d%d\00"
@.str.3 = [66 x i8] c"Sono accettati solo valore maggiori di 0, ripetere l'inserimento\0A\00"
@.str.4 = [18 x i8] c"The result id %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %21, %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9, %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = icmp sge i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 1
br label %21
21: ; preds = %18, %15
%22 = phi i1 [ false, %15 ], [ %20, %18 ]
br i1 %22, label %4, label %23
23: ; preds = %21
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @mystery(i32 %24, i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [30 x i8] c"Enter two positive integers: \00"
@.str.2 = [5 x i8] c"%d%d\00"
@.str.4 = [18 x i8] c"The result id %u\0A\00"
@str = [65 x i8] c"Sono accettati solo valore maggiori di 0, ripetere l'inserimento\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %17, %0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 1
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %13, label %17
13: ; preds = %5
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = load i32, i32* %1
br label %17
17: ; preds = %13, %5
%18 = phi i32 [ %16, %13 ], [ %10, %5 ]
%19 = phi i32 [ %15, %13 ], [ %8, %5 ]
%20 = icmp sgt i32 %19, 0
%21 = icmp sgt i32 %18, 0
%22 = select i1 %20, i1 %21, i1 false
br i1 %22, label %5, label %23
23: ; preds = %17
%24 = call i32 @mystery(i32 %18, i32 %19)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %24)
ret i32 0
}