#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 INT_MIN;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void print_tuple(int *tuple) {
  fprintf(stdout, "(");
  for (; *tuple != INT_MIN; tuple++) {
    fprintf(stdout, "%i", *tuple);
    if (tuple[1] != INT_MIN) {
      fprintf(stdout, ", ");
    }
  }
  fprintf(stdout, ")\n");
}


x86 assembly (clang, -O0):
<print_tuple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     11a8 <print_tuple+0x98>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%eax
je     1192 <print_tuple+0x82>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1197 <print_tuple+0x87>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1133 <print_tuple+0x23>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tuple>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%r12
mov    (%r12),%edi
lea    0xed2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edx
mov    0x2eaa(%rip),%r13
cmp    0x0(%r13),%edx
je     1190 <print_tuple+0x80>
add    $0x4,%rbx
lea    0xeb3(%rip),%r14
lea    0xeaf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    (%r12),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%eax
cmp    0x0(%r13),%eax
je     1190 <print_tuple+0x80>
mov    (%r12),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edx
add    $0x4,%rbx
cmp    0x0(%r13),%edx
jne    1160 <print_tuple+0x50>
mov    (%r12),%edi
lea    0xe6d(%rip),%rsi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"(\00"
@INT_MIN = global i32 0
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [3 x i8] c", \00"
@.str.3 = [3 x i8] c")\0A\00"
define void @print_tuple(i32* nocapture %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = load i32, i32* @INT_MIN
%6 = icmp eq i32 %4, %5
br i1 %6, label %22, label %7
7: ; preds = %1, %16
%8 = phi i32 [ %19, %16 ], [ %4, %1 ]
%9 = phi i32* [ %12, %16 ], [ %0, %1 ]
%10 = load i32, i32* @stdout
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%12 = getelementptr inbounds i32, i32* %9, i64 1
%13 = load i32, i32* %12
%14 = load i32, i32* @INT_MIN
%15 = icmp eq i32 %13, %14
br i1 %15, label %22, label %16
16: ; preds = %7
%17 = load i32, i32* @stdout
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* %12
%20 = load i32, i32* @INT_MIN
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %7
22: ; preds = %7, %16, %1
%23 = load i32, i32* @stdout
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}