#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 CHAR_BIT;
int /*<<< orphan*/ draw_string(int, int, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ stpcpy(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void draw_score(int x, int y, int score) {
  char i_to_s[((CHAR_BIT * sizeof(int) - 1) / 3) + 2];
  char str[((CHAR_BIT * sizeof(int) - 1) / 3) + 2 + 8];
  snprintf(i_to_s, ((CHAR_BIT * sizeof(int) - 1) / 3) + 2, "%d", score);
  stpcpy(str, "Score: ");
  strcat(str, i_to_s);
  draw_string(x, y, str);
}


x86 assembly (clang, -O0):
<draw_score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2e88(%rip),%rax
mov    %rax,-0x40(%rbp)
movslq (%rax),%rax
lea    -0x1(,%rax,4),%rax
ff
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    -0x40(%rbp),%rax
mov    %rdx,%rsi
shr    %rsi
mov    %rsi,%rdx
add    $0x2,%rdx
mov    %rsp,%rdi
mov    %rdi,-0x18(%rbp)
add    $0x11,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdi
sub    %rsi,%rdi
mov    %rdi,-0x38(%rbp)
mov    %rdi,%rsp
mov    %rdx,-0x20(%rbp)
movslq (%rax),%rax
lea    -0x1(,%rax,4),%rax
ff
mul    %rcx
shr    %rdx
mov    %rdx,%rax
add    $0xa,%rax
add    $0x19,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    0x2e03(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x1,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
add    $0x2,%rax
mov    %eax,%esi
mov    -0xc(%rbp),%ecx
lea    0xdfe(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xdf1(%rip),%rsi
call   1030 <stpcpy@plt>
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdi
call   1060 <strcat@plt>
mov    -0x30(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <draw_string@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_score>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ecx
mov    0x2e8c(%rip),%rax
movslq (%rax),%rax
lea    -0x1(,%rax,4),%rax
ff
movabs $0xaaaaaaaaaaaaaaab,%rdx
aa aa aa
mul    %rdx
mov    %esi,%r14d
mov    %edi,%r15d
shr    %rdx
lea    0x11(%rdx),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
lea    0x19(%rdx),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0x2(%rdx),%esi
lea    0xe5f(%rip),%rdx
mov    %r12,%rdi
call   1040 <snprintf@plt>
lea    0xe53(%rip),%rsi
mov    %rbx,%rdi
call   1030 <stpcpy@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
mov    %r15d,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1050 <draw_string@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Score: \00"
define void @draw_score(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* @CHAR_BIT
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = sub i64 %12, 1
%14 = udiv i64 %13, 3
%15 = add i64 %14, 2
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %7
%17 = alloca i8, i64 %15
store i64 %15, i64* %8
%18 = load i32, i32* @CHAR_BIT
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 4
%21 = sub i64 %20, 1
%22 = udiv i64 %21, 3
%23 = add i64 %22, 2
%24 = add i64 %23, 8
%25 = alloca i8, i64 %24
store i64 %24, i64* %9
%26 = load i32, i32* @CHAR_BIT
%27 = sext i32 %26 to i64
%28 = mul i64 %27, 4
%29 = sub i64 %28, 1
%30 = udiv i64 %29, 3
%31 = add i64 %30, 2
%32 = trunc i64 %31 to i32
%33 = load i32, i32* %6
%34 = call i32 @snprintf(i8* %17, i32 %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = call i32 @stpcpy(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%36 = call i32 @strcat(i8* %25, i8* %17)
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = call i32 @draw_string(i32 %37, i32 %38, i8* %25)
%40 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Score: \00"
define void @draw_score(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @CHAR_BIT
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 2
%7 = add nsw i64 %6, -1
%8 = udiv i64 %7, 3
%9 = add nuw nsw i64 %8, 2
%10 = alloca i8, i64 %9
%11 = add nuw nsw i64 %8, 10
%12 = alloca i8, i64 %11
%13 = trunc i64 %8 to i32
%14 = add i32 %13, 2
%15 = call i32 @snprintf(i8* %10, i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%16 = call i32 @stpcpy(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @strcat(i8* %12, i8* %10)
%18 = call i32 @draw_string(i32 %0, i32 %1, i8* %12)
ret void
}