#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 */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ find_func_called_before_string_ref(char *);
void *disp_init_autodetect() {
  uint32_t a = find_func_called_before_string_ref("Other models\n");
  uint32_t b = find_func_called_before_string_ref("File(*.fir) not found\n");
  uint32_t c =
      find_func_called_before_string_ref("sum check error or code modify\n");
  if (a == b) {
    return (void *)a;
  }
  if (a == c) {
    return (void *)a;
  }
  return 0;
}


x86 assembly (clang, -O0):
<disp_init_autodetect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
call   1030 <find_func_called_before_string_ref@plt>
mov    %rax,-0x10(%rbp)
lea    0xedf(%rip),%rdi
call   1030 <find_func_called_before_string_ref@plt>
mov    %rax,-0x18(%rbp)
lea    0xee6(%rip),%rdi
call   1030 <find_func_called_before_string_ref@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1163 <disp_init_autodetect+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <disp_init_autodetect+0x76>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    117e <disp_init_autodetect+0x6e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <disp_init_autodetect+0x76>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_init_autodetect>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <find_func_called_before_string_ref@plt>
mov    %rax,%rbx
lea    0xee4(%rip),%rdi
call   1030 <find_func_called_before_string_ref@plt>
mov    %rax,%r14
lea    0xeec(%rip),%rdi
call   1030 <find_func_called_before_string_ref@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
cmove  %rbx,%rcx
cmp    %r14,%rbx
cmove  %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Other models\0A\00"
@.str.1 = [23 x i8] c"File(*.fir) not found\0A\00"
@.str.2 = [32 x i8] c"sum check error or code modify\0A\00"
define i8* @disp_init_autodetect() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = call i64 @find_func_called_before_string_ref(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i64 %5, i64* %2
%6 = call i64 @find_func_called_before_string_ref(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i64 %6, i64* %3
%7 = call i64 @find_func_called_before_string_ref(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
store i64 %7, i64* %4
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i64, i64* %2
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %1
br label %22
14: ; preds = %0
%15 = load i64, i64* %2
%16 = load i64, i64* %4
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i64, i64* %2
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %1
br label %22
21: ; preds = %14
store i8* null, i8** %1
br label %22
22: ; preds = %21, %18, %11
%23 = load i8*, i8** %1
ret i8* %23
}

LLVM IR (-O2):
@.str = [14 x i8] c"Other models\0A\00"
@.str.1 = [23 x i8] c"File(*.fir) not found\0A\00"
@.str.2 = [32 x i8] c"sum check error or code modify\0A\00"
define i8* @disp_init_autodetect() {
%1 = tail call i64 @find_func_called_before_string_ref(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @find_func_called_before_string_ref(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @find_func_called_before_string_ref(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i64 %1, %2
%5 = inttoptr i64 %1 to i8*
%6 = icmp eq i64 %1, %3
%7 = select i1 %4, i1 true, i1 %6
%8 = select i1 %7, i8* %5, i8* null
ret i8* %8
}