#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 main(void) {
  int x;
  int a;
  int b = 20;
  a = 10;
  printf("a = %d, b = %d\n", a, b);
  b = a;
  printf("a = %d, b = %d\n", a, b);
  x = a + b;
  printf("a = %d, b = %d, x = (a + b) = (%d + %d) = %d\n", a, b, a, b, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x10(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x8(%rbp),%r9d
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0xa,%r8d
mov    $0x14,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
@.str.1 = [46 x i8] c"a = %d, b = %d, x = (a + b) = (%d + %d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 10)
%3 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 10, i32 10, i32 10, i32 20)
ret i32 0
}