#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_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
char determine_addr_signal(int data_width) {
  switch (data_width) {
  case 1:
    return 0x01;
    break;
  case 2:
    return 0x01;
    break;
  case 4:
    return 0x01;
    break;
  default:
    printf("Error: %d bit width not supported\n", data_width);
    exit(EXIT_SUCCESS);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<determine_addr_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1161 <determine_addr_signal+0x41>
jmp    113f <determine_addr_signal+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116a <determine_addr_signal+0x4a>
jmp    1150 <determine_addr_signal+0x30>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1173 <determine_addr_signal+0x53>
jmp    117c <determine_addr_signal+0x5c>
movb   $0x1,-0x1(%rbp)
jmp    1199 <determine_addr_signal+0x79>
movb   $0x1,-0x1(%rbp)
jmp    1199 <determine_addr_signal+0x79>
movb   $0x1,-0x1(%rbp)
jmp    1199 <determine_addr_signal+0x79>
mov    -0x8(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determine_addr_signal>:
mov    %edi,%esi
lea    -0x1(%rsi),%eax
cmp    $0x2,%eax
jb     112f <determine_addr_signal+0xf>
cmp    $0x4,%esi
jne    1132 <determine_addr_signal+0x12>
mov    $0x1,%al
ret
push   %rax
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Error: %d bit width not supported\0A\00"
@EXIT_SUCCESS = global i32 0
define signext i8 @determine_addr_signal(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 4, label %7
]
5: ; preds = %1
store i8 1, i8* %2
br label %13
6: ; preds = %1
store i8 1, i8* %2
br label %13
7: ; preds = %1
store i8 1, i8* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %7, %6, %5
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"Error: %d bit width not supported\0A\00"
@EXIT_SUCCESS = global i32 0
define signext i8 @determine_addr_signal(i32 %0) {
switch i32 %0, label %2 [
i32 1, label %6
i32 2, label %6
i32 4, label %6
]
2: ; preds = %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %1, %1, %1
ret i8 1
}