#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*/ printf(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void get_micro_h_name(char *name, char *ret_str) {
  int mi;
  static int name_i = 1;
  static char *micro_strings[] = {"MICROCONTROLLER_8051",
                                  "8051.h",
                                  "MICROCONTROLLER_8052",
                                  "8052.h",
                                  "MICROCONTROLLER_AT89CX051",
                                  "at89x051.h",
                                  "MICROCONTROLLER_AT89S53",
                                  "at89s53.h",
                                  "MICROCONTROLLER_AT89X52",
                                  "at89x52.h",
                                  "MICROCONTROLLER_AT89X55",
                                  "at89x55.h",
                                  "MICROCONTROLLER_DS5000",
                                  "ds5000.h",
                                  "MICROCONTROLLER_DS5001",
                                  "ds5001.h",
                                  "MICROCONTROLLER_DS80C32X",
                                  "ds80c32x.h",
                                  "MICROCONTROLLER_DS80C390",
                                  "ds80c390.h",
                                  "MICROCONTROLLER_DS89C420",
                                  "ds89c420.h",
                                  "MICROCONTROLLER_DS8XC520",
                                  "ds8xc520.h",
                                  "MICROCONTROLLER_SAB80515",
                                  "sab80515.h",
                                  "MICROCONTROLLER_SAB80515A",
                                  "sab80515a.h",
                                  "MICROCONTROLLER_SAB80517",
                                  "sab80517.h",
                                  "MICROCONTROLLER_P80C552",
                                  "p80c552.h",
                                  NULL};
  *ret_str = 0;
  mi = 0;
  while (micro_strings[mi] != NULL) {
    if (strcmp(micro_strings[mi], name) == 0) {
      strcpy(ret_str, micro_strings[mi + 1]);
    }
    mi += 2;
  }
  if (*ret_str == 0) {
    sprintf(ret_str, "noname%d.h", name_i++);
    printf("warning, could not find .h filename for %s using %s\n", name,
           ret_str);
  }
}


x86 assembly (clang, -O0):
<get_micro_h_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2ef7(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     11c1 <get_micro_h_name+0x81>
movslq -0x14(%rbp),%rcx
lea    0x2ee1(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11b3 <get_micro_h_name+0x73>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2eb6(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <get_micro_h_name+0x1e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1206 <get_micro_h_name+0xc6>
mov    -0x10(%rbp),%rdi
mov    0x2e75(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2e6a(%rip)
lea    0x1036(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0x102d(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_micro_h_name>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
movb   $0x0,(%rsi)
xor    %ebx,%ebx
lea    0x2bb6(%rip),%r12
jmp    116a <get_micro_h_name+0x2a>
nopl   0x0(%rax)
add    $0x2,%rbx
cmp    $0x20,%rbx
je     118a <get_micro_h_name+0x4a>
mov    (%r12,%rbx,8),%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1160 <get_micro_h_name+0x20>
mov    0x8(%r12,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
jmp    1160 <get_micro_h_name+0x20>
cmpb   $0x0,(%r14)
je     119c <get_micro_h_name+0x5c>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    0x2e9e(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2e95(%rip)
lea    0x1071(%rip),%rsi
mov    %r14,%rdi
call   1060 <sprintf@plt>
lea    0x106d(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@get_micro_h_name.name_i = internal global i32 1
@get_micro_h_name.micro_strings = internal global [33 x i8*] [i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.31, i32 0, i32 0), i8* null]
@.str = [21 x i8] c"MICROCONTROLLER_8051\00"
@.str.1 = [7 x i8] c"8051.h\00"
@.str.2 = [21 x i8] c"MICROCONTROLLER_8052\00"
@.str.3 = [7 x i8] c"8052.h\00"
@.str.4 = [26 x i8] c"MICROCONTROLLER_AT89CX051\00"
@.str.5 = [11 x i8] c"at89x051.h\00"
@.str.6 = [24 x i8] c"MICROCONTROLLER_AT89S53\00"
@.str.7 = [10 x i8] c"at89s53.h\00"
@.str.8 = [24 x i8] c"MICROCONTROLLER_AT89X52\00"
@.str.9 = [10 x i8] c"at89x52.h\00"
@.str.10 = [24 x i8] c"MICROCONTROLLER_AT89X55\00"
@.str.11 = [10 x i8] c"at89x55.h\00"
@.str.12 = [23 x i8] c"MICROCONTROLLER_DS5000\00"
@.str.13 = [9 x i8] c"ds5000.h\00"
@.str.14 = [23 x i8] c"MICROCONTROLLER_DS5001\00"
@.str.15 = [9 x i8] c"ds5001.h\00"
@.str.16 = [25 x i8] c"MICROCONTROLLER_DS80C32X\00"
@.str.17 = [11 x i8] c"ds80c32x.h\00"
@.str.18 = [25 x i8] c"MICROCONTROLLER_DS80C390\00"
@.str.19 = [11 x i8] c"ds80c390.h\00"
@.str.20 = [25 x i8] c"MICROCONTROLLER_DS89C420\00"
@.str.21 = [11 x i8] c"ds89c420.h\00"
@.str.22 = [25 x i8] c"MICROCONTROLLER_DS8XC520\00"
@.str.23 = [11 x i8] c"ds8xc520.h\00"
@.str.24 = [25 x i8] c"MICROCONTROLLER_SAB80515\00"
@.str.25 = [11 x i8] c"sab80515.h\00"
@.str.26 = [26 x i8] c"MICROCONTROLLER_SAB80515A\00"
@.str.27 = [12 x i8] c"sab80515a.h\00"
@.str.28 = [25 x i8] c"MICROCONTROLLER_SAB80517\00"
@.str.29 = [11 x i8] c"sab80517.h\00"
@.str.30 = [24 x i8] c"MICROCONTROLLER_P80C552\00"
@.str.31 = [10 x i8] c"p80c552.h\00"
@.str.32 = [11 x i8] c"noname%d.h\00"
@.str.33 = [53 x i8] c"warning, could not find .h filename for %s using %s\0A\00"
define void @get_micro_h_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8 0, i8* %6
store i32 0, i32* %5
br label %7
7: ; preds = %29, %2
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [33 x i8*], [33 x i8*]* @get_micro_h_name.micro_strings, i64 0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %32
13: ; preds = %7
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [33 x i8*], [33 x i8*]* @get_micro_h_name.micro_strings, i64 0, i64 %15
%17 = load i8*, i8** %16
%18 = load i8*, i8** %3
%19 = call i64 @strcmp(i8* %17, i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %29
21: ; preds = %13
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [33 x i8*], [33 x i8*]* @get_micro_h_name.micro_strings, i64 0, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 @strcpy(i8* %22, i8* %27)
br label %29
29: ; preds = %21, %13
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 2
store i32 %31, i32* %5
br label %7
32: ; preds = %7
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %32
%38 = load i8*, i8** %4
%39 = load i32, i32* @get_micro_h_name.name_i
%40 = add nsw i32 %39, 1
store i32 %40, i32* @get_micro_h_name.name_i
%41 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.32, i64 0, i64 0), i32 %39)
%42 = load i8*, i8** %3
%43 = load i8*, i8** %4
%44 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.33, i64 0, i64 0), i8* %42, i8* %43)
br label %45
45: ; preds = %37, %32
ret void
}

LLVM IR (-O2):
@get_micro_h_name.name_i = internal unnamed_addr global i32 1
@get_micro_h_name.micro_strings = internal unnamed_addr constant [33 x i8*] [i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.31, i32 0, i32 0), i8* null]
@.str = [21 x i8] c"MICROCONTROLLER_8051\00"
@.str.1 = [7 x i8] c"8051.h\00"
@.str.2 = [21 x i8] c"MICROCONTROLLER_8052\00"
@.str.3 = [7 x i8] c"8052.h\00"
@.str.4 = [26 x i8] c"MICROCONTROLLER_AT89CX051\00"
@.str.5 = [11 x i8] c"at89x051.h\00"
@.str.6 = [24 x i8] c"MICROCONTROLLER_AT89S53\00"
@.str.7 = [10 x i8] c"at89s53.h\00"
@.str.8 = [24 x i8] c"MICROCONTROLLER_AT89X52\00"
@.str.9 = [10 x i8] c"at89x52.h\00"
@.str.10 = [24 x i8] c"MICROCONTROLLER_AT89X55\00"
@.str.11 = [10 x i8] c"at89x55.h\00"
@.str.12 = [23 x i8] c"MICROCONTROLLER_DS5000\00"
@.str.13 = [9 x i8] c"ds5000.h\00"
@.str.14 = [23 x i8] c"MICROCONTROLLER_DS5001\00"
@.str.15 = [9 x i8] c"ds5001.h\00"
@.str.16 = [25 x i8] c"MICROCONTROLLER_DS80C32X\00"
@.str.17 = [11 x i8] c"ds80c32x.h\00"
@.str.18 = [25 x i8] c"MICROCONTROLLER_DS80C390\00"
@.str.19 = [11 x i8] c"ds80c390.h\00"
@.str.20 = [25 x i8] c"MICROCONTROLLER_DS89C420\00"
@.str.21 = [11 x i8] c"ds89c420.h\00"
@.str.22 = [25 x i8] c"MICROCONTROLLER_DS8XC520\00"
@.str.23 = [11 x i8] c"ds8xc520.h\00"
@.str.24 = [25 x i8] c"MICROCONTROLLER_SAB80515\00"
@.str.25 = [11 x i8] c"sab80515.h\00"
@.str.26 = [26 x i8] c"MICROCONTROLLER_SAB80515A\00"
@.str.27 = [12 x i8] c"sab80515a.h\00"
@.str.28 = [25 x i8] c"MICROCONTROLLER_SAB80517\00"
@.str.29 = [11 x i8] c"sab80517.h\00"
@.str.30 = [24 x i8] c"MICROCONTROLLER_P80C552\00"
@.str.31 = [10 x i8] c"p80c552.h\00"
@.str.32 = [11 x i8] c"noname%d.h\00"
@.str.33 = [53 x i8] c"warning, could not find .h filename for %s using %s\0A\00"
define void @get_micro_h_name(i8* %0, i8* %1) {
store i8 0, i8* %1
br label %3
3: ; preds = %2, %14
%4 = phi i64 [ 0, %2 ], [ %15, %14 ]
%5 = getelementptr inbounds [33 x i8*], [33 x i8*]* @get_micro_h_name.micro_strings, i64 0, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = or i64 %4, 1
%11 = getelementptr inbounds [33 x i8*], [33 x i8*]* @get_micro_h_name.micro_strings, i64 0, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @strcpy(i8* %1, i8* %12)
br label %14
14: ; preds = %9, %3
%15 = add nuw nsw i64 %4, 2
%16 = icmp eq i64 %15, 32
br i1 %16, label %17, label %3
17: ; preds = %14
%18 = load i8, i8* %1
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* @get_micro_h_name.name_i
%22 = add nsw i32 %21, 1
store i32 %22, i32* @get_micro_h_name.name_i
%23 = tail call i32 @sprintf(i8* %1, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.32, i64 0, i64 0), i32 %21)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.33, i64 0, i64 0), i8* %0, i8* %1)
br label %25
25: ; preds = %20, %17
ret void
}