#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 *, ...);
void int_add_sub(int *i1, int *i2, int *i3) {
  printf("\n");
  printf("INT_ADD_SUB:\n");
  printf("  Input I1 = %d.\n", *i1);
  printf("  Input I2 = %d.\n", *i2);
  *i3 = *i1 + *i2;
  printf("  Output I3 = %d.\n", *i3);
}


x86 assembly (clang, -O0):
<int_add_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_add_sub>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
mov    (%r15),%esi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
add    (%r15),%esi
mov    %esi,(%r14)
lea    0xea0(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [14 x i8] c"INT_ADD_SUB:\0A\00"
@.str.2 = [18 x i8] c" Input I1 = %d.\0A\00"
@.str.3 = [18 x i8] c" Input I2 = %d.\0A\00"
@.str.4 = [19 x i8] c" Output I3 = %d.\0A\00"
define void @int_add_sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = add nsw i32 %16, %18
%20 = load i32*, i32** %6
store i32 %19, i32* %20
%21 = load i32*, i32** %6
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %22)
ret void
}

LLVM IR (-O2):
@.str.2 = [18 x i8] c" Input I1 = %d.\0A\00"
@.str.3 = [18 x i8] c" Input I2 = %d.\0A\00"
@.str.4 = [19 x i8] c" Output I3 = %d.\0A\00"
@str = [13 x i8] c"INT_ADD_SUB:\00"
define void @int_add_sub(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* %0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %0
%11 = load i32, i32* %1
%12 = add nsw i32 %11, %10
store i32 %12, i32* %2
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %12)
ret void
}