#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 *, ...);
scalar_t__ validate_second(int, int);
void print_combinations(int *first, int *second, int third) {
  printf("Possible combinations:\n");
  int i, j;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      if (validate_second(second[j], third))
        printf("(%d, %d, %d)\n", first[i], second[j], third);
    }
  }
}


x86 assembly (clang, -O0):
<print_combinations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    11cd <print_combinations+0xad>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    11ba <print_combinations+0x9a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x14(%rbp),%esi
call   1040 <validate_second@plt>
cmp    $0x0,%rax
je     11a7 <print_combinations+0x87>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x14(%rbp),%ecx
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ac <print_combinations+0x8c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1159 <print_combinations+0x39>
jmp    11bf <print_combinations+0x9f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <print_combinations+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_combinations>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%r15
xor    %r12d,%r12d
jmp    116e <print_combinations+0x3e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    $0xa,%r12
je     12c9 <print_combinations+0x199>
mov    (%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     118e <print_combinations+0x5e>
mov    (%r14,%r12,4),%esi
mov    (%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     11b0 <print_combinations+0x80>
mov    (%r14,%r12,4),%esi
mov    0x4(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     11d2 <print_combinations+0xa2>
mov    (%r14,%r12,4),%esi
mov    0x8(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     11f4 <print_combinations+0xc4>
mov    (%r14,%r12,4),%esi
mov    0xc(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     1216 <print_combinations+0xe6>
mov    (%r14,%r12,4),%esi
mov    0x10(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     1238 <print_combinations+0x108>
mov    (%r14,%r12,4),%esi
mov    0x14(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     125a <print_combinations+0x12a>
mov    (%r14,%r12,4),%esi
mov    0x18(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     127c <print_combinations+0x14c>
mov    (%r14,%r12,4),%esi
mov    0x1c(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     129e <print_combinations+0x16e>
mov    (%r14,%r12,4),%esi
mov    0x20(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx),%edi
mov    %ebp,%esi
call   1050 <validate_second@plt>
test   %rax,%rax
je     1160 <print_combinations+0x30>
mov    (%r14,%r12,4),%esi
mov    0x24(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1160 <print_combinations+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Possible combinations:\0A\00"
@.str.1 = [14 x i8] c"(%d, %d, %d)\0A\00"
define void @print_combinations(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %44, %3
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %47
13: ; preds = %10
store i32 0, i32* %8
br label %14
14: ; preds = %40, %13
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %43
17: ; preds = %14
%18 = load i32*, i32** %5
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32, i32* %6
%24 = call i64 @validate_second(i32 %22, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %39
26: ; preds = %17
%27 = load i32*, i32** %4
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
%31 = load i32, i32* %30
%32 = load i32*, i32** %5
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %36, i32 %37)
br label %39
39: ; preds = %26, %17
br label %40
40: ; preds = %39
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %14
43: ; preds = %14
br label %44
44: ; preds = %43
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %10
47: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"(%d, %d, %d)\0A\00"
@str = [23 x i8] c"Possible combinations:\00"
define void @print_combinations(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = getelementptr inbounds i32, i32* %1, i64 3
%8 = getelementptr inbounds i32, i32* %1, i64 4
%9 = getelementptr inbounds i32, i32* %1, i64 5
%10 = getelementptr inbounds i32, i32* %1, i64 6
%11 = getelementptr inbounds i32, i32* %1, i64 7
%12 = getelementptr inbounds i32, i32* %1, i64 8
%13 = getelementptr inbounds i32, i32* %1, i64 9
br label %14
14: ; preds = %3, %96
%15 = phi i64 [ 0, %3 ], [ %97, %96 ]
%16 = getelementptr inbounds i32, i32* %0, i64 %15
%17 = load i32, i32* %1
%18 = tail call i64 @validate_second(i32 %17, i32 %2)
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %14
%21 = load i32, i32* %16
%22 = load i32, i32* %1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %22, i32 %2)
br label %24
24: ; preds = %14, %20
%25 = load i32, i32* %5
%26 = tail call i64 @validate_second(i32 %25, i32 %2)
%27 = icmp eq i64 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i32, i32* %16
%30 = load i32, i32* %5
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %30, i32 %2)
br label %32
32: ; preds = %28, %24
%33 = load i32, i32* %6
%34 = tail call i64 @validate_second(i32 %33, i32 %2)
%35 = icmp eq i64 %34, 0
br i1 %35, label %40, label %36
36: ; preds = %32
%37 = load i32, i32* %16
%38 = load i32, i32* %6
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %37, i32 %38, i32 %2)
br label %40
40: ; preds = %36, %32
%41 = load i32, i32* %7
%42 = tail call i64 @validate_second(i32 %41, i32 %2)
%43 = icmp eq i64 %42, 0
br i1 %43, label %48, label %44
44: ; preds = %40
%45 = load i32, i32* %16
%46 = load i32, i32* %7
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %45, i32 %46, i32 %2)
br label %48
48: ; preds = %44, %40
%49 = load i32, i32* %8
%50 = tail call i64 @validate_second(i32 %49, i32 %2)
%51 = icmp eq i64 %50, 0
br i1 %51, label %56, label %52
52: ; preds = %48
%53 = load i32, i32* %16
%54 = load i32, i32* %8
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %53, i32 %54, i32 %2)
br label %56
56: ; preds = %52, %48
%57 = load i32, i32* %9
%58 = tail call i64 @validate_second(i32 %57, i32 %2)
%59 = icmp eq i64 %58, 0
br i1 %59, label %64, label %60
60: ; preds = %56
%61 = load i32, i32* %16
%62 = load i32, i32* %9
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %61, i32 %62, i32 %2)
br label %64
64: ; preds = %60, %56
%65 = load i32, i32* %10
%66 = tail call i64 @validate_second(i32 %65, i32 %2)
%67 = icmp eq i64 %66, 0
br i1 %67, label %72, label %68
68: ; preds = %64
%69 = load i32, i32* %16
%70 = load i32, i32* %10
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %69, i32 %70, i32 %2)
br label %72
72: ; preds = %68, %64
%73 = load i32, i32* %11
%74 = tail call i64 @validate_second(i32 %73, i32 %2)
%75 = icmp eq i64 %74, 0
br i1 %75, label %80, label %76
76: ; preds = %72
%77 = load i32, i32* %16
%78 = load i32, i32* %11
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %77, i32 %78, i32 %2)
br label %80
80: ; preds = %76, %72
%81 = load i32, i32* %12
%82 = tail call i64 @validate_second(i32 %81, i32 %2)
%83 = icmp eq i64 %82, 0
br i1 %83, label %88, label %84
84: ; preds = %80
%85 = load i32, i32* %16
%86 = load i32, i32* %12
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %85, i32 %86, i32 %2)
br label %88
88: ; preds = %84, %80
%89 = load i32, i32* %13
%90 = tail call i64 @validate_second(i32 %89, i32 %2)
%91 = icmp eq i64 %90, 0
br i1 %91, label %96, label %92
92: ; preds = %88
%93 = load i32, i32* %16
%94 = load i32, i32* %13
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %93, i32 %94, i32 %2)
br label %96
96: ; preds = %92, %88
%97 = add nuw nsw i64 %15, 1
%98 = icmp eq i64 %97, 10
br i1 %98, label %99, label %14
99: ; preds = %96
ret void
}