#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 my_atoi(char *);
int my_lower(char);
int /*<<< orphan*/ printf(char *, int);
void part_2_7() {
  printf("%d\n", my_atoi("12345"));
  printf("%d\n", my_atoi("12345qwerty"));
  printf("%c", my_lower('P'));
  printf("%c", my_lower('I'));
  printf("%c", my_lower('g'));
}


x86 assembly (clang, -O0):
<part_2_7>:
push   %rbp
mov    %rsp,%rbp
lea    0xec9(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x50,%edi
call   1050 <my_lower@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x49,%edi
call   1050 <my_lower@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
mov    $0x67,%edi
call   1050 <my_lower@plt>
mov    %eax,%esi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<part_2_7>:
push   %rbx
lea    0xecc(%rip),%rdi
call   1030 <my_atoi@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x50,%edi
call   1050 <my_lower@plt>
lea    0xea1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x49,%edi
call   1050 <my_lower@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x67,%edi
call   1050 <my_lower@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"12345\00"
@.str.2 = [12 x i8] c"12345qwerty\00"
@.str.3 = [3 x i8] c"%c\00"
define void @part_2_7() {
%1 = call i32 @my_atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @my_atoi(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @my_lower(i8 signext 80)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = call i32 @my_lower(i8 signext 73)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @my_lower(i8 signext 103)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"12345\00"
@.str.2 = [12 x i8] c"12345qwerty\00"
@.str.3 = [3 x i8] c"%c\00"
define void @part_2_7() {
%1 = tail call i32 @my_atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @my_atoi(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @my_lower(i8 signext 80)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = tail call i32 @my_lower(i8 signext 73)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @my_lower(i8 signext 103)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %9)
ret void
}