#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);
int twiddle1(int *, int *);
int twiddle2(int *, int *);
int main(void) {
  int a, b;
  a = 0;
  b = 2;
  printf("%d ", twiddle1(&a, &b));
  a = 0;
  b = 2;
  printf("%d ", twiddle2(&a, &b));
  a = 0;
  b = 2;
  printf("%d ", twiddle1(&b, &b));
  a = 0;
  b = 2;
  printf("%d\n", twiddle2(&b, &b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <twiddle1@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <twiddle2@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <twiddle1@plt>
mov    %eax,%esi
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
mov    %rsi,%rdi
call   1050 <twiddle2@plt>
mov    %eax,%esi
lea    0xe2f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x2,0x8(%rsp)
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <twiddle1@plt>
lea    0xe9b(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movl   $0x0,0xc(%rsp)
movl   $0x2,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <twiddle2@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movl   $0x0,0xc(%rsp)
movl   $0x2,0x8(%rsp)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <twiddle1@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movl   $0x0,0xc(%rsp)
movl   $0x2,0x8(%rsp)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1050 <twiddle2@plt>
lea    0xe29(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = call i32 @twiddle1(i32* %1, i32* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 0, i32* %1
store i32 2, i32* %2
%5 = call i32 @twiddle2(i32* %1, i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 0, i32* %1
store i32 2, i32* %2
%7 = call i32 @twiddle1(i32* %2, i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 0, i32* %1
store i32 2, i32* %2
%9 = call i32 @twiddle2(i32* %2, i32* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %1
store i32 2, i32* %2
%5 = call i32 @twiddle1(i32* %1, i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 0, i32* %1
store i32 2, i32* %2
%7 = call i32 @twiddle2(i32* %1, i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 0, i32* %1
store i32 2, i32* %2
%9 = call i32 @twiddle1(i32* %2, i32* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 0, i32* %1
store i32 2, i32* %2
%11 = call i32 @twiddle2(i32* %2, i32* %2)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}