#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*/ putchar(int);
int main(int argc, char *argv[]) {
  volatile int i;
  int ch = '+';
  if (argc == 2) {
    ch = argv[1][0];
  }
  for (i = 0; i < 1 << 25; i++) {
    if ((i % 10000) == 0) {
      putchar(ch);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2b,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1145 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x2000000,%eax
jge    1189 <main+0x79>
mov    -0x14(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1176 <main+0x66>
mov    -0x18(%rbp),%edi
call   1030 <putchar@plt>
jmp    117b <main+0x6b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <main+0x3c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x2b,%ebx
cmp    $0x2,%edi
jne    1126 <main+0x16>
mov    0x8(%rsi),%rax
movsbl (%rax),%ebx
movl   $0x0,0xc(%rsp)
mov    0xc(%rsp),%eax
cmp    $0x1ffffff,%eax
jle    1160 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addl   $0x1,0xc(%rsp)
mov    0xc(%rsp),%eax
cmp    $0x2000000,%eax
jge    1139 <main+0x29>
imul   $0x3afb7e91,0xc(%rsp),%eax
3a
add    $0x346dc0,%eax
ror    $0x4,%eax
cmp    $0x68db8,%eax
ja     1150 <main+0x40>
mov    %ebx,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x40>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 43, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
store i32 %16, i32* %7
br label %17
17: ; preds = %10, %2
store volatile i32 0, i32* %6
br label %18
18: ; preds = %29, %17
%19 = load volatile i32, i32* %6
%20 = icmp slt i32 %19, 33554432
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = load volatile i32, i32* %6
%23 = srem i32 %22, 10000
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %7
%27 = call i32 @putchar(i32 %26)
br label %28
28: ; preds = %25, %21
br label %29
29: ; preds = %28
%30 = load volatile i32, i32* %6
%31 = add nsw i32 %30, 1
store volatile i32 %31, i32* %6
br label %18
32: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ %10, %6 ], [ 43, %2 ]
store volatile i32 0, i32* %3
%13 = load volatile i32, i32* %3
%14 = icmp slt i32 %13, 33554432
br i1 %14, label %15, label %26
15: ; preds = %11, %21
%16 = load volatile i32, i32* %3
%17 = srem i32 %16, 10000
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 @putchar(i32 %12)
br label %21
21: ; preds = %15, %19
%22 = load volatile i32, i32* %3
%23 = add nsw i32 %22, 1
store volatile i32 %23, i32* %3
%24 = load volatile i32, i32* %3
%25 = icmp slt i32 %24, 33554432
br i1 %25, label %15, label %26
26: ; preds = %21, %11
ret i32 0
}