#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 parseMaximumDigitsForUInt256InBase(int base) {
  switch (base) {
  case 2:
    return 256;
  case 10:
    return 78;
  case 16:
    return 64;
  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",
            157, "0");
      }
    } while (0);
  }
}


x86 assembly (clang, -O0):
<parseMaximumDigitsForUInt256InBase>:
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 <parseMaximumDigitsForUInt256InBase+0x41>
jmp    112f <parseMaximumDigitsForUInt256InBase+0x1f>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     115d <parseMaximumDigitsForUInt256InBase+0x4d>
jmp    1140 <parseMaximumDigitsForUInt256InBase+0x30>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     1169 <parseMaximumDigitsForUInt256InBase+0x59>
jmp    1175 <parseMaximumDigitsForUInt256InBase+0x65>
movl   $0x100,-0x4(%rbp)
jmp    1197 <parseMaximumDigitsForUInt256InBase+0x87>
movl   $0x4e,-0x4(%rbp)
jmp    1197 <parseMaximumDigitsForUInt256InBase+0x87>
movl   $0x40,-0x4(%rbp)
jmp    1197 <parseMaximumDigitsForUInt256InBase+0x87>
jmp    117a <parseMaximumDigitsForUInt256InBase+0x6a>
lea    0xe7f(%rip),%rdi
mov    $0x9d,%esi
lea    0xf1d(%rip),%rdx
call   1030 <__BRFail@plt>
jmp    1197 <parseMaximumDigitsForUInt256InBase+0x87>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseMaximumDigitsForUInt256InBase>:
cmp    $0x2,%edi
je     1125 <parseMaximumDigitsForUInt256InBase+0x15>
cmp    $0x10,%edi
je     112b <parseMaximumDigitsForUInt256InBase+0x1b>
cmp    $0xa,%edi
jne    1131 <parseMaximumDigitsForUInt256InBase+0x21>
mov    $0x4e,%eax
ret
mov    $0x100,%eax
ret
mov    $0x40,%eax
ret
push   %rax
lea    0xec7(%rip),%rdi
lea    0xf6a(%rip),%rdx
mov    $0x9d,%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 @parseMaximumDigitsForUInt256InBase(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 256, i32* %2
br label %12
6: ; preds = %1
store i32 78, i32* %2
br label %12
7: ; preds = %1
store i32 64, 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 157, 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 @parseMaximumDigitsForUInt256InBase(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 157, 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 ], [ 64, %3 ], [ 78, %2 ], [ 256, %1 ]
ret i32 %7
}