#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 sub_fun_1(char *res, char x, char y) {
  printf("sub_fun_1_1\n");
  ;
  printf("sub_fun_1_2\n");
  *res = x + y;
  ;
  printf("sub_fun_1_3\n");
  ;
  printf("sub_fun_1_4\n");
}


x86 assembly (clang, -O0):
<sub_fun_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x9(%rbp),%eax
movsbl -0xa(%rbp),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_fun_1>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
add    %bpl,%bl
mov    %bl,(%r14)
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"sub_fun_1_1\0A\00"
@.str.1 = [13 x i8] c"sub_fun_1_2\0A\00"
@.str.2 = [13 x i8] c"sub_fun_1_3\0A\00"
@.str.3 = [13 x i8] c"sub_fun_1_4\0A\00"
define void @sub_fun_1(i8* %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
%13 = add nsw i32 %10, %12
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
store i8 %14, i8* %15
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"sub_fun_1_1\00"
@str.4 = [12 x i8] c"sub_fun_1_2\00"
@str.5 = [12 x i8] c"sub_fun_1_3\00"
@str.6 = [12 x i8] c"sub_fun_1_4\00"
define void @sub_fun_1(i8* nocapture writeonly %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
%6 = add i8 %2, %1
store i8 %6, i8* %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.5, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0))
ret void
}