#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 /*<<< orphan*/ scanf(char *, char **);
int /*<<< orphan*/ strcat(char *, char *);
int strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void make_manipulation() {
  double number1 = 7.3, number2;
  char s1[100], s2[100];
  double *dPtr;
  dPtr = &number1;
  printf("Value of dPtr: %lf\n", *dPtr);
  number2 = *dPtr;
  printf("Value of number2: %lf\n", number2);
  printf("Pointer to number1: %p\n", &number1);
  printf("Pointer to dPtr: %p\n", dPtr);
  printf("Put a string: ");
  scanf("%s", &s1);
  strcpy(s2, s1);
  int compare = strcmp(s1, s2);
  printf("Compare to s1 and s2: %d\n", compare);
  strcat(s1, s2);
  printf("Concat of s1 and s2: %s\n", s1);
  int len = strlen(s1);
  printf("Len of |%s| is |%d|\n", s1, len);
}


x86 assembly (clang, -O0):
<make_manipulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  0xe8d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe73(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0xf8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe64(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xf8(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1070 <scanf@plt>
lea    -0xf0(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1060 <strcmp@plt>
mov    %eax,-0xfc(%rbp)
mov    -0xfc(%rbp),%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1080 <strcat@plt>
lea    -0x80(%rbp),%rsi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x100(%rbp)
lea    -0x80(%rbp),%rsi
mov    -0x100(%rbp),%edx
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_manipulation>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
movabs $0x401d333333333333,%rax
33 1d 40
mov    %rax,0x8(%rsp)
lea    0xe88(%rip),%rdi
movsd  0xe78(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe86(%rip),%rdi
movsd  0xe62(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe89(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    0x80(%rsp),%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
lea    0xe5f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
lea    0xe5e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe5e(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Value of dPtr: %lf\0A\00"
@.str.1 = [23 x i8] c"Value of number2: %lf\0A\00"
@.str.2 = [24 x i8] c"Pointer to number1: %p\0A\00"
@.str.3 = [21 x i8] c"Pointer to dPtr: %p\0A\00"
@.str.4 = [15 x i8] c"Put a string: \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [26 x i8] c"Compare to s1 and s2: %d\0A\00"
@.str.7 = [25 x i8] c"Concat of s1 and s2: %s\0A\00"
@.str.8 = [21 x i8] c"Len of |%s| is |%d|\0A\00"
define void @make_manipulation() {
%1 = alloca double
%2 = alloca double
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
store double 7.300000e+00, double* %1
store double* %1, double** %5
%8 = load double*, double** %5
%9 = load double, double* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %9)
%11 = load double*, double** %5
%12 = load double, double* %11
store double %12, double* %2
%13 = load double, double* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double* %1)
%16 = load double*, double** %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%19 = bitcast [100 x i8]* %3 to i8**
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %19)
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%23 = call i32 @strcpy(i8* %21, i8* %22)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%26 = call i32 @strcmp(i8* %24, i8* %25)
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%31 = call i32 @strcat(i8* %29, i8* %30)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
store i32 %35, i32* %7
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%37 = load i32, i32* %7
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %36, i32 %37)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Value of dPtr: %lf\0A\00"
@.str.1 = [23 x i8] c"Value of number2: %lf\0A\00"
@.str.2 = [24 x i8] c"Pointer to number1: %p\0A\00"
@.str.3 = [21 x i8] c"Pointer to dPtr: %p\0A\00"
@.str.4 = [15 x i8] c"Put a string: \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [26 x i8] c"Compare to s1 and s2: %d\0A\00"
@.str.7 = [25 x i8] c"Concat of s1 and s2: %s\0A\00"
@.str.8 = [21 x i8] c"Len of |%s| is |%d|\0A\00"
define void @make_manipulation() {
%1 = alloca double
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = bitcast double* %1 to i8*
store double 7.300000e+00, double* %1
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double 7.300000e+00)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double 7.300000e+00)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%12 = bitcast [100 x i8]* %2 to i8**
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %12)
%14 = call i32 @strcpy(i8* %6, i8* %5)
%15 = call i32 @strcmp(i8* %5, i8* %6)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%17 = call i32 @strcat(i8* %5, i8* %6)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %5)
%19 = call i32 @strlen(i8* %5)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %5, i32 %19)
ret void
}