#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 const);
void ft_putstr_from(const char *src, int i) {
  int j;
  j = 0;
  while (src[j]) {
    if (j >= i)
      ft_putchar(src[j]);
    j++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr_from>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1163 <ft_putstr_from+0x53>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1155 <ft_putstr_from+0x45>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ft_putstr_from+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_from>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114d <ft_putstr_from+0x3d>
mov    %rdi,%r14
movslq %esi,%r15
xor    %ebx,%ebx
jmp    113e <ft_putstr_from+0x2e>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
je     114d <ft_putstr_from+0x3d>
cmp    %r15,%rbx
jl     1130 <ft_putstr_from+0x20>
movsbl %al,%edi
call   1030 <ft_putchar@plt>
jmp    1130 <ft_putstr_from+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ft_putstr_from(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %24, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %6
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = call i32 @ft_putchar(i8 signext %22)
br label %24
24: ; preds = %17, %13
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ft_putstr_from(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = sext i32 %1 to i64
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ 0, %5 ], [ %14, %13 ]
%9 = phi i8 [ %3, %5 ], [ %16, %13 ]
%10 = icmp slt i64 %8, %6
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 @ft_putchar(i8 signext %9)
br label %13
13: ; preds = %11, %7
%14 = add nuw i64 %8, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %13, %2
ret void
}