#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*/ getchar();
int /*<<< orphan*/ printf(char *, int, int, int);
void main() {
  int x, y, z;
  x = y = z = 0;
  ++x && ++y && ++z;
  printf("x=%d,y=%d,z=%d\n", x, y, z);
  x = y = z = 0;
  ++x || ++y && ++z;
  printf("x=%d,y=%d,z=%d\n", x, y, z);
  x = y = z = 0;
  ++x && ++y || ++z;
  printf("x=%d,y=%d,z=%d\n", x, y, z);
  x = y = z = -1;
  ++x && ++y && ++z;
  printf("x=%d,y=%d,z=%d\n", x, y, z);
  x = y = z = -1;
  ++x || ++y && ++z;
  printf("x=%d,y=%d,z=%d\n", x, y, z);
  x = y = z = -1;
  ++x && ++y || ++z;
  printf("x=%d,y=%d,z=%d\n", x, y, z);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     117d <main+0x5d>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     117d <main+0x5d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xe(%rbp)
jne    11f0 <main+0xd0>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xf(%rbp)
je     11ea <main+0xca>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1246 <main+0x126>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x10(%rbp)
jne    1258 <main+0x138>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x10(%rbp)
mov    -0x10(%rbp),%al
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xd95(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     12c5 <main+0x1a5>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     12c5 <main+0x1a5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xd28(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
jne    1338 <main+0x218>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x13(%rbp)
je     1332 <main+0x212>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xcb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     138e <main+0x26e>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x14(%rbp)
jne    13a0 <main+0x280>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%al
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xc4d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"x=%d,y=%d,z=%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
store i32 0, i32* %2
store i32 0, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %11, %7, %0
%16 = phi i1 [ false, %7 ], [ false, %0 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
store i32 0, i32* %3
store i32 0, i32* %2
store i32 0, i32* %1
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
%24 = icmp ne i32 %23, 0
br i1 %24, label %35, label %25
25: ; preds = %15
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
%32 = icmp ne i32 %31, 0
br label %33
33: ; preds = %29, %25
%34 = phi i1 [ false, %25 ], [ %32, %29 ]
br label %35
35: ; preds = %33, %15
%36 = phi i1 [ true, %15 ], [ %34, %33 ]
%37 = zext i1 %36 to i32
%38 = load i32, i32* %1
%39 = load i32, i32* %2
%40 = load i32, i32* %3
%41 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %39, i32 %40)
store i32 0, i32* %3
store i32 0, i32* %2
store i32 0, i32* %1
%42 = load i32, i32* %1
%43 = add nsw i32 %42, 1
store i32 %43, i32* %1
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %35
%46 = load i32, i32* %2
%47 = add nsw i32 %46, 1
store i32 %47, i32* %2
%48 = icmp ne i32 %47, 0
br i1 %48, label %53, label %49
49: ; preds = %45, %35
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 1
store i32 %51, i32* %3
%52 = icmp ne i32 %51, 0
br label %53
53: ; preds = %49, %45
%54 = phi i1 [ true, %45 ], [ %52, %49 ]
%55 = zext i1 %54 to i32
%56 = load i32, i32* %1
%57 = load i32, i32* %2
%58 = load i32, i32* %3
%59 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %56, i32 %57, i32 %58)
store i32 -1, i32* %3
store i32 -1, i32* %2
store i32 -1, i32* %1
%60 = load i32, i32* %1
%61 = add nsw i32 %60, 1
store i32 %61, i32* %1
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %71
63: ; preds = %53
%64 = load i32, i32* %2
%65 = add nsw i32 %64, 1
store i32 %65, i32* %2
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %71
67: ; preds = %63
%68 = load i32, i32* %3
%69 = add nsw i32 %68, 1
store i32 %69, i32* %3
%70 = icmp ne i32 %69, 0
br label %71
71: ; preds = %67, %63, %53
%72 = phi i1 [ false, %63 ], [ false, %53 ], [ %70, %67 ]
%73 = zext i1 %72 to i32
%74 = load i32, i32* %1
%75 = load i32, i32* %2
%76 = load i32, i32* %3
%77 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %74, i32 %75, i32 %76)
store i32 -1, i32* %3
store i32 -1, i32* %2
store i32 -1, i32* %1
%78 = load i32, i32* %1
%79 = add nsw i32 %78, 1
store i32 %79, i32* %1
%80 = icmp ne i32 %79, 0
br i1 %80, label %91, label %81
81: ; preds = %71
%82 = load i32, i32* %2
%83 = add nsw i32 %82, 1
store i32 %83, i32* %2
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %89
85: ; preds = %81
%86 = load i32, i32* %3
%87 = add nsw i32 %86, 1
store i32 %87, i32* %3
%88 = icmp ne i32 %87, 0
br label %89
89: ; preds = %85, %81
%90 = phi i1 [ false, %81 ], [ %88, %85 ]
br label %91
91: ; preds = %89, %71
%92 = phi i1 [ true, %71 ], [ %90, %89 ]
%93 = zext i1 %92 to i32
%94 = load i32, i32* %1
%95 = load i32, i32* %2
%96 = load i32, i32* %3
%97 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %94, i32 %95, i32 %96)
store i32 -1, i32* %3
store i32 -1, i32* %2
store i32 -1, i32* %1
%98 = load i32, i32* %1
%99 = add nsw i32 %98, 1
store i32 %99, i32* %1
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %105
101: ; preds = %91
%102 = load i32, i32* %2
%103 = add nsw i32 %102, 1
store i32 %103, i32* %2
%104 = icmp ne i32 %103, 0
br i1 %104, label %109, label %105
105: ; preds = %101, %91
%106 = load i32, i32* %3
%107 = add nsw i32 %106, 1
store i32 %107, i32* %3
%108 = icmp ne i32 %107, 0
br label %109
109: ; preds = %105, %101
%110 = phi i1 [ true, %101 ], [ %108, %105 ]
%111 = zext i1 %110 to i32
%112 = load i32, i32* %1
%113 = load i32, i32* %2
%114 = load i32, i32* %3
%115 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %112, i32 %113, i32 %114)
%116 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"x=%d,y=%d,z=%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1, i32 -1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 -1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1, i32 0)
%7 = tail call i32 (...) @getchar()
ret void
}