#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 add(int, int);
int mult(int, int);
int /*<<< orphan*/ printf(char *, ...);
int subtract(int, int);
void main(void) {
  int a = 12;
  int b = -21;
  int c = 0;
  int d = 0;
  int e = 0;
  printf("hello!\n");
  printf("a = %d, b = %d, c = %d, d = %d, e = %d\n", a, b, c, d, e);
  c = add(a, b);
  d = subtract(a, b);
  e = mult(a, b);
  printf("a = %d, b = %d, c = %d, d = %d, e = %d\n", a, b, c, d, e);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc,-0x4(%rbp)
movl   $0xffffffeb,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <subtract@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <mult@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
lea    0xe99(%rip),%r14
mov    %r14,%rdi
mov    $0xc,%esi
mov    $0xffffffeb,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xc,%edi
mov    $0xffffffeb,%esi
call   1030 <add@plt>
mov    %eax,%ebp
mov    $0xc,%edi
mov    $0xffffffeb,%esi
call   1070 <subtract@plt>
mov    %eax,%ebx
mov    $0xc,%edi
mov    $0xffffffeb,%esi
call   1060 <mult@plt>
mov    %r14,%rdi
mov    $0xc,%esi
mov    $0xffffffeb,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
mov    %eax,%r9d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [40 x i8] c"a = %d, b = %d, c = %d, d = %d, e = %d\0A\00"
@str = [7 x i8] c"hello!\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 12, i32 -21, i32 0, i32 0, i32 0)
%3 = tail call i32 @add(i32 12, i32 -21)
%4 = tail call i32 @subtract(i32 12, i32 -21)
%5 = tail call i32 @mult(i32 12, i32 -21)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 12, i32 -21, i32 %3, i32 %4, i32 %5)
ret void
}