#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 */
scalar_t__ eh_permut(int, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ qtd_num(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int num1, num2;
  printf("Digite o primeiro numero\n");
  scanf("%d", &num1);
  printf("Digite o segundo numero\n");
  scanf("%d", &num2);
  if (eh_permut(num1, num2) && (qtd_num(num1) == qtd_num(num2))) {
    printf("É permutação\n");
  } else {
    printf("Não é permutação\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <eh_permut@plt>
cmp    $0x0,%rax
je     11d8 <main+0x98>
mov    -0x14(%rbp),%edi
call   1050 <qtd_num@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <qtd_num@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    11d8 <main+0x98>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
jmp    11e4 <main+0xa4>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <eh_permut@plt>
test   %rax,%rax
je     11b3 <main+0x73>
mov    0xc(%rsp),%edi
call   1050 <qtd_num@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%edi
call   1050 <qtd_num@plt>
cmp    %rax,%rbx
jne    11b3 <main+0x73>
lea    0xe98(%rip),%rdi
jmp    11ba <main+0x7a>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Digite o primeiro numero\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Digite o segundo numero\0A\00"
@.str.3 = [17 x i8] c"\C3\89 permuta\C3\A7\C3\A3o\0A\00"
@.str.4 = [22 x i8] c"N\C3\A3o \C3\A9 permuta\C3\A7\C3\A3o\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 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* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i64 @eh_permut(i32 %12, i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %2
%17 = load i32, i32* %6
%18 = call i64 @qtd_num(i32 %17)
%19 = load i32, i32* %7
%20 = call i64 @qtd_num(i32 %19)
%21 = icmp eq i64 %18, %20
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %26
24: ; preds = %16, %2
%25 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [25 x i8] c"Digite o primeiro numero\00"
@str.5 = [24 x i8] c"Digite o segundo numero\00"
@str.6 = [21 x i8] c"N\C3\A3o \C3\A9 permuta\C3\A7\C3\A3o\00"
@str.7 = [16 x i8] c"\C3\89 permuta\C3\A7\C3\A3o\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i64 @eh_permut(i32 %11, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %2
%16 = load i32, i32* %3
%17 = call i64 @qtd_num(i32 %16)
%18 = load i32, i32* %4
%19 = call i64 @qtd_num(i32 %18)
%20 = icmp eq i64 %17, %19
br i1 %20, label %22, label %21
21: ; preds = %15, %2
br label %22
22: ; preds = %15, %21
%23 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0), %21 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0), %15 ]
%24 = call i32 @puts(i8* dereferenceable(1) %23)
ret i32 0
}