#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*/ strcpy(void *, char *);
void check_ss_codes(int strmsgid, void *bufadr, void *smsg) {
  switch (strmsgid) {
  case 0x000C:
    strcpy(bufadr, "Access Violation");
    break;
  case 0x047C:
    strcpy(bufadr, "Integer Overflow");
    break;
  case 0x0484:
    strcpy(bufadr, "Integer Divide By Zero");
    break;
  }
  return;
}


x86 assembly (clang, -O0):
<check_ss_codes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xc,%eax
je     115d <check_ss_codes+0x4d>
jmp    1137 <check_ss_codes+0x27>
mov    -0x1c(%rbp),%eax
sub    $0x47c,%eax
je     1172 <check_ss_codes+0x62>
jmp    114a <check_ss_codes+0x3a>
mov    -0x1c(%rbp),%eax
sub    $0x484,%eax
je     1187 <check_ss_codes+0x77>
jmp    1197 <check_ss_codes+0x87>
mov    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1197 <check_ss_codes+0x87>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1197 <check_ss_codes+0x87>
mov    -0x10(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ss_codes>:
cmp    $0xc,%edi
je     112e <check_ss_codes+0x1e>
cmp    $0x484,%edi
je     1137 <check_ss_codes+0x27>
cmp    $0x47c,%edi
jne    1149 <check_ss_codes+0x39>
lea    0xee5(%rip),%rax
jmp    113e <check_ss_codes+0x2e>
lea    0xecb(%rip),%rax
jmp    113e <check_ss_codes+0x2e>
lea    0xee4(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <strcpy@plt>
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Access Violation\00"
@.str.1 = [17 x i8] c"Integer Overflow\00"
@.str.2 = [23 x i8] c"Integer Divide By Zero\00"
define void @check_ss_codes(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %17 [
i32 12, label %8
i32 1148, label %11
i32 1156, label %14
]
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %17
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %17
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %3, %14, %11, %8
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Access Violation\00"
@.str.1 = [17 x i8] c"Integer Overflow\00"
@.str.2 = [23 x i8] c"Integer Divide By Zero\00"
define void @check_ss_codes(i32 %0, i8* %1, i8* nocapture readnone %2) {
switch i32 %0, label %9 [
i32 12, label %6
i32 1148, label %4
i32 1156, label %5
]
4: ; preds = %3
br label %6
5: ; preds = %3
br label %6
6: ; preds = %3, %4, %5
%7 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %3 ]
%8 = tail call i32 @strcpy(i8* %1, i8* %7)
br label %9
9: ; preds = %6, %3
ret void
}