#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 *, int, int, int);
int /*<<< orphan*/ result(int, int *, int *);
int main() {
  int i, j, k;
  int result_add, result_mul;
  for (i = 123; i <= 329; i++) {
    j = i * 2;
    k = i * 3;
    result_add = 0;
    result_mul = 1;
    result(i, &result_add, &result_mul);
    result(j, &result_add, &result_mul);
    result(k, &result_add, &result_mul);
    if (result_add == 45 && result_mul == 362880)
      printf("%d %d %d\n", i, j, k);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
cmpl   $0x149,-0x8(%rbp)
jg     11d0 <main+0xb0>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <result@plt>
mov    -0xc(%rbp),%edi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <result@plt>
mov    -0x10(%rbp),%edi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <result@plt>
cmpl   $0x2d,-0x14(%rbp)
jne    11bd <main+0x9d>
cmpl   $0x58980,-0x18(%rbp)
jne    11bd <main+0x9d>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
jmp    11c2 <main+0xa2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x7b,%r14d
mov    $0xf6,%ebp
mov    $0x171,%ebx
lea    0x4(%rsp),%r15
mov    %rsp,%r12
lea    0xeb6(%rip),%r13
jmp    1162 <main+0x42>
nopl   0x0(%rax)
add    $0x1,%r14d
add    $0x2,%ebp
add    $0x3,%ebx
cmp    $0x294,%ebp
je     11ba <main+0x9a>
movl   $0x0,0x4(%rsp)
movl   $0x1,(%rsp)
mov    %r14d,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <result@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <result@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <result@plt>
cmpl   $0x2d,0x4(%rsp)
jne    1150 <main+0x30>
cmpl   $0x58980,(%rsp)
jne    1150 <main+0x30>
mov    %r13,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %0, %19
%6 = phi i32 [ 123, %0 ], [ %20, %19 ]
%7 = shl nuw nsw i32 %6, 1
%8 = mul nuw nsw i32 %6, 3
store i32 0, i32* %1
store i32 1, i32* %2
%9 = call i32 @result(i32 %6, i32* %1, i32* %2)
%10 = call i32 @result(i32 %7, i32* %1, i32* %2)
%11 = call i32 @result(i32 %8, i32* %1, i32* %2)
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 45
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 362880
%16 = select i1 %13, i1 %15, i1 false
br i1 %16, label %17, label %19
17: ; preds = %5
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
br label %19
19: ; preds = %5, %17
%20 = add nuw nsw i32 %6, 1
%21 = icmp eq i32 %20, 330
br i1 %21, label %22, label %5
22: ; preds = %19
ret i32 0
}