#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*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, int);
void quicktime_id_to_codec(char *result, int id) {
  switch (id) {
  case 0x55:
    memcpy(result, ".mp3", 4);
    break;
  case 0x161:
    memcpy(result, "WMA ", 4);
    break;
  default:
    printf("quicktime_id_to_codec: unknown audio id: %p\n", id);
    break;
  }
}


x86 assembly (clang, -O0):
<quicktime_id_to_codec>:
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    $0x55,%eax
je     1156 <quicktime_id_to_codec+0x36>
jmp    1143 <quicktime_id_to_codec+0x23>
mov    -0x10(%rbp),%eax
sub    $0x161,%eax
je     1170 <quicktime_id_to_codec+0x50>
jmp    118a <quicktime_id_to_codec+0x6a>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
jmp    1199 <quicktime_id_to_codec+0x79>
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
jmp    1199 <quicktime_id_to_codec+0x79>
mov    -0xc(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicktime_id_to_codec>:
cmp    $0x161,%esi
je     113e <quicktime_id_to_codec+0x1e>
cmp    $0x55,%esi
jne    114f <quicktime_id_to_codec+0x2f>
lea    0xecc(%rip),%rsi
mov    $0x4,%edx
jmp    1040 <memcpy@plt>
lea    0xec0(%rip),%rsi
mov    $0x4,%edx
jmp    1040 <memcpy@plt>
lea    0xeb4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".mp3\00"
@.str.1 = [5 x i8] c"WMA \00"
@.str.2 = [45 x i8] c"quicktime_id_to_codec: unknown audio id: %p\0A\00"
define void @quicktime_id_to_codec(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 %12 [
i32 85, label %6
i32 353, label %9
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @memcpy(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
br label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".mp3\00"
@.str.1 = [5 x i8] c"WMA \00"
@.str.2 = [45 x i8] c"quicktime_id_to_codec: unknown audio id: %p\0A\00"
define void @quicktime_id_to_codec(i8* %0, i32 %1) {
switch i32 %1, label %7 [
i32 85, label %3
i32 353, label %5
]
3: ; preds = %2
%4 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %9
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
br label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %1)
br label %9
9: ; preds = %7, %5, %3
ret void
}