#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*/ __BRFail(char *, int, char *);
int parseMaximumDigitsForUInt64InBase(int base) {
  switch (base) {
  case 2:
    return 64;
  case 10:
    return 19;
  case 16:
    return 16;
  default:
    do {
      if (!(0)) {
        __BRFail(
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/breadwallet/breadwallet-core/refs/heads/"
            "develop/ethereum/util/BRUtilMathParse.c",
            147, "0");
      }
    } while (0);
  }
}


x86 assembly (clang, -O0):
<parseMaximumDigitsForUInt64InBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     1151 <parseMaximumDigitsForUInt64InBase+0x41>
jmp    112f <parseMaximumDigitsForUInt64InBase+0x1f>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     115d <parseMaximumDigitsForUInt64InBase+0x4d>
jmp    1140 <parseMaximumDigitsForUInt64InBase+0x30>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     1169 <parseMaximumDigitsForUInt64InBase+0x59>
jmp    1175 <parseMaximumDigitsForUInt64InBase+0x65>
movl   $0x40,-0x4(%rbp)
jmp    1197 <parseMaximumDigitsForUInt64InBase+0x87>
movl   $0x13,-0x4(%rbp)
jmp    1197 <parseMaximumDigitsForUInt64InBase+0x87>
movl   $0x10,-0x4(%rbp)
jmp    1197 <parseMaximumDigitsForUInt64InBase+0x87>
jmp    117a <parseMaximumDigitsForUInt64InBase+0x6a>
lea    0xe7f(%rip),%rdi
mov    $0x93,%esi
lea    0xf1d(%rip),%rdx
call   1030 <__BRFail@plt>
jmp    1197 <parseMaximumDigitsForUInt64InBase+0x87>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseMaximumDigitsForUInt64InBase>:
cmp    $0x2,%edi
je     1125 <parseMaximumDigitsForUInt64InBase+0x15>
cmp    $0x10,%edi
je     112b <parseMaximumDigitsForUInt64InBase+0x1b>
cmp    $0xa,%edi
jne    1131 <parseMaximumDigitsForUInt64InBase+0x21>
mov    $0x13,%eax
ret
mov    $0x40,%eax
ret
mov    $0x10,%eax
ret
push   %rax
lea    0xec7(%rip),%rdi
lea    0xf6a(%rip),%rdx
mov    $0x93,%esi
call   1030 <__BRFail@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/breadwallet/breadwallet-core/refs/heads/develop/ethereum/util/BRUtilMathParse.c\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @parseMaximumDigitsForUInt64InBase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 2, label %5
i32 10, label %6
i32 16, label %7
]
5: ; preds = %1
store i32 64, i32* %2
br label %12
6: ; preds = %1
store i32 19, i32* %2
br label %12
7: ; preds = %1
store i32 16, i32* %2
br label %12
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = call i32 @__BRFail(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9
br label %12
12: ; preds = %5, %6, %7, %11
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/breadwallet/breadwallet-core/refs/heads/develop/ethereum/util/BRUtilMathParse.c\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @parseMaximumDigitsForUInt64InBase(i32 %0) {
switch i32 %0, label %4 [
i32 2, label %6
i32 10, label %2
i32 16, label %3
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
%5 = tail call i32 @__BRFail(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %2, %3, %4
%7 = phi i32 [ undef, %4 ], [ 16, %3 ], [ 19, %2 ], [ 64, %1 ]
ret i32 %7
}