#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 */
scalar_t__ check(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i, x;
  x = 1;
  for (i = 1; i <= 10;) {
    x++;
    if (check(x) && check(x + 2)) {
      printf("(%d, %d)\n", x, x + 2);
      i++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     119a <main+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <check@plt>
cmp    $0x0,%rax
je     1195 <main+0x75>
mov    -0xc(%rbp),%edi
add    $0x2,%edi
call   1040 <check@plt>
cmp    $0x0,%rax
je     1195 <main+0x75>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x2,%edx
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r15d
mov    $0x2,%ebx
lea    0xec7(%rip),%r14
jmp    1149 <main+0x29>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0xb,%r15d
jge    1176 <main+0x56>
mov    %ebx,%edi
call   1040 <check@plt>
test   %rax,%rax
je     1140 <main+0x20>
lea    0x2(%rbx),%ebp
mov    %ebp,%edi
call   1040 <check@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
add    $0x1,%r15d
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"(%d, %d)\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %14
%2 = phi i32 [ 1, %0 ], [ %4, %14 ]
%3 = phi i32 [ 1, %0 ], [ %15, %14 ]
%4 = add nuw nsw i32 %2, 1
%5 = tail call i64 @check(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = add nuw nsw i32 %2, 3
%9 = tail call i64 @check(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %8)
%13 = add nsw i32 %3, 1
br label %14
14: ; preds = %11, %7, %1
%15 = phi i32 [ %13, %11 ], [ %3, %7 ], [ %3, %1 ]
%16 = icmp slt i32 %15, 11
br i1 %16, label %1, label %17
17: ; preds = %14
ret i32 0
}