#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*/ exit(int);
int /*<<< orphan*/ print_path(char *, char *);
int /*<<< orphan*/ printf(char *);
void print_status_array(int count, char **duplicates, int *status) {
  for (int i = 0; i < count; i++) {
    switch (status[i]) {
    case 1:
      print_path("             DUP: ", duplicates[i]);
      break;
    case 3:
      print_path("             HL : ", duplicates[i]);
      break;
    case 2:
      print_path("             xxx: ", duplicates[i]);
      break;
    case 0:
      print_path("             ---: ", duplicates[i]);
      break;
    default:
      printf("error: file_callback: unknown status\n");
      exit(1);
    }
  }
}


x86 assembly (clang, -O0):
<print_status_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1220 <print_status_array+0xf0>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %rax,-0x28(%rbp)
sub    $0x3,%rax
ja     11f7 <print_status_array+0xc7>
mov    -0x28(%rbp),%rax
lea    0xe86(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe7a(%rip),%rdi
call   1040 <print_path@plt>
jmp    120d <print_status_array+0xdd>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe70(%rip),%rdi
call   1040 <print_path@plt>
jmp    120d <print_status_array+0xdd>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe66(%rip),%rdi
call   1040 <print_path@plt>
jmp    120d <print_status_array+0xdd>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe5c(%rip),%rdi
call   1040 <print_path@plt>
jmp    120d <print_status_array+0xdd>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1212 <print_status_array+0xe2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114a <print_status_array+0x1a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status_array>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
jle    1174 <print_status_array+0x44>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xf25(%rip),%r13
nop
movslq (%r14,%rbx,4),%rax
cmp    $0x4,%rax
jae    117e <print_status_array+0x4e>
movslq 0x0(%r13,%rax,4),%rdi
add    %r13,%rdi
mov    (%r15,%rbx,8),%rsi
call   1040 <print_path@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <print_status_array+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c" DUP: \00"
@.str.1 = [19 x i8] c" HL : \00"
@.str.2 = [19 x i8] c" xxx: \00"
@.str.3 = [19 x i8] c" ---: \00"
@.str.4 = [38 x i8] c"error: file_callback: unknown status\0A\00"
define void @print_status_array(i32 %0, i8** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
store i32 0, i32* %7
br label %8
8: ; preds = %50, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %53
12: ; preds = %8
%13 = load i32*, i32** %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
switch i32 %17, label %46 [
i32 1, label %18
i32 3, label %25
i32 2, label %32
i32 0, label %39
]
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @print_path(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %23)
br label %49
25: ; preds = %12
%26 = load i8**, i8*** %5
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 @print_path(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %30)
br label %49
32: ; preds = %12
%33 = load i8**, i8*** %5
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i32 @print_path(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %37)
br label %49
39: ; preds = %12
%40 = load i8**, i8*** %5
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = call i32 @print_path(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %44)
br label %49
46: ; preds = %12
%47 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %39, %32, %25, %18
br label %50
50: ; preds = %49
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %8
53: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c" DUP: \00"
@.str.1 = [19 x i8] c" HL : \00"
@.str.2 = [19 x i8] c" xxx: \00"
@.str.3 = [19 x i8] c" ---: \00"
@str = [37 x i8] c"error: file_callback: unknown status\00"
@reltable.print_status_array = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.print_status_array to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.print_status_array to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.print_status_array to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.print_status_array to i64)) to i32)]
define void @print_status_array(i32 %0, i8** nocapture %1, i32* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %8
7: ; preds = %16, %3
ret void
8: ; preds = %5, %16
%9 = phi i64 [ 0, %5 ], [ %23, %16 ]
%10 = getelementptr inbounds i32, i32* %2, i64 %9
%11 = load i32, i32* %10
%12 = icmp ult i32 %11, 4
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %8
%17 = sext i32 %11 to i64
%18 = shl i64 %17, 2
%19 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.print_status_array to i8*), i64 %18)
%20 = getelementptr inbounds i8*, i8** %1, i64 %9
%21 = load i8*, i8** %20
%22 = tail call i32 @print_path(i8* %19, i8* %21)
%23 = add nuw nsw i64 %9, 1
%24 = icmp eq i64 %23, %6
br i1 %24, label %7, label %8
}