#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 */
char *funChar(char *, char *);
int *funInt(int *, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char ch1, ch2;
  int i1, i2;
  char *cptr;
  int *iptr;
  ch1 = 'a', ch2 = 'b';
  i1 = 10, i2 = 20;
  cptr = funChar(&ch1, &ch2);
  printf("%c\n", *cptr);
  iptr = funInt(&i1, &i2);
  printf("%d\n", *iptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x62,-0x6(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x14,-0x10(%rbp)
lea    -0x5(%rbp),%rdi
lea    -0x6(%rbp),%rsi
call   1030 <funChar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <funInt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xe6d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x61,0xf(%rsp)
movb   $0x62,0xe(%rsp)
movl   $0xa,0x14(%rsp)
movl   $0x14,0x10(%rsp)
lea    0xf(%rsp),%rdi
lea    0xe(%rsp),%rsi
call   1030 <funChar@plt>
movsbl (%rax),%esi
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <funInt@plt>
mov    (%rax),%esi
lea    0xe80(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
store i32 0, i32* %1
store i8 97, i8* %2
store i8 98, i8* %3
store i32 10, i32* %4
store i32 20, i32* %5
%8 = call i8* @funChar(i8* %2, i8* %3)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32* @funInt(i32* %4, i32* %5)
store i32* %13, i32** %7
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i8 97, i8* %1
store i8 98, i8* %2
store i32 10, i32* %3
store i32 20, i32* %4
%7 = call i8* @funChar(i8* %1, i8* %2)
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32* @funInt(i32* %3, i32* %4)
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}