#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 silly(int, int);
int main(int argc, char *argv[]) {
  int a, b, p, q;
  a = 1;
  p = silly(a++, a++);
  ;
  printf("a=%d, p=%d\n", a, p);
  b = 1;
  q = silly(++b, ++b);
  ;
  printf("b=%d, q=%d\n", b, q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
call   1040 <silly@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x18(%rbp)
mov    -0x18(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
call   1040 <silly@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <silly@plt>
lea    0xec9(%rip),%rdi
mov    $0x3,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <silly@plt>
lea    0xeb3(%rip),%rdi
mov    $0x3,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"a=%d, p=%d\0A\00"
@.str.1 = [12 x i8] c"b=%d, q=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
%13 = call i32 @silly(i32 %9, i32 %11)
store i32 %13, i32* %7
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
store i32 1, i32* %6
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
%21 = call i32 @silly(i32 %18, i32 %20)
store i32 %21, i32* %8
%22 = load i32, i32* %6
%23 = load i32, i32* %8
%24 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, p=%d\0A\00"
@.str.1 = [12 x i8] c"b=%d, q=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @silly(i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3, i32 %3)
%5 = tail call i32 @silly(i32 2, i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %5)
ret i32 0
}