#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 */
char *left_align_string(char *, int);
int /*<<< orphan*/ printf(char *, ...);
char *right_align_string(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
void print_continent_and_value(char *continent_name, int value) {
  char *str = left_align_string(continent_name, 30);
  char value_str[5];
  sprintf(value_str, "%d", value);
  strcat(value_str, "%");
  printf("\x1B[33m"
         "%s"
         "\033[m",
         str);
  printf("\t");
  printf("\x1B[36m"
         "%s"
         "\033[m",
         right_align_string((char *)value_str, 5));
  printf("\n");
}


x86 assembly (clang, -O0):
<print_continent_and_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1e,%esi
call   1050 <left_align_string@plt>
mov    %rax,-0x18(%rbp)
lea    -0x1d(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe81(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x1d(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1d(%rbp),%rdi
mov    $0x5,%esi
call   1030 <right_align_string@plt>
mov    %rax,%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_continent_and_value>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    $0x1e,%esi
call   1060 <left_align_string@plt>
mov    %rax,%r14
lea    0xe81(%rip),%rsi
lea    0xb(%rsp),%r15
mov    %r15,%rdi
mov    %ebx,%edx
call   1080 <sprintf@plt>
lea    0xe6e(%rip),%rsi
mov    %r15,%rdi
call   1070 <strcat@plt>
lea    0xe61(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x5,%esi
call   1040 <right_align_string@plt>
lea    0xe44(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"%\00"
@.str.2 = [11 x i8] c"\1B[33m%s\1B[m\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [11 x i8] c"\1B[36m%s\1B[m\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @print_continent_and_value(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [5 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i8* @left_align_string(i8* %7, i32 30)
store i8* %8, i8** %5
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%18 = call i8* @right_align_string(i8* %17, i32 5)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"%\00"
@.str.2 = [11 x i8] c"\1B[33m%s\1B[m\00"
@.str.4 = [11 x i8] c"\1B[36m%s\1B[m\00"
define void @print_continent_and_value(i8* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = tail call i8* @left_align_string(i8* %0, i32 30)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%9 = call i32 @putchar(i32 9)
%10 = call i8* @right_align_string(i8* %5, i32 5)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%12 = call i32 @putchar(i32 10)
ret void
}