#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_instr_signal(int data_width) {
  switch (data_width) {
  case 1:
    return 0x69;
    break;
  case 2:
    return 0x49;
    break;
  case 4:
    return 0x09;
    break;
  default:
    printf("Error: %d bit width not supported\n", data_width);
    exit(EXIT_SUCCESS);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<determine_instr_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_instr_signal+0x41>
jmp    113f <determine_instr_signal+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116a <determine_instr_signal+0x4a>
jmp    1150 <determine_instr_signal+0x30>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1173 <determine_instr_signal+0x53>
jmp    117c <determine_instr_signal+0x5c>
movb   $0x69,-0x1(%rbp)
jmp    1199 <determine_instr_signal+0x79>
movb   $0x49,-0x1(%rbp)
jmp    1199 <determine_instr_signal+0x79>
movb   $0x9,-0x1(%rbp)
jmp    1199 <determine_instr_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_instr_signal>:
cmp    $0x1,%edi
je     1134 <determine_instr_signal+0x14>
mov    %edi,%esi
cmp    $0x4,%edi
je     1137 <determine_instr_signal+0x17>
cmp    $0x2,%esi
jne    113a <determine_instr_signal+0x1a>
mov    $0x49,%al
ret
mov    $0x69,%al
ret
mov    $0x9,%al
ret
push   %rax
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%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_instr_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 105, i8* %2
br label %13
6: ; preds = %1
store i8 73, i8* %2
br label %13
7: ; preds = %1
store i8 9, 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_instr_signal(i32 %0) {
switch i32 %0, label %4 [
i32 1, label %8
i32 2, label %2
i32 4, label %3
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1, %3, %2
%9 = phi i8 [ 9, %3 ], [ 73, %2 ], [ 105, %1 ]
ret i8 %9
}