#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*/ clear_lines(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ draw_string(int, int, ...);
int /*<<< orphan*/ uint_to_string(unsigned int, unsigned char *);
void draw_progress(unsigned int current, unsigned int total) {
  unsigned char current_string[9];
  unsigned char total_string[9];
  uint_to_string(total, total_string);
  uint_to_string(current, current_string);
  clear_lines(120, 24, 0);
  draw_string(0, 120, "(", 0xffff);
  draw_string(12, 120, current_string, 0xffff);
  draw_string(108, 120, "/", 0xffff);
  draw_string(120, 120, total_string, 0xffff);
  draw_string(216, 120, ")", 0xffff);
}


x86 assembly (clang, -O0):
<draw_progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1a(%rbp),%rsi
call   1030 <uint_to_string@plt>
mov    -0x4(%rbp),%edi
lea    -0x11(%rbp),%rsi
call   1030 <uint_to_string@plt>
mov    $0x78,%edi
mov    $0x18,%esi
xor    %edx,%edx
call   1050 <clear_lines@plt>
xor    %edi,%edi
mov    $0x78,%esi
lea    0xe8b(%rip),%rdx
mov    $0xffff,%ecx
mov    $0x0,%al
call   1040 <draw_string@plt>
lea    -0x11(%rbp),%rdx
mov    $0xc,%edi
mov    $0x78,%esi
mov    $0xffff,%ecx
mov    $0x0,%al
call   1040 <draw_string@plt>
mov    $0x6c,%edi
mov    $0x78,%esi
lea    0xe56(%rip),%rdx
mov    $0xffff,%ecx
mov    $0x0,%al
call   1040 <draw_string@plt>
lea    -0x1a(%rbp),%rdx
mov    $0x78,%esi
mov    $0xffff,%ecx
mov    %esi,%edi
mov    $0x0,%al
call   1040 <draw_string@plt>
mov    $0xd8,%edi
mov    $0x78,%esi
lea    0xe24(%rip),%rdx
mov    $0xffff,%ecx
mov    $0x0,%al
call   1040 <draw_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_progress>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebp
lea    0xe(%rsp),%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <uint_to_string@plt>
lea    0x17(%rsp),%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <uint_to_string@plt>
mov    $0x78,%edi
mov    $0x18,%esi
xor    %edx,%edx
call   1050 <clear_lines@plt>
lea    0xe90(%rip),%rdx
xor    %edi,%edi
mov    $0x78,%esi
mov    $0xffff,%ecx
xor    %eax,%eax
call   1040 <draw_string@plt>
mov    $0xc,%edi
mov    $0x78,%esi
mov    %rbx,%rdx
mov    $0xffff,%ecx
xor    %eax,%eax
call   1040 <draw_string@plt>
lea    0xe5f(%rip),%rdx
mov    $0x6c,%edi
mov    $0x78,%esi
mov    $0xffff,%ecx
xor    %eax,%eax
call   1040 <draw_string@plt>
mov    $0x78,%edi
mov    $0x78,%esi
mov    %r14,%rdx
mov    $0xffff,%ecx
xor    %eax,%eax
call   1040 <draw_string@plt>
lea    0xe2b(%rip),%rdx
mov    $0xd8,%edi
mov    $0x78,%esi
mov    $0xffff,%ecx
xor    %eax,%eax
call   1040 <draw_string@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c")\00"
define void @draw_progress(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [9 x i8]
%6 = alloca [9 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%9 = call i32 @uint_to_string(i32 %7, i8* %8)
%10 = load i32, i32* %3
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%12 = call i32 @uint_to_string(i32 %10, i8* %11)
%13 = call i32 @clear_lines(i32 120, i32 24, i32 0)
%14 = call i32 (i32, i32, ...) @draw_string(i32 0, i32 120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 65535)
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%16 = call i32 (i32, i32, ...) @draw_string(i32 12, i32 120, i8* %15, i32 65535)
%17 = call i32 (i32, i32, ...) @draw_string(i32 108, i32 120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 65535)
%18 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%19 = call i32 (i32, i32, ...) @draw_string(i32 120, i32 120, i8* %18, i32 65535)
%20 = call i32 (i32, i32, ...) @draw_string(i32 216, i32 120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 65535)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c")\00"
define void @draw_progress(i32 %0, i32 %1) {
%3 = alloca [9 x i8]
%4 = alloca [9 x i8]
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%7 = call i32 @uint_to_string(i32 %1, i8* %6)
%8 = call i32 @uint_to_string(i32 %0, i8* %5)
%9 = call i32 @clear_lines(i32 120, i32 24, i32 0)
%10 = call i32 (i32, i32, ...) @draw_string(i32 0, i32 120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 65535)
%11 = call i32 (i32, i32, ...) @draw_string(i32 12, i32 120, i8* %5, i32 65535)
%12 = call i32 (i32, i32, ...) @draw_string(i32 108, i32 120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 65535)
%13 = call i32 (i32, i32, ...) @draw_string(i32 120, i32 120, i8* %6, i32 65535)
%14 = call i32 (i32, i32, ...) @draw_string(i32 216, i32 120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 65535)
ret void
}