#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 */
typedef int uint32_t;

/* Variables and functions */
const char *fourcc_string(uint32_t fcc) {
  static char buf[5];
  buf[0] = (fcc >> 0) & 0xff;
  buf[1] = (fcc >> 8) & 0xff;
  buf[2] = (fcc >> 16) & 0xff;
  buf[3] = (fcc >> 24) & 0xff;
  buf[4] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<fourcc_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,0x2f09(%rip)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,0x2ef9(%rip)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,0x2ee9(%rip)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,0x2ed9(%rip)
movb   $0x0,0x2ed3(%rip)
lea    0x2ec8(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourcc_string>:
mov    %edi,%ecx
mov    %cl,0x2f19(%rip)
lea    0x2f12(%rip),%rax
mov    %ch,0x2f0d(%rip)
mov    %edi,%edx
shr    $0x10,%edx
mov    %dl,0x2f03(%rip)
shr    $0x18,%ecx
mov    %cl,0x2efb(%rip)
movb   $0x0,0x2ef5(%rip)
ret

LLVM IR (-O0):
@fourcc_string.buf = internal global [5 x i8] zeroinitializer
define i8* @fourcc_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i8
store i8 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 0)
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
store i8 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 1)
%11 = load i32, i32* %2
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
store i8 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 2)
%15 = load i32, i32* %2
%16 = ashr i32 %15, 24
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
store i8 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@fourcc_string.buf = internal global [5 x i8] zeroinitializer
define i8* @fourcc_string(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 0)
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 1)
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
store i8 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 2)
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_string.buf, i64 0, i64 0)
}