#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*/ create_write_byte(int);
void create_load_onesong(int *gc_song) {
  int i, length;
  ;
  create_write_byte(140);
  create_write_byte(*(gc_song++));
  length = *(gc_song);
  create_write_byte(*(gc_song++));
  for (i = 0; i < length; i++) {
    create_write_byte(*(gc_song++));
    create_write_byte(*(gc_song++));
  };
}


x86 assembly (clang, -O0):
<create_load_onesong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8c,%edi
call   1030 <create_write_byte@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <create_write_byte@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <create_write_byte@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a8 <create_load_onesong+0x98>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <create_write_byte@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <create_write_byte@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <create_load_onesong+0x52>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_load_onesong>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x8c,%edi
call   1030 <create_write_byte@plt>
mov    (%r15),%edi
call   1030 <create_write_byte@plt>
mov    0x4(%r15),%r14d
mov    %r14d,%edi
call   1030 <create_write_byte@plt>
test   %r14d,%r14d
jle    115d <create_load_onesong+0x4d>
xor    %ebx,%ebx
nopl   (%rax)
mov    0x8(%r15,%rbx,8),%edi
call   1030 <create_write_byte@plt>
mov    0xc(%r15,%rbx,8),%edi
call   1030 <create_write_byte@plt>
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1140 <create_load_onesong+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @create_load_onesong(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 @create_write_byte(i32 140)
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %2
%8 = load i32, i32* %6
%9 = call i32 @create_write_byte(i32 %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
store i32 %11, i32* %4
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %2
%14 = load i32, i32* %12
%15 = call i32 @create_write_byte(i32 %14)
store i32 0, i32* %3
br label %16
16: ; preds = %29, %1
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %32
20: ; preds = %16
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %2
%23 = load i32, i32* %21
%24 = call i32 @create_write_byte(i32 %23)
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i32 1
store i32* %26, i32** %2
%27 = load i32, i32* %25
%28 = call i32 @create_write_byte(i32 %27)
br label %29
29: ; preds = %20
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %16
32: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @create_load_onesong(i32* nocapture %0) {
%2 = tail call i32 @create_write_byte(i32 140)
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
%5 = tail call i32 @create_write_byte(i32 %4)
%6 = load i32, i32* %3
%7 = tail call i32 @create_write_byte(i32 %6)
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %20
9: ; preds = %1, %9
%10 = phi i32* [ %12, %9 ], [ %0, %1 ]
%11 = phi i32 [ %18, %9 ], [ 0, %1 ]
%12 = getelementptr inbounds i32, i32* %10, i64 2
%13 = getelementptr inbounds i32, i32* %10, i64 3
%14 = load i32, i32* %12
%15 = tail call i32 @create_write_byte(i32 %14)
%16 = load i32, i32* %13
%17 = tail call i32 @create_write_byte(i32 %16)
%18 = add nuw nsw i32 %11, 1
%19 = icmp eq i32 %18, %6
br i1 %19, label %20, label %9
20: ; preds = %9, %1
ret void
}