int main(int argc, char *argv[]) {
  char user_input[100];
  int *secret;
  int int_input;
  int a, b, c, d;
  secret = (int *)malloc(2 * sizeof(int));
  secret[0] = 0x44;
  secret[1] = 0x55;
  printf("The variable secret's address is 0x%8x (on stack)\n", &secret);
  printf("The variable secret's value is 0x%8x (on heap)\n", secret);
  printf("secret[0]'s address is 0x%8x (on heap)\n", &secret[0]);
  printf("secret[1]'s address is 0x%8x (on heap)\n", &secret[1]);
  printf("Please enter a decimal integer\n");
  scanf("%d", &int_input);
  printf("Please enter a string\n");
  scanf("%s", user_input);
  printf(user_input);
  printf("\n");
  printf("The original secrets: 0x%x -- 0x%x\n", 0x44, 0x55);
  printf("The new secrets:      0x%x -- 0x%x\n", secret[0], secret[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
movl   $0x44,(%rax)
mov    -0x88(%rbp),%rax
movl   $0x55,0x4(%rax)
lea    0xe84(%rip),%rdi
lea    -0x88(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%rsi
add    $0x4,%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x8c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x44,%esi
mov    $0x55,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%rax
mov    (%rax),%esi
mov    -0x88(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,(%rsp)
movabs $0x5500000044,%rcx
mov    %rcx,(%rax)
lea    0xe86(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rsi
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rsi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rsi
add    $0x4,%rsi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf3c(%rip),%rdi
call   1040 <puts@plt>
lea    0xee2(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xf3c(%rip),%rdi
call   1040 <puts@plt>
lea    0xec6(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9f(%rip),%rdi
mov    $0x44,%esi
mov    $0x55,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"The variable secret's address is 0x%8x (on stack)\0A\00"
@.str.1 = [48 x i8] c"The variable secret's value is 0x%8x (on heap)\0A\00"
@.str.2 = [40 x i8] c"secret[0]'s address is 0x%8x (on heap)\0A\00"
@.str.3 = [40 x i8] c"secret[1]'s address is 0x%8x (on heap)\0A\00"
@.str.4 = [32 x i8] c"Please enter a decimal integer\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [23 x i8] c"Please enter a string\0A\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [36 x i8] c"The original secrets: 0x%x -- 0x%x\0A\00"
@.str.10 = [36 x i8] c"The new secrets: 0x%x -- 0x%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i8* @malloc(i64 8)
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %7
%15 = load i32*, i32** %7
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 68, i32* %16
%17 = load i32*, i32** %7
%18 = getelementptr inbounds i32, i32* %17, i64 1
store i32 85, i32* %18
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32** %7)
%20 = load i32*, i32** %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = load i32*, i32** %7
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32* %23)
%25 = load i32*, i32** %7
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32* %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 68, i32 85)
%37 = load i32*, i32** %7
%38 = getelementptr inbounds i32, i32* %37, i64 0
%39 = load i32, i32* %38
%40 = load i32*, i32** %7
%41 = getelementptr inbounds i32, i32* %40, i64 1
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i32 %39, i32 %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"The variable secret's address is 0x%8x (on stack)\0A\00"
@.str.1 = [48 x i8] c"The variable secret's value is 0x%8x (on heap)\0A\00"
@.str.2 = [40 x i8] c"secret[0]'s address is 0x%8x (on heap)\0A\00"
@.str.3 = [40 x i8] c"secret[1]'s address is 0x%8x (on heap)\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.9 = [36 x i8] c"The original secrets: 0x%x -- 0x%x\0A\00"
@.str.10 = [36 x i8] c"The new secrets: 0x%x -- 0x%x\0A\00"
@str = [31 x i8] c"Please enter a decimal integer\00"
@str.11 = [22 x i8] c"Please enter a string\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca i32*
%5 = alloca i32
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = bitcast i32** %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%10 = bitcast i8* %9 to i32*
%11 = bitcast i32** %4 to i8**
store i8* %9, i8** %11
store i32 68, i32* %10
%12 = getelementptr inbounds i32, i32* %10, i64 1
store i32 85, i32* %12
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32** %4)
%14 = load i32*, i32** %4
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32*, i32** %4
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32* %16)
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32* %19)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.11, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%25 = call i32 (i8*, ...) @printf(i8* %6)
%26 = call i32 @putchar(i32 10)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 68, i32 85)
%28 = load i32*, i32** %4
%29 = load i32, i32* %28
%30 = getelementptr inbounds i32, i32* %28, i64 1
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i32 %29, i32 %31)
ret i32 0
}