#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*/ rul___emit_incr_indent();
int /*<<< orphan*/ rul___emit_newline();
int /*<<< orphan*/ rul___emit_string(char *);
int /*<<< orphan*/ rul___emit_verify_newline();
int /*<<< orphan*/ sprintf(char *, char *, long);
void rul__emit_begin_iter_loop(char *iterator_name, long number_loops) {
  char buffer[20];
  rul___emit_verify_newline();
  rul___emit_string("for (");
  rul___emit_string(iterator_name);
  rul___emit_string(" = 0; ");
  rul___emit_string(iterator_name);
  sprintf(buffer, " < %ld; ", number_loops);
  rul___emit_string(buffer);
  rul___emit_string(iterator_name);
  rul___emit_string("++)");
  rul___emit_incr_indent();
  rul___emit_string(" {");
  rul___emit_newline();
}


x86 assembly (clang, -O0):
<rul__emit_begin_iter_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rul___emit_verify_newline@plt>
lea    0xe92(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rul___emit_string@plt>
lea    0xe83(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rul___emit_string@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe6d(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <rul___emit_string@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rul___emit_string@plt>
lea    0xe58(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    $0x0,%al
call   1070 <rul___emit_incr_indent@plt>
lea    0xe49(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    $0x0,%al
call   1050 <rul___emit_newline@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__emit_begin_iter_loop>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <rul___emit_verify_newline@plt>
lea    0xe93(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    %rbx,%rdi
call   1030 <rul___emit_string@plt>
lea    0xe85(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    %rbx,%rdi
call   1030 <rul___emit_string@plt>
lea    0xe78(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %r15,%rdi
call   1030 <rul___emit_string@plt>
mov    %rbx,%rdi
call   1030 <rul___emit_string@plt>
lea    0xe5c(%rip),%rdi
call   1030 <rul___emit_string@plt>
xor    %eax,%eax
call   1070 <rul___emit_incr_indent@plt>
lea    0xe4d(%rip),%rdi
call   1030 <rul___emit_string@plt>
xor    %eax,%eax
call   1050 <rul___emit_newline@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"for (\00"
@.str.1 = [7 x i8] c" = 0; \00"
@.str.2 = [9 x i8] c" < %ld; \00"
@.str.3 = [4 x i8] c"++)\00"
@.str.4 = [3 x i8] c" {\00"
define void @rul__emit_begin_iter_loop(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [20 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 (...) @rul___emit_verify_newline()
%7 = call i32 @rul___emit_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i32 @rul___emit_string(i8* %8)
%10 = call i32 @rul___emit_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = call i32 @rul___emit_string(i8* %11)
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%14 = load i64, i64* %4
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %14)
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%17 = call i32 @rul___emit_string(i8* %16)
%18 = load i8*, i8** %3
%19 = call i32 @rul___emit_string(i8* %18)
%20 = call i32 @rul___emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (...) @rul___emit_incr_indent()
%22 = call i32 @rul___emit_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 (...) @rul___emit_newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"for (\00"
@.str.1 = [7 x i8] c" = 0; \00"
@.str.2 = [9 x i8] c" < %ld; \00"
@.str.3 = [4 x i8] c"++)\00"
@.str.4 = [3 x i8] c" {\00"
define void @rul__emit_begin_iter_loop(i8* %0, i64 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (...) @rul___emit_verify_newline()
%6 = tail call i32 @rul___emit_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @rul___emit_string(i8* %0)
%8 = tail call i32 @rul___emit_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @rul___emit_string(i8* %0)
%10 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %1)
%11 = call i32 @rul___emit_string(i8* %4)
%12 = call i32 @rul___emit_string(i8* %0)
%13 = call i32 @rul___emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (...) @rul___emit_incr_indent()
%15 = call i32 @rul___emit_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (...) @rul___emit_newline()
ret void
}