#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 *, ...);
char test_pointer(char **);
int /*<<< orphan*/ test_pointer_2(char ***);
int main(int argc, char *argv[]) {
  int i = 0;
  char rez = 0;
  char *ptr_1[100];
  char *ptr_2;
  *ptr_1 = *argv;
  *ptr_2 = **argv;
  printf("in main ptr_1 = %p, * ptr_1 = '%s' as string.\n", ptr_1, *ptr_1);
  printf("in main ptr_2 = %p, * ptr_2 = '%c' as char.\n", ptr_2, *ptr_2);
  rez = test_pointer(&ptr_2);
  test_pointer_2(&ptr_1);
  printf("1234\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movb   $0x0,-0x15(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x340(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%cl
mov    -0x348(%rbp),%rax
mov    %cl,(%rax)
lea    -0x340(%rbp),%rsi
mov    -0x340(%rbp),%rdx
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x348(%rbp),%rsi
mov    -0x348(%rbp),%rax
movsbl (%rax),%edx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x348(%rbp),%rdi
call   1050 <test_pointer@plt>
mov    %al,-0x15(%rbp)
lea    -0x340(%rbp),%rdi
call   1040 <test_pointer_2@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [47 x i8] c"in main ptr_1 = %p, * ptr_1 = '%s' as string.\0A\00"
@.str.1 = [45 x i8] c"in main ptr_2 = %p, * ptr_2 = '%c' as char.\0A\00"
@.str.2 = [6 x i8] c"1234\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
%8 = alloca [100 x i8*]
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8 0, i8* %7
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
%12 = getelementptr inbounds [100 x i8*], [100 x i8*]* %8, i64 0, i64 0
store i8* %11, i8** %12
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = load i8*, i8** %9
store i8 %15, i8* %16
%17 = getelementptr inbounds [100 x i8*], [100 x i8*]* %8, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8*], [100 x i8*]* %8, i64 0, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %17, i8* %19)
%21 = load i8*, i8** %9
%22 = load i8*, i8** %9
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %21, i32 %24)
%26 = call signext i8 @test_pointer(i8** %9)
store i8 %26, i8* %7
%27 = bitcast [100 x i8*]* %8 to i8***
%28 = call i32 @test_pointer_2(i8*** %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):