#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 f1(int *a, int *b) {
  printf("\nin f1:\n");
  printf("* a = %d; * b = %d;\nf1 returns = %d;\n", *a, *b, (*a + *b));
  *a += 1;
  *b += 3;
  return ((*a) + (*b));
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x3,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
lea    (%rdx,%rsi,1),%ecx
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x1,(%r14)
mov    (%rbx),%eax
add    $0x3,%eax
mov    %eax,(%rbx)
add    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [38 x i8] c"* a = %d; * b = %d;\0Af1 returns = %d;\0A\00"
@str = [8 x i8] c"\0Ain f1:\00"
define i32 @f1(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
%8 = load i32, i32* %0
%9 = add nsw i32 %8, 1
store i32 %9, i32* %0
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 3
store i32 %11, i32* %1
%12 = load i32, i32* %0
%13 = add nsw i32 %12, %11
ret i32 %13
}