#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*/ itoa2(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char s[100];
  int n = -3267;
  int l = 10;
  printf("ruler  : ");
  int i;
  for (i = 0; i < l; i++)
    printf(".");
  printf("\n");
  itoa2(n, s, l);
  printf("string : %s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffff33d,-0x74(%rbp)
movl   $0xa,-0x78(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    117d <main+0x5d>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1155 <main+0x35>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%edx
call   1040 <itoa2@plt>
lea    -0x70(%rbp),%rsi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rbx
mov    $0xfffff33d,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1050 <itoa2@plt>
lea    0xe3d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"ruler : \00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [13 x i8] c"string : %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 -3267, i32* %3
store i32 10, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %13, %0
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %7
16: ; preds = %7
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %3
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%20 = load i32, i32* %4
%21 = call i32 @itoa2(i32 %18, i8* %19, i32 %20)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"ruler : \00"
@.str.3 = [13 x i8] c"string : %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 46)
%5 = tail call i32 @putchar(i32 46)
%6 = tail call i32 @putchar(i32 46)
%7 = tail call i32 @putchar(i32 46)
%8 = tail call i32 @putchar(i32 46)
%9 = tail call i32 @putchar(i32 46)
%10 = tail call i32 @putchar(i32 46)
%11 = tail call i32 @putchar(i32 46)
%12 = tail call i32 @putchar(i32 46)
%13 = tail call i32 @putchar(i32 46)
%14 = tail call i32 @putchar(i32 10)
%15 = call i32 @itoa2(i32 -3267, i8* %2, i32 10)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %2)
ret i32 0
}