#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*/ f(char, char *);
int /*<<< orphan*/ putstring(char *);
int main(void) {
  char t[2];
  int b;
  b = 10;
  t[1] = 0;
  while (b) {
    f(48 + b - 1, t);
    putstring(t);
    b = b - 1;
  }
  f('\n', t);
  putstring(t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
movb   $0x0,-0x5(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1170 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
sub    $0x1,%eax
lea    -0x6(%rbp),%rsi
movsbl %al,%edi
call   1030 <f@plt>
lea    -0x6(%rbp),%rdi
call   1040 <putstring@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x1a>
lea    -0x6(%rbp),%rsi
mov    $0xa,%edi
call   1030 <f@plt>
lea    -0x6(%rbp),%rdi
call   1040 <putstring@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xe(%rsp),%rbx
mov    $0x39,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x38,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x37,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x36,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x35,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x34,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x33,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x32,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x31,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0x30,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <putstring@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 48, %9
%11 = sub nsw i32 %10, 1
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%14 = call i32 @f(i8 signext %12, i8* %13)
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%16 = call i32 @putstring(i8* %15)
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%21 = call i32 @f(i8 signext 10, i8* %20)
%22 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%23 = call i32 @putstring(i8* %22)
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 0, i8* %3
%4 = call i32 @f(i8 signext 57, i8* %2)
%5 = call i32 @putstring(i8* %2)
%6 = call i32 @f(i8 signext 56, i8* %2)
%7 = call i32 @putstring(i8* %2)
%8 = call i32 @f(i8 signext 55, i8* %2)
%9 = call i32 @putstring(i8* %2)
%10 = call i32 @f(i8 signext 54, i8* %2)
%11 = call i32 @putstring(i8* %2)
%12 = call i32 @f(i8 signext 53, i8* %2)
%13 = call i32 @putstring(i8* %2)
%14 = call i32 @f(i8 signext 52, i8* %2)
%15 = call i32 @putstring(i8* %2)
%16 = call i32 @f(i8 signext 51, i8* %2)
%17 = call i32 @putstring(i8* %2)
%18 = call i32 @f(i8 signext 50, i8* %2)
%19 = call i32 @putstring(i8* %2)
%20 = call i32 @f(i8 signext 49, i8* %2)
%21 = call i32 @putstring(i8* %2)
%22 = call i32 @f(i8 signext 48, i8* %2)
%23 = call i32 @putstring(i8* %2)
%24 = call i32 @f(i8 signext 10, i8* %2)
%25 = call i32 @putstring(i8* %2)
ret i32 0
}