#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 d10();
int d100();
int d12();
int d2();
int d20();
int d4();
int d6();
int d8();
int dPorcentaje();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (!strcmp(argv[1], "d20")) {
    printf("%i\n", d20());
  } else if (!strcmp(argv[1], "d12")) {
    printf("%i\n", d12());
  } else if (!strcmp(argv[1], "d10")) {
    printf("%i\n", d10());
  } else if (!strcmp(argv[1], "d8")) {
    printf("%i\n", d8());
  } else if (!strcmp(argv[1], "d4")) {
    printf("%i\n", d4());
  } else if (!strcmp(argv[1], "d2")) {
    printf("%i\n", d2());
  } else if (!strcmp(argv[1], "d6")) {
    printf("%i\n", d6());
  } else if (!strcmp(argv[1], "d100")) {
    printf("%i\n", d100());
  } else if (!strcmp(argv[1], "dPorcentaje")) {
    printf("%i\n", dPorcentaje());
  } else {
    printf("El dado se ha caido de la mesa...\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11ff <main+0x4f>
mov    $0x0,%al
call   1080 <d20@plt>
mov    %eax,%esi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13fd <main+0x24d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdfa(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1238 <main+0x88>
mov    $0x0,%al
call   1030 <d12@plt>
mov    %eax,%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13f8 <main+0x248>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1271 <main+0xc1>
mov    $0x0,%al
call   1040 <d10@plt>
mov    %eax,%esi
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13f3 <main+0x243>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd90(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12aa <main+0xfa>
mov    $0x0,%al
call   10d0 <d8@plt>
mov    %eax,%esi
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13ee <main+0x23e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd5a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12e3 <main+0x133>
mov    $0x0,%al
call   10c0 <d4@plt>
mov    %eax,%esi
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13e9 <main+0x239>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd24(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    131c <main+0x16c>
mov    $0x0,%al
call   10b0 <d2@plt>
mov    %eax,%esi
lea    0xcf4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13e4 <main+0x234>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcee(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1355 <main+0x1a5>
mov    $0x0,%al
call   1090 <d6@plt>
mov    %eax,%esi
lea    0xcbb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13df <main+0x22f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcb8(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    138e <main+0x1de>
mov    $0x0,%al
call   10a0 <d100@plt>
mov    %eax,%esi
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13da <main+0x22a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc84(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13c7 <main+0x217>
mov    $0x0,%al
call   1070 <dPorcentaje@plt>
mov    %eax,%esi
lea    0xc49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13d5 <main+0x225>
lea    0xc5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13da <main+0x22a>
jmp    13df <main+0x22f>
jmp    13e4 <main+0x234>
jmp    13e9 <main+0x239>
jmp    13ee <main+0x23e>
jmp    13f3 <main+0x243>
jmp    13f8 <main+0x248>
jmp    13fd <main+0x24d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     128e <main+0xce>
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1297 <main+0xd7>
lea    0xe12(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12a0 <main+0xe0>
lea    0xdff(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12a9 <main+0xe9>
lea    0xdeb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12b2 <main+0xf2>
lea    0xddb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12bb <main+0xfb>
lea    0xdcb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12c4 <main+0x104>
lea    0xdbb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12cd <main+0x10d>
lea    0xdad(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12d6 <main+0x116>
lea    0xda6(%rip),%rdi
call   1050 <puts@plt>
jmp    12ed <main+0x12d>
xor    %eax,%eax
call   1090 <d20@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   1030 <d12@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   1040 <d10@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   10e0 <d8@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   10d0 <d4@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   10c0 <d2@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   10a0 <d6@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   10b0 <d100@plt>
jmp    12dd <main+0x11d>
xor    %eax,%eax
call   1080 <dPorcentaje@plt>
lea    0xd20(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"d20\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [4 x i8] c"d12\00"
@.str.3 = [4 x i8] c"d10\00"
@.str.4 = [3 x i8] c"d8\00"
@.str.5 = [3 x i8] c"d4\00"
@.str.6 = [3 x i8] c"d2\00"
@.str.7 = [3 x i8] c"d6\00"
@.str.8 = [5 x i8] c"d100\00"
@.str.9 = [12 x i8] c"dPorcentaje\00"
@.str.10 = [35 x i8] c"El dado se ha caido de la mesa...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 (...) @d20()
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %96
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %14
%21 = call i32 (...) @d12()
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %95
23: ; preds = %14
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %23
%30 = call i32 (...) @d10()
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
br label %94
32: ; preds = %23
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %32
%39 = call i32 (...) @d8()
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %93
41: ; preds = %32
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %41
%48 = call i32 (...) @d4()
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
br label %92
50: ; preds = %41
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i32 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %50
%57 = call i32 (...) @d2()
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
br label %91
59: ; preds = %50
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 1
%62 = load i8*, i8** %61
%63 = call i32 @strcmp(i8* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%64 = icmp ne i32 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %59
%66 = call i32 (...) @d6()
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %66)
br label %90
68: ; preds = %59
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i32 @strcmp(i8* %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%73 = icmp ne i32 %72, 0
br i1 %73, label %77, label %74
74: ; preds = %68
%75 = call i32 (...) @d100()
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %75)
br label %89
77: ; preds = %68
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = call i32 @strcmp(i8* %80, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%82 = icmp ne i32 %81, 0
br i1 %82, label %86, label %83
83: ; preds = %77
%84 = call i32 (...) @dPorcentaje()
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %84)
br label %88
86: ; preds = %77
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
br label %88
88: ; preds = %86, %83
br label %89
89: ; preds = %88, %74
br label %90
90: ; preds = %89, %65
br label %91
91: ; preds = %90, %56
br label %92
92: ; preds = %91, %47
br label %93
93: ; preds = %92, %38
br label %94
94: ; preds = %93, %29
br label %95
95: ; preds = %94, %20
br label %96
96: ; preds = %95, %11
%97 = load i32, i32* %3
ret i32 %97
}

LLVM IR (-O2):
@.str = [4 x i8] c"d20\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [4 x i8] c"d12\00"
@.str.3 = [4 x i8] c"d10\00"
@.str.4 = [3 x i8] c"d8\00"
@.str.5 = [3 x i8] c"d4\00"
@.str.6 = [3 x i8] c"d2\00"
@.str.7 = [3 x i8] c"d6\00"
@.str.8 = [5 x i8] c"d100\00"
@.str.9 = [12 x i8] c"dPorcentaje\00"
@str = [34 x i8] c"El dado se ha caido de la mesa...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 (...) @d20()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %60
10: ; preds = %2
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i32 (...) @d12()
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %60
16: ; preds = %10
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = tail call i32 (...) @d10()
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %60
22: ; preds = %16
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = tail call i32 (...) @d8()
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %60
28: ; preds = %22
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = tail call i32 (...) @d4()
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %60
34: ; preds = %28
%35 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = tail call i32 (...) @d2()
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %60
40: ; preds = %34
%41 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = tail call i32 (...) @d6()
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
br label %60
46: ; preds = %40
%47 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = tail call i32 (...) @d100()
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
br label %60
52: ; preds = %46
%53 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = tail call i32 (...) @dPorcentaje()
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %56)
br label %60
58: ; preds = %52
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %60
60: ; preds = %13, %25, %37, %49, %58, %55, %43, %31, %19, %7
ret i32 0
}