#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*/ printf(char *, long long);
scalar_t__ tm(long long, long long);
int main(void) {
  long long t0;
  long long x0 = 0;
  long long x1 = 0;
  long long x2 = 32;
  long long x3 = 6;
  long long x4 = 1000;
  long long x5 = 0;
  x2 = x3 / 3;
  t0 = 0;
_1:
  t0 = x2;
  if (x2 != 2)
    goto _2;
  else
    goto _4;
_2:
  t0--;
  x2 = t0;
  if ((tm(x3 * (x3 - (2 * x2)), (x3 - x2) * 2)) != 0)
    goto _1;
  else
    goto _3;
_3:
  x5++;
  goto _1;
_4:
  t0 = x5;
  if (x5 > x0)
    goto _8;
  else
    goto _5;
_5:
  t0 = x3;
  if ((x3 - x4) != 0)
    goto _7;
  else
    goto _6;
_6:
  printf("%lld ", x1);
  return 0;
_7:
  t0 += 2;
  x3 = t0;
  x5 = 0;
  x2 = x3 / 3;
  t0 = 3;
  goto _1;
_8:
  x0 = t0;
  x1 = x3;
  goto _5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x20,-0x28(%rbp)
movq   $0x6,-0x30(%rbp)
movq   $0x3e8,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x2,-0x28(%rbp)
je     1191 <main+0x71>
jmp    1196 <main+0x76>
jmp    11f7 <main+0xd7>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x1,%rcx
sub    %rcx,%rax
imul   %rax,%rdi
mov    -0x30(%rbp),%rsi
sub    -0x28(%rbp),%rsi
shl    $0x1,%rsi
call   1040 <tm@plt>
cmp    $0x0,%rax
je     11e1 <main+0xc1>
jmp    1179 <main+0x59>
jmp    11e6 <main+0xc6>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1179 <main+0x59>
mov    -0x40(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1212 <main+0xf2>
jmp    128e <main+0x16e>
jmp    1217 <main+0xf7>
mov    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x30(%rbp),%rax
sub    -0x38(%rbp),%rax
cmp    $0x0,%rax
je     1236 <main+0x116>
jmp    1253 <main+0x133>
jmp    123b <main+0x11b>
mov    -0x20(%rbp),%rsi
lea    0xdba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
movq   $0x3,-0x10(%rbp)
jmp    1179 <main+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1217 <main+0xf7>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x6,%esi
mov    $0x2,%ecx
mov    $0x8,%r12d
mov    $0xc,%ebp
mov    $0xe,%r13d
xor    %edi,%edi
movabs $0xaaaaaaaaaaaaaaab,%rbx
aa aa aa
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rax
mul    %rbx
cmp    $0x2,%rcx
mov    %rsi,0x10(%rsp)
mov    %r12,(%rsp)
mov    %rdi,0x8(%rsp)
jne    1180 <main+0x60>
xor    %r14d,%r14d
jmp    11c1 <main+0xa1>
nop
mov    %rdx,%rbx
and    $0xfffffffffffffffe,%rbx
sub    %rbx,%r12
neg    %rbx
imul   %rsi,%r12
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rbx,%r13,1),%rsi
mov    %r12,%rdi
call   1040 <tm@plt>
cmp    $0x1,%rax
adc    $0x0,%r14
add    $0x2,%rbx
add    %rbp,%r12
cmp    $0xfffffffffffffffc,%rbx
jne    11a0 <main+0x80>
mov    0x8(%rsp),%rdi
cmp    %rdi,%r14
mov    0x10(%rsp),%rsi
cmovg  %rsi,%r15
cmp    $0x3e8,%rsi
je     1211 <main+0xf1>
cmp    %rdi,%r14
cmovg  %r14,%rdi
add    $0x2,%rsi
mov    %rsi,%rax
movabs $0xaaaaaaaaaaaaaaab,%rbx
aa aa aa
mul    %rbx
mov    %rdx,%rcx
shr    %rcx
mov    (%rsp),%r12
add    $0x2,%r12
add    $0x4,%rbp
add    $0x4,%r13
jmp    1160 <main+0x40>
lea    0xde8(%rip),%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lld \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
store i64 0, i64* %4
store i64 32, i64* %5
store i64 6, i64* %6
store i64 1000, i64* %7
store i64 0, i64* %8
%9 = load i64, i64* %6
%10 = sdiv i64 %9, 3
store i64 %10, i64* %5
store i64 0, i64* %2
br label %11
11: ; preds = %56, %35, %33, %0
%12 = load i64, i64* %5
store i64 %12, i64* %2
%13 = load i64, i64* %5
%14 = icmp ne i64 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %11
br label %17
16: ; preds = %11
br label %38
17: ; preds = %15
%18 = load i64, i64* %2
%19 = add nsw i64 %18, -1
store i64 %19, i64* %2
%20 = load i64, i64* %2
store i64 %20, i64* %5
%21 = load i64, i64* %6
%22 = load i64, i64* %6
%23 = load i64, i64* %5
%24 = mul nsw i64 2, %23
%25 = sub nsw i64 %22, %24
%26 = mul nsw i64 %21, %25
%27 = load i64, i64* %6
%28 = load i64, i64* %5
%29 = sub nsw i64 %27, %28
%30 = mul nsw i64 %29, 2
%31 = call i64 @tm(i64 %26, i64 %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %17
br label %11
34: ; preds = %17
br label %35
35: ; preds = %34
%36 = load i64, i64* %8
%37 = add nsw i64 %36, 1
store i64 %37, i64* %8
br label %11
38: ; preds = %16
%39 = load i64, i64* %8
store i64 %39, i64* %2
%40 = load i64, i64* %8
%41 = load i64, i64* %3
%42 = icmp sgt i64 %40, %41
br i1 %42, label %43, label %44
43: ; preds = %38
br label %62
44: ; preds = %38
br label %45
45: ; preds = %62, %44
%46 = load i64, i64* %6
store i64 %46, i64* %2
%47 = load i64, i64* %6
%48 = load i64, i64* %7
%49 = sub nsw i64 %47, %48
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %45
br label %56
52: ; preds = %45
br label %53
53: ; preds = %52
%54 = load i64, i64* %4
%55 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %54)
ret i32 0
56: ; preds = %51
%57 = load i64, i64* %2
%58 = add nsw i64 %57, 2
store i64 %58, i64* %2
%59 = load i64, i64* %2
store i64 %59, i64* %6
store i64 0, i64* %8
%60 = load i64, i64* %6
%61 = sdiv i64 %60, 3
store i64 %61, i64* %5
store i64 3, i64* %2
br label %11
62: ; preds = %43
%63 = load i64, i64* %2
store i64 %63, i64* %3
%64 = load i64, i64* %6
store i64 %64, i64* %4
br label %45
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld \00"
define i32 @main() {
br label %1
1: ; preds = %28, %0
%2 = phi i64 [ %29, %28 ], [ 0, %0 ]
%3 = phi i64 [ %24, %28 ], [ 0, %0 ]
%4 = phi i64 [ %31, %28 ], [ 2, %0 ]
%5 = phi i64 [ %30, %28 ], [ 6, %0 ]
%6 = icmp eq i64 %4, 2
br i1 %6, label %21, label %7
7: ; preds = %1, %7
%8 = phi i64 [ %19, %7 ], [ 0, %1 ]
%9 = phi i64 [ %10, %7 ], [ %4, %1 ]
%10 = add nsw i64 %9, -1
%11 = mul i64 %10, -2
%12 = add i64 %11, %5
%13 = mul nsw i64 %12, %5
%14 = sub nsw i64 %5, %10
%15 = shl nsw i64 %14, 1
%16 = tail call i64 @tm(i64 %13, i64 %15)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i64
%19 = add nuw nsw i64 %8, %18
%20 = icmp eq i64 %10, 2
br i1 %20, label %21, label %7
21: ; preds = %7, %1
%22 = phi i64 [ 0, %1 ], [ %19, %7 ]
%23 = icmp sgt i64 %22, %2
%24 = select i1 %23, i64 %5, i64 %3
%25 = icmp eq i64 %5, 1000
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %24)
ret i32 0
28: ; preds = %21
%29 = select i1 %23, i64 %22, i64 %2
%30 = add nuw nsw i64 %5, 2
%31 = udiv i64 %30, 3
br label %1
}