#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 *, ...);
int strlen(char const *);
void status_line(const char *fname, int status) {
  switch (status) {
  case 1:
    status = 'F';
    break;
  case 2:
    status = 'E';
    break;
  default:
    status = 'C';
  }
  printf("%c%48s", status, " ");
  if (strlen(fname) >= 30)
    printf("%.26s...\n", fname);
  else
    printf("%s\n", fname);
}


x86 assembly (clang, -O0):
<status_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1154 <status_line+0x34>
jmp    1143 <status_line+0x23>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1160 <status_line+0x40>
jmp    116c <status_line+0x4c>
movl   $0x46,-0xc(%rbp)
jmp    1173 <status_line+0x53>
movl   $0x45,-0xc(%rbp)
jmp    1173 <status_line+0x53>
movl   $0x43,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe83(%rip),%rdi
lea    0xe83(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1e,%eax
jl     11b4 <status_line+0x94>
mov    -0x8(%rbp),%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c6 <status_line+0xa6>
mov    -0x8(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_line>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
cmp    $0x2,%esi
sete   %al
add    %eax,%eax
add    $0x43,%eax
cmp    $0x1,%esi
mov    $0x46,%esi
cmovne %eax,%esi
lea    0xead(%rip),%rdi
lea    0xead(%rip),%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x1e,%eax
jl     1180 <status_line+0x50>
lea    0xe94(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c%48s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [10 x i8] c"%.26s...\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define void @status_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %8 [
i32 1, label %6
i32 2, label %7
]
6: ; preds = %2
store i32 70, i32* %4
br label %9
7: ; preds = %2
store i32 69, i32* %4
br label %9
8: ; preds = %2
store i32 67, i32* %4
br label %9
9: ; preds = %8, %7, %6
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = load i8*, i8** %3
%13 = call i32 @strlen(i8* %12)
%14 = icmp sge i32 %13, 30
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %21
18: ; preds = %9
%19 = load i8*, i8** %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %18, %15
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%48s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [10 x i8] c"%.26s...\0A\00"
define void @status_line(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 2
%4 = select i1 %3, i32 69, i32 67
%5 = icmp eq i32 %1, 1
%6 = select i1 %5, i32 70, i32 %4
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @strlen(i8* %0)
%9 = icmp sgt i32 %8, 29
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) %0)
br label %14
14: ; preds = %12, %10
ret void
}