#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*/ clave_rfc_persona_moral(char *, char *, char *, char *,
                                           char *, char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char clave[13];
  int verbose = 0;
  if (argc < 5) {
    fprintf(stderr,
            "Sintax:\n\n\t%s <denominacion-social> <ano> <mes> <dia> "
            "[<tipo-de-sociedad>]\n\n",
            argv[0]);
    return 1;
  }
  memset(clave, 0, 13);
  if (argc == 5)
    clave_rfc_persona_moral(clave, argv[1], NULL, argv[2], argv[3], argv[4],
                            verbose);
  else
    clave_rfc_persona_moral(clave, argv[1], argv[5], argv[2], argv[3], argv[4],
                            verbose);
  printf("Clave del R.F.C.: %s\n", clave);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    118f <main+0x4f>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe82(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    122d <main+0xed>
lea    -0x1d(%rbp),%rdi
xor    %esi,%esi
mov    $0xd,%edx
call   1040 <memset@plt>
cmpl   $0x5,-0x8(%rbp)
jne    11df <main+0x9f>
lea    -0x1d(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%r9
mov    -0x24(%rbp),%eax
xor    %edx,%edx
mov    %eax,(%rsp)
call   1060 <clave_rfc_persona_moral@plt>
jmp    1216 <main+0xd6>
lea    -0x1d(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1060 <clave_rfc_persona_moral@plt>
lea    -0x1d(%rbp),%rsi
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jg     1170 <main+0x30>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe9d(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%r14d
jmp    11c6 <main+0x86>
mov    %edi,%ebp
lea    0x13(%rsp),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0xd,%edx
call   1040 <memset@plt>
mov    0x8(%rbx),%rsi
cmp    $0x5,%ebp
jne    1193 <main+0x53>
xor    %edx,%edx
jmp    1197 <main+0x57>
mov    0x28(%rbx),%rdx
mov    0x10(%rbx),%rcx
mov    0x18(%rbx),%r8
mov    0x20(%rbx),%r9
movl   $0x0,(%rsp)
lea    0x13(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <clave_rfc_persona_moral@plt>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14d,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Sintax:\0A\0A\09%s <denominacion-social> <ano> <mes> <dia> [<tipo-de-sociedad>]\0A\0A\00"
@.str.1 = [22 x i8] c"Clave del R.F.C.: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [13 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 1, i32* %3
br label %59
16: ; preds = %2
%17 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%18 = call i32 @memset(i8* %17, i32 0, i32 13)
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 5
br i1 %20, label %21, label %37
21: ; preds = %16
%22 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 4
%34 = load i8*, i8** %33
%35 = load i32, i32* %7
%36 = call i32 @clave_rfc_persona_moral(i8* %22, i8* %25, i8* null, i8* %28, i8* %31, i8* %34, i32 %35)
br label %56
37: ; preds = %16
%38 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 5
%44 = load i8*, i8** %43
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 3
%50 = load i8*, i8** %49
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 4
%53 = load i8*, i8** %52
%54 = load i32, i32* %7
%55 = call i32 @clave_rfc_persona_moral(i8* %38, i8* %41, i8* %44, i8* %47, i8* %50, i8* %53, i32 %54)
br label %56
56: ; preds = %37, %21
%57 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%58 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %57)
store i32 0, i32* %3
br label %59
59: ; preds = %56, %10
%60 = load i32, i32* %3
ret i32 %60
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Sintax:\0A\0A\09%s <denominacion-social> <ano> <mes> <dia> [<tipo-de-sociedad>]\0A\0A\00"
@.str.1 = [22 x i8] c"Clave del R.F.C.: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [13 x i8]
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 5
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %28
10: ; preds = %2
%11 = call i32 @memset(i8* %4, i32 0, i32 13)
%12 = icmp eq i32 %0, 5
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
br i1 %12, label %18, label %15
15: ; preds = %10
%16 = getelementptr inbounds i8*, i8** %1, i64 5
%17 = load i8*, i8** %16
br label %18
18: ; preds = %10, %15
%19 = phi i8* [ %17, %15 ], [ null, %10 ]
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8*, i8** %1, i64 3
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8*, i8** %1, i64 4
%25 = load i8*, i8** %24
%26 = call i32 @clave_rfc_persona_moral(i8* %4, i8* %14, i8* %19, i8* %21, i8* %23, i8* %25, i32 0)
%27 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %28
28: ; preds = %18, %6
%29 = phi i32 [ 1, %6 ], [ 0, %18 ]
ret i32 %29
}