#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 */
scalar_t__ atol(char *);
int f(long long, int);
int /*<<< orphan*/ printf(char *, long long);
int main(int argc, char **argv) {
  long long m = (argc > 1) ? (int)atol(argv[1]) : 1;
  printf("Here we go %lld\n", m);
  int rv = f(((long long)1) << (m - 1), 1);
  return rv;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1165 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atol@plt>
mov    %eax,-0x20(%rbp)
jmp    1172 <main+0x42>
mov    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1172 <main+0x42>
mov    -0x20(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
mov    $0x1,%edi
shl    %cl,%rdi
mov    $0x1,%esi
call   1030 <f@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1150 <main+0x20>
mov    0x8(%rsi),%rdi
call   1050 <atol@plt>
movslq %eax,%rbx
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0xff,%bl
mov    %ebx,%ecx
shl    %cl,%r14
mov    %r14,%rdi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <f@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Here we go %lld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @atol(i8* %13)
%15 = trunc i64 %14 to i32
br label %17
16: ; preds = %2
br label %17
17: ; preds = %16, %10
%18 = phi i32 [ %15, %10 ], [ 1, %16 ]
%19 = sext i32 %18 to i64
store i64 %19, i64* %6
%20 = load i64, i64* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %20)
%22 = load i64, i64* %6
%23 = sub nsw i64 %22, 1
%24 = shl i64 1, %23
%25 = call i32 @f(i64 %24, i32 1)
store i32 %25, i32* %7
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
@.str = [17 x i8] c"Here we go %lld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @atol(i8* %6)
%8 = shl i64 %7, 32
%9 = ashr exact i64 %8, 32
br label %10
10: ; preds = %2, %4
%11 = phi i64 [ %9, %4 ], [ 1, %2 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = add nsw i64 %11, -1
%14 = shl nuw i64 1, %13
%15 = tail call i32 @f(i64 %14, i32 1)
ret i32 %15
}