#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 */
scalar_t__ strcmp(char const *, char const *);
int getCurrencyDigits(const char *name) {
  static struct {
    const char *name;
    int digits;
    int round;
  } currencies[] = {{"ADP", 0, 0}, {"BHD", 3, 0}, {"BIF", 0, 0}, {"BYR", 0, 0},
                    {"CHF", 2, 5}, {"CLF", 0, 0}, {"CLP", 0, 0}, {"DJF", 0, 0},
                    {"GNF", 0, 0}, {"IQD", 3, 0}, {"JOD", 3, 0}, {"JPY", 0, 0},
                    {"KMF", 0, 0}, {"KRW", 0, 0}, {"KWD", 3, 0}, {"LYD", 3, 0},
                    {"MGF", 0, 0}, {"OMR", 3, 0}, {"PYG", 0, 0}, {"RWF", 0, 0},
                    {"TND", 3, 0}, {"TRL", 0, 0}, {"TTD", 0, 0}, {"VUV", 0, 0},
                    {"XAF", 0, 0}, {"XOF", 0, 0}, {"XPF", 0, 0}, {0, 2, 0}};
  int index = 0;
  while (currencies[index].name && strcmp(currencies[index].name, name) != 0) {
    ++index;
  }
  return currencies[index].digits;
}


x86 assembly (clang, -O0):
<getCurrencyDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
lea    0x2f02(%rip),%rcx
shl    $0x4,%rax
add    %rax,%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0xd(%rbp)
je     116c <getCurrencyDigits+0x5c>
movslq -0xc(%rbp),%rcx
lea    0x2ee1(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    117c <getCurrencyDigits+0x6c>
jmp    118a <getCurrencyDigits+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <getCurrencyDigits+0x13>
movslq -0xc(%rbp),%rcx
lea    0x2e9b(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrencyDigits>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x2b41(%rip),%rbx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx),%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1154 <getCurrencyDigits+0x44>
add    $0x1,%r15
add    $0x10,%rbx
cmp    $0x1b,%r15
jne    1130 <getCurrencyDigits+0x20>
mov    $0x1b,%r15d
mov    %r15d,%eax
shl    $0x4,%rax
lea    0x2afe(%rip),%rcx
mov    0x8(%rax,%rcx,1),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32 }
@getCurrencyDigits.currencies = internal global [28 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i32 2, i32 5 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.25, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* null, i32 2, i32 0 }]
@.str = [4 x i8] c"ADP\00"
@.str.1 = [4 x i8] c"BHD\00"
@.str.2 = [4 x i8] c"BIF\00"
@.str.3 = [4 x i8] c"BYR\00"
@.str.4 = [4 x i8] c"CHF\00"
@.str.5 = [4 x i8] c"CLF\00"
@.str.6 = [4 x i8] c"CLP\00"
@.str.7 = [4 x i8] c"DJF\00"
@.str.8 = [4 x i8] c"GNF\00"
@.str.9 = [4 x i8] c"IQD\00"
@.str.10 = [4 x i8] c"JOD\00"
@.str.11 = [4 x i8] c"JPY\00"
@.str.12 = [4 x i8] c"KMF\00"
@.str.13 = [4 x i8] c"KRW\00"
@.str.14 = [4 x i8] c"KWD\00"
@.str.15 = [4 x i8] c"LYD\00"
@.str.16 = [4 x i8] c"MGF\00"
@.str.17 = [4 x i8] c"OMR\00"
@.str.18 = [4 x i8] c"PYG\00"
@.str.19 = [4 x i8] c"RWF\00"
@.str.20 = [4 x i8] c"TND\00"
@.str.21 = [4 x i8] c"TRL\00"
@.str.22 = [4 x i8] c"TTD\00"
@.str.23 = [4 x i8] c"VUV\00"
@.str.24 = [4 x i8] c"XAF\00"
@.str.25 = [4 x i8] c"XOF\00"
@.str.26 = [4 x i8] c"XPF\00"
define i32 @getCurrencyDigits(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [28 x %struct.anon], [28 x %struct.anon]* @getCurrencyDigits.currencies, i64 0, i64 %6
%8 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [28 x %struct.anon], [28 x %struct.anon]* @getCurrencyDigits.currencies, i64 0, i64 %13
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 0
%16 = load i8*, i8** %15
%17 = load i8*, i8** %2
%18 = call i64 @strcmp(i8* %16, i8* %17)
%19 = icmp ne i64 %18, 0
br label %20
20: ; preds = %11, %4
%21 = phi i1 [ false, %4 ], [ %19, %11 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %20
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [28 x %struct.anon], [28 x %struct.anon]* @getCurrencyDigits.currencies, i64 0, i64 %27
%29 = getelementptr inbounds %struct.anon, %struct.anon* %28, i32 0, i32 1
%30 = load i32, i32* %29
ret i32 %30
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i32 }
@getCurrencyDigits.currencies = internal unnamed_addr constant [28 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i32 2, i32 5 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i32 0, i32 0), i32 3, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.25, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i32 0, i32 0), i32 0, i32 0 }, %struct.anon { i8* null, i32 2, i32 0 }]
@.str = [4 x i8] c"ADP\00"
@.str.1 = [4 x i8] c"BHD\00"
@.str.2 = [4 x i8] c"BIF\00"
@.str.3 = [4 x i8] c"BYR\00"
@.str.4 = [4 x i8] c"CHF\00"
@.str.5 = [4 x i8] c"CLF\00"
@.str.6 = [4 x i8] c"CLP\00"
@.str.7 = [4 x i8] c"DJF\00"
@.str.8 = [4 x i8] c"GNF\00"
@.str.9 = [4 x i8] c"IQD\00"
@.str.10 = [4 x i8] c"JOD\00"
@.str.11 = [4 x i8] c"JPY\00"
@.str.12 = [4 x i8] c"KMF\00"
@.str.13 = [4 x i8] c"KRW\00"
@.str.14 = [4 x i8] c"KWD\00"
@.str.15 = [4 x i8] c"LYD\00"
@.str.16 = [4 x i8] c"MGF\00"
@.str.17 = [4 x i8] c"OMR\00"
@.str.18 = [4 x i8] c"PYG\00"
@.str.19 = [4 x i8] c"RWF\00"
@.str.20 = [4 x i8] c"TND\00"
@.str.21 = [4 x i8] c"TRL\00"
@.str.22 = [4 x i8] c"TTD\00"
@.str.23 = [4 x i8] c"VUV\00"
@.str.24 = [4 x i8] c"XAF\00"
@.str.25 = [4 x i8] c"XOF\00"
@.str.26 = [4 x i8] c"XPF\00"
define i32 @getCurrencyDigits(i8* %0) {
br label %2
2: ; preds = %1, %8
%3 = phi i64 [ 0, %1 ], [ %9, %8 ]
%4 = getelementptr inbounds [28 x %struct.anon], [28 x %struct.anon]* @getCurrencyDigits.currencies, i64 0, i64 %3, i32 0
%5 = load i8*, i8** %4
%6 = tail call i64 @strcmp(i8* %5, i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 27
br i1 %10, label %11, label %2
11: ; preds = %8, %2
%12 = phi i64 [ 27, %8 ], [ %3, %2 ]
%13 = and i64 %12, 4294967295
%14 = getelementptr inbounds [28 x %struct.anon], [28 x %struct.anon]* @getCurrencyDigits.currencies, i64 0, i64 %13, i32 1
%15 = load i32, i32* %14
ret i32 %15
}