#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 */
#define EFAULT 133
#define ENOENT 132
#define ENOSYS 131
#define ENOTBLK 130
#define EPERM 129
#define ESRCH 128
int /*<<< orphan*/ assert(int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void print_quotactl_error(const char *msg) {
  assert(NULL != msg);
  switch (errno) {
  case EFAULT:
    fprintf(stderr, "%s: Block device invalid.\n", msg);
    break;
  case ENOENT:
    fprintf(stderr, "%s: Block device doesn't exist.\n", msg);
    break;
  case ENOSYS:
    fprintf(stderr, "%s: Kernel doesn't haven quota support.\n", msg);
    break;
  case ENOTBLK:
    fprintf(stderr, "%s: Not a block device.\n", msg);
    break;
  case EPERM:
    fprintf(stderr, "%s: Insufficient privilege.\n", msg);
    break;
  case ESRCH:
    fprintf(stderr, "%s: No quota for supplied user.\n", msg);
    break;
  default:
    perror(msg);
    break;
  }
}


x86 assembly (clang, -O0):
<print_quotactl_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
test   %rax,%rax
setne  %al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1231 <print_quotactl_error+0x101>
mov    -0x10(%rbp),%rax
lea    0xe8c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
jmp    123a <print_quotactl_error+0x10a>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
jmp    123a <print_quotactl_error+0x10a>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
jmp    123a <print_quotactl_error+0x10a>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
jmp    123a <print_quotactl_error+0x10a>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
jmp    123a <print_quotactl_error+0x10a>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
jmp    123a <print_quotactl_error+0x10a>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_quotactl_error>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
cmp    $0x5,%eax
ja     11da <print_quotactl_error+0xaa>
lea    0xea2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xf3c(%rip),%rsi
jmp    11d1 <print_quotactl_error+0xa1>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xf0d(%rip),%rsi
jmp    11d1 <print_quotactl_error+0xa1>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
lea    0xee2(%rip),%rsi
jmp    11d1 <print_quotactl_error+0xa1>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
jmp    11d1 <print_quotactl_error+0xa1>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
jmp    11d1 <print_quotactl_error+0xa1>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xe47(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"%s: Block device invalid.\0A\00"
@.str.1 = [33 x i8] c"%s: Block device doesn't exist.\0A\00"
@.str.2 = [41 x i8] c"%s: Kernel doesn't haven quota support.\0A\00"
@.str.3 = [25 x i8] c"%s: Not a block device.\0A\00"
@.str.4 = [29 x i8] c"%s: Insufficient privilege.\0A\00"
@.str.5 = [33 x i8] c"%s: No quota for supplied user.\0A\00"
define void @print_quotactl_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* @errno
switch i32 %7, label %32 [
i32 133, label %8
i32 132, label %12
i32 131, label %16
i32 130, label %20
i32 129, label %24
i32 128, label %28
]
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %35
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %2
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %35
16: ; preds = %1
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %2
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %35
20: ; preds = %1
%21 = load i32, i32* @stderr
%22 = load i8*, i8** %2
%23 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %35
24: ; preds = %1
%25 = load i32, i32* @stderr
%26 = load i8*, i8** %2
%27 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %26)
br label %35
28: ; preds = %1
%29 = load i32, i32* @stderr
%30 = load i8*, i8** %2
%31 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %30)
br label %35
32: ; preds = %1
%33 = load i8*, i8** %2
%34 = call i32 @perror(i8* %33)
br label %35
35: ; preds = %32, %28, %24, %20, %16, %12, %8
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"%s: Block device invalid.\0A\00"
@.str.1 = [33 x i8] c"%s: Block device doesn't exist.\0A\00"
@.str.2 = [41 x i8] c"%s: Kernel doesn't haven quota support.\0A\00"
@.str.3 = [25 x i8] c"%s: Not a block device.\0A\00"
@.str.4 = [29 x i8] c"%s: Insufficient privilege.\0A\00"
@.str.5 = [33 x i8] c"%s: No quota for supplied user.\0A\00"
define void @print_quotactl_error(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @errno
switch i32 %5, label %24 [
i32 133, label %6
i32 132, label %9
i32 131, label %12
i32 130, label %15
i32 129, label %18
i32 128, label %21
]
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %26
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %26
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %26
15: ; preds = %1
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %26
18: ; preds = %1
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %0)
br label %26
21: ; preds = %1
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %0)
br label %26
24: ; preds = %1
%25 = tail call i32 @perror(i8* %0)
br label %26
26: ; preds = %24, %21, %18, %15, %12, %9, %6
ret void
}