#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 *a1, int *a2) {
  printf("\n============\n");
  printf("in f1:\n");
  printf("getted values: * a1 = %d; * a2 = %d;\n", *a1, *a2);
  printf("f1 returns power of * a1 and * a2 = %d;\n", (*a1) * (*a2));
  return ((*a1) * (*a2));
}


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>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
imul   (%rax),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%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    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
imul   (%r14),%esi
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%eax
imul   (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0A============\0A\00"
@.str.1 = [8 x i8] c"in f1:\0A\00"
@.str.2 = [38 x i8] c"getted values: * a1 = %d; * a2 = %d;\0A\00"
@.str.3 = [41 x i8] c"f1 returns power of * a1 and * a2 = %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 ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %10)
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = mul nsw i32 %13, %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32*, i32** %3
%19 = load i32, i32* %18
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
%22 = mul nsw i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
@.str.2 = [38 x i8] c"getted values: * a1 = %d; * a2 = %d;\0A\00"
@.str.3 = [41 x i8] c"f1 returns power of * a1 and * a2 = %d;\0A\00"
@str = [14 x i8] c"\0A============\00"
@str.4 = [7 x i8] c"in f1:\00"
define i32 @f1(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, %8
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %0
%13 = load i32, i32* %1
%14 = mul nsw i32 %13, %12
ret i32 %14
}