#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 sprintf(char *, char *, unsigned int const, unsigned int const,
            unsigned int const, unsigned int const, unsigned int const,
            unsigned int const, unsigned int const, unsigned int const,
            unsigned int const);
int format_drawbars(const unsigned int drawbars[], char *buf) {
  return sprintf(buf, "%c%c%c %c%c%c%c %c%c", '0' + drawbars[0],
                 '0' + drawbars[1], '0' + drawbars[2], '0' + drawbars[3],
                 '0' + drawbars[4], '0' + drawbars[5], '0' + drawbars[6],
                 '0' + drawbars[7], '0' + drawbars[8]);
}


x86 assembly (clang, -O0):
<format_drawbars>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
add    $0x30,%edx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x30,%ecx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r8d
add    $0x30,%r8d
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%r9d
add    $0x30,%r9d
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%r14d
add    $0x30,%r14d
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%ebx
add    $0x30,%ebx
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%r11d
add    $0x30,%r11d
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%r10d
add    $0x30,%r10d
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%eax
add    $0x30,%eax
lea    0xe6f(%rip),%rsi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <sprintf@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_drawbars>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r10
mov    (%rdi),%edx
mov    0x4(%rdi),%ecx
add    $0x30,%edx
add    $0x30,%ecx
mov    0x8(%rdi),%r8d
add    $0x30,%r8d
mov    0xc(%rdi),%r9d
add    $0x30,%r9d
mov    0x10(%rdi),%r11d
add    $0x30,%r11d
mov    0x14(%rdi),%r14d
add    $0x30,%r14d
mov    0x18(%rdi),%r15d
add    $0x30,%r15d
mov    0x1c(%rdi),%eax
add    $0x30,%eax
mov    0x20(%rdi),%ebx
add    $0x30,%ebx
sub    $0x8,%rsp
lea    0xe9e(%rip),%rsi
mov    %r10,%rdi
push   %rbx
push   %rax
push   %r15
push   %r14
push   %r11
call   1030 <sprintf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%c%c%c %c%c%c%c %c%c\00"
define i32 @format_drawbars(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = add i32 48, %8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = add i32 48, %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = add i32 48, %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = add i32 48, %20
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 4
%24 = load i32, i32* %23
%25 = add i32 48, %24
%26 = load i32*, i32** %3
%27 = getelementptr inbounds i32, i32* %26, i64 5
%28 = load i32, i32* %27
%29 = add i32 48, %28
%30 = load i32*, i32** %3
%31 = getelementptr inbounds i32, i32* %30, i64 6
%32 = load i32, i32* %31
%33 = add i32 48, %32
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 7
%36 = load i32, i32* %35
%37 = add i32 48, %36
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i64 8
%40 = load i32, i32* %39
%41 = add i32 48, %40
%42 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13, i32 %17, i32 %21, i32 %25, i32 %29, i32 %33, i32 %37, i32 %41)
ret i32 %42
}

LLVM IR (-O2):
@.str = [21 x i8] c"%c%c%c %c%c%c%c %c%c\00"
define i32 @format_drawbars(i32* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 48
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = add i32 %6, 48
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = add i32 %9, 48
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = add i32 %12, 48
%14 = getelementptr inbounds i32, i32* %0, i64 4
%15 = load i32, i32* %14
%16 = add i32 %15, 48
%17 = getelementptr inbounds i32, i32* %0, i64 5
%18 = load i32, i32* %17
%19 = add i32 %18, 48
%20 = getelementptr inbounds i32, i32* %0, i64 6
%21 = load i32, i32* %20
%22 = add i32 %21, 48
%23 = getelementptr inbounds i32, i32* %0, i64 7
%24 = load i32, i32* %23
%25 = add i32 %24, 48
%26 = getelementptr inbounds i32, i32* %0, i64 8
%27 = load i32, i32* %26
%28 = add i32 %27, 48
%29 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %13, i32 %16, i32 %19, i32 %22, i32 %25, i32 %28)
ret i32 %29
}