#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*/ emit(char *);
void clear_cells_right(int num) {
  for (int i = 0; i < num; i++) {
    emit("[-]>");
  }
  for (int i = 0; i < num; i++) {
    emit("<");
  }
}


x86 assembly (clang, -O0):
<clear_cells_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <clear_cells_right+0x38>
lea    0xecb(%rip),%rdi
call   1030 <emit@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <clear_cells_right+0x12>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <clear_cells_right+0x65>
lea    0xea3(%rip),%rdi
call   1030 <emit@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <clear_cells_right+0x3f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_cells_right>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    115d <clear_cells_right+0x4d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <emit@plt>
add    $0xffffffff,%ebp
jne    1130 <clear_cells_right+0x20>
test   %ebx,%ebx
jle    115d <clear_cells_right+0x4d>
lea    0xebd(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <emit@plt>
add    $0xffffffff,%ebx
jne    1150 <clear_cells_right+0x40>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"[-]>\00"
@.str.1 = [2 x i8] c"<\00"
define void @clear_cells_right(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %9
3: ; preds = %4
br i1 %2, label %10, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @emit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
9: ; preds = %10, %1, %3
ret void
10: ; preds = %3, %10
%11 = phi i32 [ %13, %10 ], [ 0, %3 ]
%12 = tail call i32 @emit(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %0
br i1 %14, label %9, label %10
}