#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*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int);
void ft_putnbr_f(int first, int second, int lim) {
  int checker;
  checker = first;
  while (checker * 10 < lim) {
    ft_putchar('0');
    checker = checker * 10 + 1;
  }
  ft_putnbr(first);
  ft_putchar(' ');
  checker = second;
  while (checker * 10 < lim) {
    ft_putchar('0');
    checker = checker * 10 + 1;
  }
  ft_putnbr(second);
  if (second != lim || first != lim - 1) {
    ft_putchar(',');
    ft_putchar(' ');
  }
}


x86 assembly (clang, -O0):
<ft_putnbr_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0xa,-0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <ft_putnbr_f+0x3d>
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
imul   $0xa,-0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <ft_putnbr_f+0x17>
mov    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0xa,-0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119b <ft_putnbr_f+0x7b>
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
imul   $0xa,-0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <ft_putnbr_f+0x55>
mov    -0x8(%rbp),%edi
call   1040 <ft_putnbr@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11c0 <ft_putnbr_f+0xa0>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11d4 <ft_putnbr_f+0xb4>
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_f>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%r14d
lea    (%r14,%r14,1),%eax
lea    (%rax,%rax,4),%ebx
cmp    %edx,%ebx
jge    1156 <ft_putnbr_f+0x36>
nopw   0x0(%rax,%rax,1)
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
add    %ebx,%ebx
or     $0x2,%ebx
lea    (%rbx,%rbx,4),%ebx
cmp    %ebp,%ebx
jl     1140 <ft_putnbr_f+0x20>
mov    %r14d,%edi
call   1040 <ft_putnbr@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
lea    (%r15,%r15,1),%eax
lea    (%rax,%rax,4),%ebx
cmp    %ebp,%ebx
jge    1196 <ft_putnbr_f+0x76>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
add    %ebx,%ebx
or     $0x2,%ebx
lea    (%rbx,%rbx,4),%ebx
cmp    %ebp,%ebx
jl     1180 <ft_putnbr_f+0x60>
mov    %r15d,%edi
call   1040 <ft_putnbr@plt>
cmp    %ebp,%r15d
jne    11b6 <ft_putnbr_f+0x96>
add    $0xffffffff,%ebp
cmp    %r14d,%ebp
jne    11b6 <ft_putnbr_f+0x96>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbr_f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
store i32 %8, i32* %7
br label %9
9: ; preds = %14, %3
%10 = load i32, i32* %7
%11 = mul nsw i32 %10, 10
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = call i32 @ft_putchar(i8 signext 48)
%16 = load i32, i32* %7
%17 = mul nsw i32 %16, 10
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %9
19: ; preds = %9
%20 = load i32, i32* %4
%21 = call i32 @ft_putnbr(i32 %20)
%22 = call i32 @ft_putchar(i8 signext 32)
%23 = load i32, i32* %5
store i32 %23, i32* %7
br label %24
24: ; preds = %29, %19
%25 = load i32, i32* %7
%26 = mul nsw i32 %25, 10
%27 = load i32, i32* %6
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %24
%30 = call i32 @ft_putchar(i8 signext 48)
%31 = load i32, i32* %7
%32 = mul nsw i32 %31, 10
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %24
34: ; preds = %24
%35 = load i32, i32* %5
%36 = call i32 @ft_putnbr(i32 %35)
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = icmp ne i32 %37, %38
br i1 %39, label %45, label %40
40: ; preds = %34
%41 = load i32, i32* %4
%42 = load i32, i32* %6
%43 = sub nsw i32 %42, 1
%44 = icmp ne i32 %41, %43
br i1 %44, label %45, label %48
45: ; preds = %40, %34
%46 = call i32 @ft_putchar(i8 signext 44)
%47 = call i32 @ft_putchar(i8 signext 32)
br label %48
48: ; preds = %45, %40
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_f(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 10
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %12
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ %4, %3 ]
%8 = tail call i32 @ft_putchar(i8 signext 48)
%9 = or i32 %7, 1
%10 = mul nsw i32 %9, 10
%11 = icmp slt i32 %10, %2
br i1 %11, label %6, label %12
12: ; preds = %6, %3
%13 = tail call i32 @ft_putnbr(i32 %0)
%14 = tail call i32 @ft_putchar(i8 signext 32)
%15 = mul nsw i32 %1, 10
%16 = icmp slt i32 %15, %2
br i1 %16, label %17, label %23
17: ; preds = %12, %17
%18 = phi i32 [ %21, %17 ], [ %15, %12 ]
%19 = tail call i32 @ft_putchar(i8 signext 48)
%20 = or i32 %18, 1
%21 = mul nsw i32 %20, 10
%22 = icmp slt i32 %21, %2
br i1 %22, label %17, label %23
23: ; preds = %17, %12
%24 = tail call i32 @ft_putnbr(i32 %1)
%25 = icmp eq i32 %1, %2
%26 = add nsw i32 %2, -1
%27 = icmp eq i32 %26, %0
%28 = select i1 %25, i1 %27, i1 false
br i1 %28, label %32, label %29
29: ; preds = %23
%30 = tail call i32 @ft_putchar(i8 signext 44)
%31 = tail call i32 @ft_putchar(i8 signext 32)
br label %32
32: ; preds = %23, %29
ret void
}