#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 get_lang_id();
int /*<<< orphan*/ strcat(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *parser_header_filename(char *pref, char *yacc_filename) {
  static char fn[256];
  switch (get_lang_id()) {
  case 0:
  case 1:
    strcat(strcpy(fn, pref ? pref : "y"), ".tab.h");
    return fn;
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<parser_header_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
call   1040 <get_lang_id@plt>
sub    $0x1,%eax
ja     11ab <parser_header_filename+0x7b>
jmp    1155 <parser_header_filename+0x25>
cmpq   $0x0,-0x10(%rbp)
je     116d <parser_header_filename+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    117d <parser_header_filename+0x4d>
lea    0xe8c(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    117d <parser_header_filename+0x4d>
mov    -0x20(%rbp),%rsi
lea    0x2ec8(%rip),%rdi
call   1030 <strcpy@plt>
mov    %eax,%edi
lea    0xe6c(%rip),%rsi
call   1050 <strcat@plt>
lea    0x2eae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b3 <parser_header_filename+0x83>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_header_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <get_lang_id@plt>
cmp    $0x1,%eax
ja     1170 <parser_header_filename+0x40>
test   %r14,%r14
lea    0xeb1(%rip),%rsi
cmovne %r14,%rsi
lea    0x2ef6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe99(%rip),%rsi
mov    %eax,%edi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@parser_header_filename.fn = internal global [256 x i8] zeroinitializer
@.str = [2 x i8] c"y\00"
@.str.1 = [7 x i8] c".tab.h\00"
define i8* @parser_header_filename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = call i32 (...) @get_lang_id()
switch i32 %6, label %17 [
i32 0, label %7
i32 1, label %7
]
7: ; preds = %2, %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i8*, i8** %4
br label %13
12: ; preds = %7
br label %13
13: ; preds = %12, %10
%14 = phi i8* [ %11, %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %12 ]
%15 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @parser_header_filename.fn, i64 0, i64 0), i8* %14)
%16 = call i32 @strcat(i32 %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @parser_header_filename.fn, i64 0, i64 0), i8** %3
br label %18
17: ; preds = %2
store i8* null, i8** %3
br label %18
18: ; preds = %17, %13
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@parser_header_filename.fn = internal global [256 x i8] zeroinitializer
@.str = [2 x i8] c"y\00"
@.str.1 = [7 x i8] c".tab.h\00"
define i8* @parser_header_filename(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @get_lang_id()
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = icmp eq i8* %0, null
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0
%8 = tail call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @parser_header_filename.fn, i64 0, i64 0), i8* %7)
%9 = tail call i32 @strcat(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %2, %5
%11 = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @parser_header_filename.fn, i64 0, i64 0), %5 ], [ null, %2 ]
ret i8* %11
}