#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*/ bf10(int);
int /*<<< orphan*/ printf(char *);
void bf50(int c) {
  int i, d, r, m;
  m = 7;
  d = c / m;
  r = c % m;
  printf(">");
  for (i = 0; i < m; i++) {
    printf("+");
  }
  printf("[<");
  for (i = 0; i < d; i++) {
    printf("+");
  }
  printf(">-]");
  printf("<");
  bf10(r);
}


x86 assembly (clang, -O0):
<bf50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117f <bf50+0x5f>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <bf50+0x39>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b8 <bf50+0x98>
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1192 <bf50+0x72>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%edi
call   1030 <bf10@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf50>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
movslq %ebx,%rbp
imul   $0xffffffff92492493,%rbp,%rbx
shr    $0x20,%rbx
add    %ebp,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x2,%ebx
add    %eax,%ebx
lea    0x0(,%rbx,8),%eax
mov    %ebx,%r14d
sub    %eax,%r14d
add    %ebp,%r14d
lea    0xe49(%rip),%rdi
call   1050 <printf@plt>
cmp    $0x7,%ebp
jl     11df <bf50+0xaf>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2b,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <bf50+0xa0>
lea    0xe1d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x3c,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <bf10@plt>

LLVM IR (-O0):
@.str = [2 x i8] c">\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [3 x i8] c"[<\00"
@.str.3 = [4 x i8] c">-]\00"
@.str.4 = [2 x i8] c"<\00"
define void @bf50(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 7, i32* %6
%7 = load i32, i32* %2
%8 = load i32, i32* %6
%9 = sdiv i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %6
%12 = srem i32 %10, %11
store i32 %12, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %14
14: ; preds = %20, %1
%15 = load i32, i32* %3
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %14
23: ; preds = %14
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %25
25: ; preds = %31, %23
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %25
34: ; preds = %25
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%37 = load i32, i32* %5
%38 = call i32 @bf10(i32 %37)
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"[<\00"
@.str.3 = [4 x i8] c">-]\00"
define void @bf50(i32 %0) {
%2 = tail call i32 @putchar(i32 62)
%3 = tail call i32 @putchar(i32 43)
%4 = tail call i32 @putchar(i32 43)
%5 = tail call i32 @putchar(i32 43)
%6 = tail call i32 @putchar(i32 43)
%7 = tail call i32 @putchar(i32 43)
%8 = tail call i32 @putchar(i32 43)
%9 = tail call i32 @putchar(i32 43)
%10 = sdiv i32 %0, 7
%11 = srem i32 %0, 7
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp sgt i32 %0, 6
br i1 %13, label %14, label %19
14: ; preds = %1, %14
%15 = phi i32 [ %17, %14 ], [ 0, %1 ]
%16 = tail call i32 @putchar(i32 43)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, %10
br i1 %18, label %19, label %14
19: ; preds = %14, %1
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%21 = tail call i32 @putchar(i32 60)
%22 = tail call i32 @bf10(i32 %11)
ret void
}