#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 testArg(int);
int testReturn();
void testComma() {
  int a;
  0, a = 10, 20;
  printf("statement: %d\n", a);
  a = 1;
  if (a = 0, 1) {
    printf("if: a = %d\n", a);
  }
  int b = 0;
  a = 10;
  while (b++, a--) {
  }
  printf("while: b = %d\n", b);
  b = 0;
  for (b++, a = 0; b++, a < 10; b++, a++) {
  }
  printf("for: b = %d\n", b);
  b = testReturn();
  printf("return: %d\n", b);
  b = testArg((a, 12));
  printf("arg: %d\n", b);
}


x86 assembly (clang, -O0):
<testComma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    116b <testComma+0x3b>
jmp    117a <testComma+0x4a>
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     11aa <testComma+0x7a>
jmp    1188 <testComma+0x58>
mov    -0x8(%rbp),%esi
lea    0xe67(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    11ff <testComma+0xcf>
jmp    11e8 <testComma+0xb8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11d0 <testComma+0xa0>
mov    -0x8(%rbp),%esi
lea    0xe21(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <testReturn@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe15(%rip),%rdi
call   1050 <printf@plt>
mov    $0xc,%edi
call   1040 <testArg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe05(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testComma>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0xa,%esi
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
xor    %esi,%esi
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0xb,%esi
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x16,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <testReturn@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0xc,%edi
call   1040 <testArg@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"statement: %d\0A\00"
@.str.1 = [12 x i8] c"if: a = %d\0A\00"
@.str.2 = [15 x i8] c"while: b = %d\0A\00"
@.str.3 = [13 x i8] c"for: b = %d\0A\00"
@.str.4 = [12 x i8] c"return: %d\0A\00"
@.str.5 = [9 x i8] c"arg: %d\0A\00"
define void @testComma() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 1, i32* %1
store i32 0, i32* %1
br i1 true, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %0
store i32 0, i32* %2
store i32 10, i32* %1
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %1
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %16
15: ; preds = %9
br label %9
16: ; preds = %9
%17 = load i32, i32* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %17)
store i32 0, i32* %2
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
store i32 0, i32* %1
br label %21
21: ; preds = %27, %16
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
%24 = load i32, i32* %1
%25 = icmp slt i32 %24, 10
br i1 %25, label %26, label %32
26: ; preds = %21
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %21
32: ; preds = %21
%33 = load i32, i32* %2
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %33)
%35 = call i32 (...) @testReturn()
store i32 %35, i32* %2
%36 = load i32, i32* %2
%37 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %1
%39 = call i32 @testArg(i32 12)
store i32 %39, i32* %2
%40 = load i32, i32* %2
%41 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %40)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"statement: %d\0A\00"
@.str.1 = [12 x i8] c"if: a = %d\0A\00"
@.str.2 = [15 x i8] c"while: b = %d\0A\00"
@.str.3 = [13 x i8] c"for: b = %d\0A\00"
@.str.4 = [12 x i8] c"return: %d\0A\00"
@.str.5 = [9 x i8] c"arg: %d\0A\00"
define void @testComma() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 11)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 22)
%5 = tail call i32 (...) @testReturn()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %5)
%7 = tail call i32 @testArg(i32 12)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %7)
ret void
}