#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 */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int BUFSIZ;
int EXIT_FAILURE;
int /*<<< orphan*/ erro(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int mpz_init_set_str(int /*<<< orphan*/, char *, long long);
int /*<<< orphan*/ mpz_out_str(int /*<<< orphan*/, long long,
                               int /*<<< orphan*/);
int mpz_set_str(int /*<<< orphan*/, char *, long long);
long long pegabase(char **);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
size_t strlen(char *);
long long strtol(char *, char **, int);
int main(int argc, char **argv) {
  long long BaseEntrada, BaseSaida;
  char *p, *num, buf[BUFSIZ];
  size_t size;
  mpz_t op;
  if (argc < 2 || argc > 3) {
    fprintf(stderr,
            "Coded by Cooler_ \nbase convert v0.1\n between 2 until 100 & -2 "
            "until -54\n%s [numero] <Base>\n",
            argc ? *argv : "base");
    return EXIT_FAILURE;
  }
  BaseSaida = strtol(argv[argc - 1], &p, 10);
  if (!argv[argc - 1][0] || *p != 0 ||
      !((BaseSaida > -55 && BaseSaida < -1) ||
        (BaseSaida > 1 && BaseSaida < 168))) {
    fprintf(stderr, "base invalida '%s'. pode estar entre -2 ,-54 e 2,100\n",
            argv[argc - 1]);
    return EXIT_FAILURE;
  }
  if (argc == 2) {
    mpz_init(op);
    do {
      if (buf[0] == '\n')
        continue;
      size = strlen(buf);
      if (buf[size - 1] == '\n')
        buf[--size] = 0;
      num = buf;
      if ((BaseEntrada = pegabase(&num)) == -1) {
        fprintf(stderr,
                "base invalida '%s'. pode estar entre -2 ,-54 e 2 ,100\n", num);
        continue;
      }
      if (mpz_set_str(op, num, BaseEntrada) == -1) {
        fprintf(stderr, "Base %lld não bate com '%s'\n", BaseEntrada, num);
        continue;
      }
      if (!mpz_out_str(stdout, BaseSaida, op))
        erro(op);
      putchar('\n');
    } while (fgets(buf, sizeof buf, stdin) != NULL);
    mpz_clear(op);
  } else {
    num = argv[1];
    if ((BaseEntrada = pegabase(&num)) == -1) {
      fprintf(stderr, "base invalida '%s'. pode estar entre -2 ,-54 e 2 ,168\n",
              num);
      return EXIT_FAILURE;
    }
    if (mpz_init_set_str(op, num, BaseEntrada) == -1)
      erro(op);
    if (!mpz_out_str(stdout, BaseSaida, op))
      erro(op);
    putchar('\n');
    mpz_clear(op);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2df3(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x60(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     121a <main+0x5a>
cmpl   $0x3,-0x8(%rbp)
jle    127d <main+0xbd>
mov    0x2db7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1240 <main+0x80>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
jmp    1250 <main+0x90>
lea    0xe15(%rip),%rax
mov    %rax,-0x70(%rbp)
jmp    1250 <main+0x90>
mov    -0x64(%rbp),%edi
mov    -0x70(%rbp),%rdx
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1539 <main+0x379>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xa,%edx
call   10a0 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
cmpb   $0x0,(%rax)
je     12f9 <main+0x139>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12f9 <main+0x139>
cmpq   $0xffffffffffffffc9,-0x20(%rbp)
jle    12e0 <main+0x120>
cmpq   $0xffffffffffffffff,-0x20(%rbp)
jl     1339 <main+0x179>
cmpq   $0x1,-0x20(%rbp)
jle    12f9 <main+0x139>
cmpq   $0xa8,-0x20(%rbp)
jl     1339 <main+0x179>
mov    0x2cd8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd47(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1539 <main+0x379>
cmpl   $0x2,-0x8(%rbp)
jne    147c <main+0x2bc>
mov    -0x4c(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1360 <main+0x1a0>
jmp    144d <main+0x28d>
mov    -0x58(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
mov    %rcx,-0x48(%rbp)
mov    -0x48(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    13a1 <main+0x1e1>
mov    -0x58(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x48(%rbp)
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x58(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
call   10d0 <pegabase@plt>
mov    %rax,-0x18(%rbp)
cmp    $0xffffffffffffffff,%rax
jne    13e0 <main+0x220>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xcc3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    144d <main+0x28d>
mov    -0x4c(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   10c0 <mpz_set_str@plt>
cmp    $0xffffffff,%eax
jne    141d <main+0x25d>
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xcbd(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    144d <main+0x28d>
mov    0x2b9c(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
mov    -0x4c(%rbp),%edx
call   10b0 <mpz_out_str@plt>
cmp    $0x0,%eax
jne    1443 <main+0x283>
mov    -0x4c(%rbp),%edi
call   1050 <erro@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    %eax,%esi
mov    0x2b8a(%rip),%rax
mov    (%rax),%edx
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    134b <main+0x18b>
mov    -0x4c(%rbp),%edi
call   10e0 <mpz_clear@plt>
jmp    152b <main+0x36b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
call   10d0 <pegabase@plt>
mov    %rax,-0x18(%rbp)
cmp    $0xffffffffffffffff,%rax
jne    14d2 <main+0x312>
mov    0x2b32(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xc39(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2b07(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1539 <main+0x379>
mov    -0x4c(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <mpz_init_set_str@plt>
cmp    $0xffffffff,%eax
jne    14f3 <main+0x333>
mov    -0x4c(%rbp),%edi
call   1050 <erro@plt>
mov    0x2ac6(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
mov    -0x4c(%rbp),%edx
call   10b0 <mpz_out_str@plt>
cmp    $0x0,%eax
jne    1519 <main+0x359>
mov    -0x4c(%rbp),%edi
call   1050 <erro@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4c(%rbp),%edi
call   10e0 <mpz_clear@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r12
mov    %edi,%r13d
mov    %rsp,%r14
mov    0x2def(%rip),%rax
mov    (%rax),%r15d
mov    %rsp,%rbx
lea    0xf(%r15),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x4(%r13),%eax
cmp    $0xfffffffd,%eax
ja     1212 <main+0x52>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
test   %r13d,%r13d
je     127b <main+0xbb>
mov    (%r12),%rdx
jmp    1282 <main+0xc2>
mov    %r14,-0x40(%rbp)
lea    -0x1(%r13),%r14d
mov    (%r12,%r14,8),%rdi
lea    -0x48(%rbp),%rsi
mov    $0xa,%edx
call   10a0 <strtol@plt>
mov    (%r12,%r14,8),%rdx
cmpb   $0x0,(%rdx)
je     1255 <main+0x95>
mov    -0x48(%rbp),%rcx
cmpb   $0x0,(%rcx)
jne    1255 <main+0x95>
lea    0x36(%rax),%rcx
cmp    $0x35,%rcx
jb     12ab <main+0xeb>
lea    -0x2(%rax),%rcx
cmp    $0xa6,%rcx
jb     12ab <main+0xeb>
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
lea    0xdfc(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%eax
mov    -0x40(%rbp),%r14
jmp    1299 <main+0xd9>
lea    0xdda(%rip),%rdx
lea    0xd77(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%eax
mov    %r14,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rax,-0x38(%rbp)
cmp    $0x2,%r13d
mov    -0x40(%rbp),%r14
jne    13a1 <main+0x1e1>
call   1080 <mpz_init@plt>
mov    0x2d1f(%rip),%r12
cmp    $0xa,%al
je     1380 <main+0x1c0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    12f4 <main+0x134>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
call   10d0 <pegabase@plt>
cmp    $0xffffffffffffffff,%rax
je     1342 <main+0x182>
mov    %rax,%r13
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
call   10c0 <mpz_set_str@plt>
cmp    $0xffffffff,%eax
je     135f <main+0x19f>
mov    0x2c9e(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rsi
call   10b0 <mpz_out_str@plt>
test   %eax,%eax
jne    1336 <main+0x176>
call   1050 <erro@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1380 <main+0x1c0>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xd41(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1380 <main+0x1c0>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rcx
lea    0xd5b(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
nopl   (%rax)
mov    (%r12),%edx
mov    %rbx,%rdi
mov    %r15d,%esi
call   1070 <fgets@plt>
test   %rax,%rax
je     13f4 <main+0x234>
movzbl (%rbx),%eax
cmp    $0xa,%al
jne    12e0 <main+0x120>
jmp    1380 <main+0x1c0>
mov    0x8(%r12),%rax
mov    %rax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
call   10d0 <pegabase@plt>
cmp    $0xffffffffffffffff,%rax
je     1400 <main+0x240>
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
call   1060 <mpz_init_set_str@plt>
cmp    $0xffffffff,%eax
jne    13cf <main+0x20f>
call   1050 <erro@plt>
mov    0x2bea(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rsi
call   10b0 <mpz_out_str@plt>
test   %eax,%eax
jne    13ea <main+0x22a>
call   1050 <erro@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
call   10e0 <mpz_clear@plt>
xor    %eax,%eax
jmp    1299 <main+0xd9>
mov    0x2bd1(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xcd8(%rip),%rsi
jmp    1289 <main+0xc9>

LLVM IR (-O0):
@BUFSIZ = global i32 0
@stderr = global i32 0
@.str = [92 x i8] c"Coded by Cooler_ \0Abase convert v0.1\0A between 2 until 100 & -2 until -54\0A%s [numero] <Base>\0A\00"
@.str.1 = [5 x i8] c"base\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [54 x i8] c"base invalida '%s'. pode estar entre -2 ,-54 e 2,100\0A\00"
@.str.3 = [55 x i8] c"base invalida '%s'. pode estar entre -2 ,-54 e 2 ,100\0A\00"
@.str.4 = [30 x i8] c"Base %lld n\C3\A3o bate com '%s'\0A\00"
@stdout = global i32 0
@stdin = global i32 0
@.str.5 = [55 x i8] c"base invalida '%s'. pode estar entre -2 ,-54 e 2 ,168\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* @BUFSIZ
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %10
%18 = alloca i8, i64 %16
store i64 %16, i64* %11
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 2
br i1 %20, label %24, label %21
21: ; preds = %2
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 3
br i1 %23, label %24, label %36
24: ; preds = %21, %2
%25 = load i32, i32* @stderr
%26 = load i32, i32* %4
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i8**, i8*** %5
%30 = load i8*, i8** %29
br label %32
31: ; preds = %24
br label %32
32: ; preds = %31, %28
%33 = phi i8* [ %30, %28 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %31 ]
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %33)
%35 = load i32, i32* @EXIT_FAILURE
store i32 %35, i32* %3
store i32 1, i32* %14
br label %175
36: ; preds = %21
%37 = load i8**, i8*** %5
%38 = load i32, i32* %4
%39 = sub nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %37, i64 %40
%42 = load i8*, i8** %41
%43 = call i64 @strtol(i8* %42, i8** %8, i32 10)
store i64 %43, i64* %7
%44 = load i8**, i8*** %5
%45 = load i32, i32* %4
%46 = sub nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %44, i64 %47
%49 = load i8*, i8** %48
%50 = getelementptr inbounds i8, i8* %49, i64 0
%51 = load i8, i8* %50
%52 = icmp ne i8 %51, 0
br i1 %52, label %53, label %70
53: ; preds = %36
%54 = load i8*, i8** %8
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 0
br i1 %57, label %70, label %58
58: ; preds = %53
%59 = load i64, i64* %7
%60 = icmp sgt i64 %59, -55
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i64, i64* %7
%63 = icmp slt i64 %62, -1
br i1 %63, label %80, label %64
64: ; preds = %61, %58
%65 = load i64, i64* %7
%66 = icmp sgt i64 %65, 1
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = load i64, i64* %7
%69 = icmp slt i64 %68, 168
br i1 %69, label %80, label %70
70: ; preds = %67, %64, %53, %36
%71 = load i32, i32* @stderr
%72 = load i8**, i8*** %5
%73 = load i32, i32* %4
%74 = sub nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %72, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i8* %77)
%79 = load i32, i32* @EXIT_FAILURE
store i32 %79, i32* %3
store i32 1, i32* %14
br label %175
80: ; preds = %67, %61
%81 = load i32, i32* %4
%82 = icmp eq i32 %81, 2
br i1 %82, label %83, label %141
83: ; preds = %80
%84 = load i32, i32* %13
%85 = call i32 @mpz_init(i32 %84)
br label %86
86: ; preds = %133, %83
%87 = getelementptr inbounds i8, i8* %18, i64 0
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 10
br i1 %90, label %91, label %92
91: ; preds = %86
br label %133
92: ; preds = %86
%93 = call i64 @strlen(i8* %18)
store i64 %93, i64* %12
%94 = load i64, i64* %12
%95 = sub i64 %94, 1
%96 = getelementptr inbounds i8, i8* %18, i64 %95
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 10
br i1 %99, label %100, label %104
100: ; preds = %92
%101 = load i64, i64* %12
%102 = add i64 %101, -1
store i64 %102, i64* %12
%103 = getelementptr inbounds i8, i8* %18, i64 %102
store i8 0, i8* %103
br label %104
104: ; preds = %100, %92
store i8* %18, i8** %9
%105 = call i64 @pegabase(i8** %9)
store i64 %105, i64* %6
%106 = icmp eq i64 %105, -1
br i1 %106, label %107, label %111
107: ; preds = %104
%108 = load i32, i32* @stderr
%109 = load i8*, i8** %9
%110 = call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i8* %109)
br label %133
111: ; preds = %104
%112 = load i32, i32* %13
%113 = load i8*, i8** %9
%114 = load i64, i64* %6
%115 = call i32 @mpz_set_str(i32 %112, i8* %113, i64 %114)
%116 = icmp eq i32 %115, -1
br i1 %116, label %117, label %122
117: ; preds = %111
%118 = load i32, i32* @stderr
%119 = load i64, i64* %6
%120 = load i8*, i8** %9
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i64 %119, i8* %120)
br label %133
122: ; preds = %111
%123 = load i32, i32* @stdout
%124 = load i64, i64* %7
%125 = load i32, i32* %13
%126 = call i32 @mpz_out_str(i32 %123, i64 %124, i32 %125)
%127 = icmp ne i32 %126, 0
br i1 %127, label %131, label %128
128: ; preds = %122
%129 = load i32, i32* %13
%130 = call i32 @erro(i32 %129)
br label %131
131: ; preds = %128, %122
%132 = call i32 @putchar(i8 signext 10)
br label %133
133: ; preds = %131, %117, %107, %91
%134 = trunc i64 %16 to i32
%135 = load i32, i32* @stdin
%136 = call i32* @fgets(i8* %18, i32 %134, i32 %135)
%137 = icmp ne i32* %136, null
br i1 %137, label %86, label %138
138: ; preds = %133
%139 = load i32, i32* %13
%140 = call i32 @mpz_clear(i32 %139)
br label %174
141: ; preds = %80
%142 = load i8**, i8*** %5
%143 = getelementptr inbounds i8*, i8** %142, i64 1
%144 = load i8*, i8** %143
store i8* %144, i8** %9
%145 = call i64 @pegabase(i8** %9)
store i64 %145, i64* %6
%146 = icmp eq i64 %145, -1
br i1 %146, label %147, label %152
147: ; preds = %141
%148 = load i32, i32* @stderr
%149 = load i8*, i8** %9
%150 = call i32 (i32, i8*, ...) @fprintf(i32 %148, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %149)
%151 = load i32, i32* @EXIT_FAILURE
store i32 %151, i32* %3
store i32 1, i32* %14
br label %175
152: ; preds = %141
%153 = load i32, i32* %13
%154 = load i8*, i8** %9
%155 = load i64, i64* %6
%156 = call i32 @mpz_init_set_str(i32 %153, i8* %154, i64 %155)
%157 = icmp eq i32 %156, -1
br i1 %157, label %158, label %161
158: ; preds = %152
%159 = load i32, i32* %13
%160 = call i32 @erro(i32 %159)
br label %161
161: ; preds = %158, %152
%162 = load i32, i32* @stdout
%163 = load i64, i64* %7
%164 = load i32, i32* %13
%165 = call i32 @mpz_out_str(i32 %162, i64 %163, i32 %164)
%166 = icmp ne i32 %165, 0
br i1 %166, label %170, label %167
167: ; preds = %161
%168 = load i32, i32* %13
%169 = call i32 @erro(i32 %168)
br label %170
170: ; preds = %167, %161
%171 = call i32 @putchar(i8 signext 10)
%172 = load i32, i32* %13
%173 = call i32 @mpz_clear(i32 %172)
br label %174
174: ; preds = %170, %138
store i32 0, i32* %3
store i32 1, i32* %14
br label %175
175: ; preds = %174, %147, %70, %32
%176 = load i8*, i8** %10
%177 = load i32, i32* %3
ret i32 %177
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@stderr = global i32 0
@.str = [92 x i8] c"Coded by Cooler_ \0Abase convert v0.1\0A between 2 until 100 & -2 until -54\0A%s [numero] <Base>\0A\00"
@.str.1 = [5 x i8] c"base\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [54 x i8] c"base invalida '%s'. pode estar entre -2 ,-54 e 2,100\0A\00"
@.str.3 = [55 x i8] c"base invalida '%s'. pode estar entre -2 ,-54 e 2 ,100\0A\00"
@.str.4 = [30 x i8] c"Base %lld n\C3\A3o bate com '%s'\0A\00"
@stdout = global i32 0
@stdin = global i32 0
@.str.5 = [55 x i8] c"base invalida '%s'. pode estar entre -2 ,-54 e 2 ,168\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = load i32, i32* @BUFSIZ
%8 = zext i32 %7 to i64
%9 = tail call i8* @llvm.stacksave()
%10 = alloca i8, i64 %8
%11 = add i32 %0, -4
%12 = icmp ult i32 %11, -2
br i1 %12, label %13, label %22
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = icmp eq i32 %0, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = load i8*, i8** %1
br label %18
18: ; preds = %13, %16
%19 = phi i8* [ %17, %16 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %13 ]
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @EXIT_FAILURE
br label %115
22: ; preds = %2
%23 = add nsw i32 %0, -1
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @strtol(i8* %26, i8** %3, i32 10)
%28 = load i8*, i8** %25
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %41, label %31
31: ; preds = %22
%32 = load i8*, i8** %3
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %31
%36 = add i64 %27, 54
%37 = icmp ult i64 %36, 53
%38 = add i64 %27, -2
%39 = icmp ult i64 %38, 166
%40 = or i1 %37, %39
br i1 %40, label %45, label %41
41: ; preds = %35, %31, %22
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%44 = load i32, i32* @EXIT_FAILURE
br label %115
45: ; preds = %35
%46 = icmp eq i32 %0, 2
br i1 %46, label %47, label %90
47: ; preds = %45
%48 = tail call i32 @mpz_init(i32 undef)
br label %49
49: ; preds = %86, %47
%50 = phi i8 [ %87, %86 ], [ undef, %47 ]
%51 = icmp eq i8 %50, 10
br i1 %51, label %82, label %52
52: ; preds = %49
%53 = call i64 @strlen(i8* %10)
%54 = add i64 %53, -1
%55 = getelementptr inbounds i8, i8* %10, i64 %54
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 10
br i1 %57, label %58, label %59
58: ; preds = %52
store i8 0, i8* %55
br label %59
59: ; preds = %58, %52
store i8* %10, i8** %4
%60 = call i64 @pegabase(i8** %4)
%61 = icmp eq i64 %60, -1
br i1 %61, label %62, label %66
62: ; preds = %59
%63 = load i32, i32* @stderr
%64 = load i8*, i8** %4
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i8* %64)
br label %82
66: ; preds = %59
%67 = load i8*, i8** %4
%68 = call i32 @mpz_set_str(i32 undef, i8* %67, i64 %60)
%69 = icmp eq i32 %68, -1
br i1 %69, label %70, label %74
70: ; preds = %66
%71 = load i32, i32* @stderr
%72 = load i8*, i8** %4
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i64 %60, i8* %72)
br label %82
74: ; preds = %66
%75 = load i32, i32* @stdout
%76 = call i32 @mpz_out_str(i32 %75, i64 %27, i32 undef)
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %74
%79 = call i32 @erro(i32 undef)
br label %80
80: ; preds = %78, %74
%81 = call i32 @putchar(i8 signext 10)
br label %82
82: ; preds = %49, %80, %70, %62
%83 = load i32, i32* @stdin
%84 = call i32* @fgets(i8* %10, i32 %7, i32 %83)
%85 = icmp eq i32* %84, null
br i1 %85, label %88, label %86
86: ; preds = %82
%87 = load i8, i8* %10
br label %49
88: ; preds = %82
%89 = call i32 @mpz_clear(i32 undef)
br label %115
90: ; preds = %45
%91 = getelementptr inbounds i8*, i8** %1, i64 1
%92 = load i8*, i8** %91
store i8* %92, i8** %4
%93 = call i64 @pegabase(i8** %4)
%94 = icmp eq i64 %93, -1
br i1 %94, label %95, label %100
95: ; preds = %90
%96 = load i32, i32* @stderr
%97 = load i8*, i8** %4
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %97)
%99 = load i32, i32* @EXIT_FAILURE
br label %115
100: ; preds = %90
%101 = load i8*, i8** %4
%102 = call i32 @mpz_init_set_str(i32 undef, i8* %101, i64 %93)
%103 = icmp eq i32 %102, -1
br i1 %103, label %104, label %106
104: ; preds = %100
%105 = call i32 @erro(i32 undef)
br label %106
106: ; preds = %104, %100
%107 = load i32, i32* @stdout
%108 = call i32 @mpz_out_str(i32 %107, i64 %27, i32 undef)
%109 = icmp eq i32 %108, 0
br i1 %109, label %110, label %112
110: ; preds = %106
%111 = call i32 @erro(i32 undef)
br label %112
112: ; preds = %110, %106
%113 = call i32 @putchar(i8 signext 10)
%114 = call i32 @mpz_clear(i32 undef)
br label %115
115: ; preds = %88, %112, %95, %41, %18
%116 = phi i32 [ %21, %18 ], [ %44, %41 ], [ %99, %95 ], [ 0, %112 ], [ 0, %88 ]
ret i32 %116
}