#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 */
int create_palette(uint32_t palet[]) {
  int i;
  int k = 0;
  int r = 0, g = 0, b = 0;
  for (i = 0; i < 15; i++) {
    palet[k++] = (r << 20) + (g << 12) + ((b / 4) << 4);
    r++;
  }
  for (i = 0; i < 15; i++) {
    palet[k++] = (r << 20) + (g << 12) + (b << 4);
    g++;
  }
  for (i = 0; i < 15; i++) {
    palet[k++] = (r << 20) + (g << 12) + (b << 4);
    b++;
  }
  for (i = 0; i < 30; i++) {
    palet[k++] = (r << 20) + (g << 12) + (b << 4);
  }
  return k;
}


x86 assembly (clang, -O0):
<create_palette>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jge    1185 <create_palette+0x85>
mov    -0x14(%rbp),%eax
shl    $0x14,%eax
mov    -0x18(%rbp),%ecx
shl    $0xc,%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%edx
shl    $0x4,%eax
add    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <create_palette+0x2b>
movl   $0x0,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jge    11d8 <create_palette+0xd8>
mov    -0x14(%rbp),%edx
shl    $0x14,%edx
mov    -0x18(%rbp),%eax
shl    $0xc,%eax
add    %eax,%edx
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
add    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118c <create_palette+0x8c>
movl   $0x0,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jge    122b <create_palette+0x12b>
mov    -0x14(%rbp),%edx
shl    $0x14,%edx
mov    -0x18(%rbp),%eax
shl    $0xc,%eax
add    %eax,%edx
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
add    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <create_palette+0xdf>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jge    1275 <create_palette+0x175>
mov    -0x14(%rbp),%edx
shl    $0x14,%edx
mov    -0x18(%rbp),%eax
shl    $0xc,%eax
add    %eax,%edx
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
add    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1232 <create_palette+0x132>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_palette>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movaps 0xf09(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movaps 0xf0e(%rip),%xmm0
movups %xmm0,0x40(%rdi)
movaps 0xf13(%rip),%xmm0
movups %xmm0,0x50(%rdi)
movaps 0xf18(%rip),%xmm0
movups %xmm0,0x60(%rdi)
movaps 0xf1d(%rip),%xmm0
movups %xmm0,0x70(%rdi)
movaps 0xf22(%rip),%xmm0
movups %xmm0,0x80(%rdi)
movaps 0xf24(%rip),%xmm0
movups %xmm0,0x90(%rdi)
movaps 0xf26(%rip),%xmm0
movups %xmm0,0xa0(%rdi)
movaps 0xf28(%rip),%xmm0
movups %xmm0,0xb0(%rdi)
movaps 0xf2a(%rip),%xmm0
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xf0(%rdi)
movups %xmm0,0x100(%rdi)
movups %xmm0,0x110(%rdi)
movabs $0xf0f0f000f0f0f0,%rax
mov    %rax,0x120(%rdi)
movl   $0xf0f0f0,0x128(%rdi)
mov    $0x4b,%eax
ret

LLVM IR (-O0):
define i32 @create_palette(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %3
br label %8
8: ; preds = %28, %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 15
br i1 %10, label %11, label %31
11: ; preds = %8
%12 = load i32, i32* %5
%13 = shl i32 %12, 20
%14 = load i32, i32* %6
%15 = shl i32 %14, 12
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %7
%18 = sdiv i32 %17, 4
%19 = shl i32 %18, 4
%20 = add nsw i32 %16, %19
%21 = load i32*, i32** %2
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
%24 = sext i32 %22 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
store i32 %20, i32* %25
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %28
28: ; preds = %11
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %8
31: ; preds = %8
store i32 0, i32* %3
br label %32
32: ; preds = %51, %31
%33 = load i32, i32* %3
%34 = icmp slt i32 %33, 15
br i1 %34, label %35, label %54
35: ; preds = %32
%36 = load i32, i32* %5
%37 = shl i32 %36, 20
%38 = load i32, i32* %6
%39 = shl i32 %38, 12
%40 = add nsw i32 %37, %39
%41 = load i32, i32* %7
%42 = shl i32 %41, 4
%43 = add nsw i32 %40, %42
%44 = load i32*, i32** %2
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
%47 = sext i32 %45 to i64
%48 = getelementptr inbounds i32, i32* %44, i64 %47
store i32 %43, i32* %48
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %51
51: ; preds = %35
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %32
54: ; preds = %32
store i32 0, i32* %3
br label %55
55: ; preds = %74, %54
%56 = load i32, i32* %3
%57 = icmp slt i32 %56, 15
br i1 %57, label %58, label %77
58: ; preds = %55
%59 = load i32, i32* %5
%60 = shl i32 %59, 20
%61 = load i32, i32* %6
%62 = shl i32 %61, 12
%63 = add nsw i32 %60, %62
%64 = load i32, i32* %7
%65 = shl i32 %64, 4
%66 = add nsw i32 %63, %65
%67 = load i32*, i32** %2
%68 = load i32, i32* %4
%69 = add nsw i32 %68, 1
store i32 %69, i32* %4
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds i32, i32* %67, i64 %70
store i32 %66, i32* %71
%72 = load i32, i32* %7
%73 = add nsw i32 %72, 1
store i32 %73, i32* %7
br label %74
74: ; preds = %58
%75 = load i32, i32* %3
%76 = add nsw i32 %75, 1
store i32 %76, i32* %3
br label %55
77: ; preds = %55
store i32 0, i32* %3
br label %78
78: ; preds = %95, %77
%79 = load i32, i32* %3
%80 = icmp slt i32 %79, 30
br i1 %80, label %81, label %98
81: ; preds = %78
%82 = load i32, i32* %5
%83 = shl i32 %82, 20
%84 = load i32, i32* %6
%85 = shl i32 %84, 12
%86 = add nsw i32 %83, %85
%87 = load i32, i32* %7
%88 = shl i32 %87, 4
%89 = add nsw i32 %86, %88
%90 = load i32*, i32** %2
%91 = load i32, i32* %4
%92 = add nsw i32 %91, 1
store i32 %92, i32* %4
%93 = sext i32 %91 to i64
%94 = getelementptr inbounds i32, i32* %90, i64 %93
store i32 %89, i32* %94
br label %95
95: ; preds = %81
%96 = load i32, i32* %3
%97 = add nsw i32 %96, 1
store i32 %97, i32* %3
br label %78
98: ; preds = %78
%99 = load i32, i32* %4
ret i32 %99
}

LLVM IR (-O2):
define i32 @create_palette(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 1048576, i32 2097152, i32 3145728>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 4194304, i32 5242880, i32 6291456, i32 7340032>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 8388608, i32 9437184, i32 10485760, i32 11534336>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 12582912, i32 13631488, i32 14680064, i32 15728640>, <4 x i32>* %8
%9 = getelementptr inbounds i32, i32* %0, i64 16
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 15732736, i32 15736832, i32 15740928, i32 15745024>, <4 x i32>* %10
%11 = getelementptr inbounds i32, i32* %0, i64 20
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 15749120, i32 15753216, i32 15757312, i32 15761408>, <4 x i32>* %12
%13 = getelementptr inbounds i32, i32* %0, i64 24
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 15765504, i32 15769600, i32 15773696, i32 15777792>, <4 x i32>* %14
%15 = getelementptr inbounds i32, i32* %0, i64 28
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 15781888, i32 15785984, i32 15790080, i32 15790096>, <4 x i32>* %16
%17 = getelementptr inbounds i32, i32* %0, i64 32
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 15790112, i32 15790128, i32 15790144, i32 15790160>, <4 x i32>* %18
%19 = getelementptr inbounds i32, i32* %0, i64 36
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 15790176, i32 15790192, i32 15790208, i32 15790224>, <4 x i32>* %20
%21 = getelementptr inbounds i32, i32* %0, i64 40
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 15790240, i32 15790256, i32 15790272, i32 15790288>, <4 x i32>* %22
%23 = getelementptr inbounds i32, i32* %0, i64 44
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> <i32 15790304, i32 15790320, i32 15790320, i32 15790320>, <4 x i32>* %24
%25 = getelementptr inbounds i32, i32* %0, i64 48
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 15790320, i32 15790320, i32 15790320, i32 15790320>, <4 x i32>* %26
%27 = getelementptr inbounds i32, i32* %0, i64 52
%28 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> <i32 15790320, i32 15790320, i32 15790320, i32 15790320>, <4 x i32>* %28
%29 = getelementptr inbounds i32, i32* %0, i64 56
%30 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> <i32 15790320, i32 15790320, i32 15790320, i32 15790320>, <4 x i32>* %30
%31 = getelementptr inbounds i32, i32* %0, i64 60
%32 = bitcast i32* %31 to <4 x i32>*
store <4 x i32> <i32 15790320, i32 15790320, i32 15790320, i32 15790320>, <4 x i32>* %32
%33 = getelementptr inbounds i32, i32* %0, i64 64
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> <i32 15790320, i32 15790320, i32 15790320, i32 15790320>, <4 x i32>* %34
%35 = getelementptr inbounds i32, i32* %0, i64 68
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> <i32 15790320, i32 15790320, i32 15790320, i32 15790320>, <4 x i32>* %36
%37 = getelementptr inbounds i32, i32* %0, i64 72
store i32 15790320, i32* %37
%38 = getelementptr inbounds i32, i32* %0, i64 73
store i32 15790320, i32* %38
%39 = getelementptr inbounds i32, i32* %0, i64 74
store i32 15790320, i32* %39
ret i32 75
}