#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*/ etm_init();
int /*<<< orphan*/ swo_init(int, int, int);
int /*<<< orphan*/ swo_puts(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ test_func();
int main(void) {
  int counter = 0;
  const char *string = "You must construct additional pylons.";
  swo_init(21004050, 3000000, 0x1);
  etm_init();
  for (;;) {
    counter++;
    swo_puts(0, string);
    if (counter % 3) {
      test_func();
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x1407f12,%edi
mov    $0x2dc6c0,%esi
mov    $0x1,%edx
call   1060 <swo_init@plt>
mov    $0x0,%al
call   1040 <etm_init@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <swo_puts@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11ab <main+0x6b>
mov    $0x0,%al
call   1050 <test_func@plt>
jmp    117c <main+0x3c>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%r12d
mov    $0x1407f12,%edi
mov    $0x2dc6c0,%esi
mov    $0x1,%edx
call   1060 <swo_init@plt>
xor    %eax,%eax
call   1040 <etm_init@plt>
mov    $0xffffffff,%ebx
mov    $0xaaaaaaab,%r15d
lea    0xe85(%rip),%r14
jmp    1187 <main+0x47>
nopl   (%rax)
add    $0xffffffff,%ebx
add    $0x1,%r12d
mov    %r12d,%eax
imul   %r15,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%ebp
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <swo_puts@plt>
add    %ebx,%ebp
je     1180 <main+0x40>
xor    %eax,%eax
call   1050 <test_func@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [38 x i8] c"You must construct additional pylons.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = call i32 @swo_init(i32 21004050, i32 3000000, i32 1)
%5 = call i32 (...) @etm_init()
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i8*, i8** %3
%10 = call i32 @swo_puts(i32 0, i8* %9)
%11 = load i32, i32* %2
%12 = srem i32 %11, 3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %6
%15 = call i32 (...) @test_func()
br label %16
16: ; preds = %14, %6
br label %6
}

LLVM IR (-O2):
@.str = [38 x i8] c"You must construct additional pylons.\00"
define i32 @main() {
%1 = tail call i32 @swo_init(i32 21004050, i32 3000000, i32 1)
%2 = tail call i32 (...) @etm_init()
br label %3
3: ; preds = %11, %0
%4 = phi i32 [ 0, %0 ], [ %5, %11 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @swo_puts(i32 0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = urem i32 %5, 3
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 (...) @test_func()
br label %11
11: ; preds = %9, %3
br label %3
}