xunge/DecIR huggingface dataset:
int WIFI_POWER_SHUTDOWN(void) { return 0; }


x86 assembly (clang, -O0):
<WIFI_POWER_SHUTDOWN>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WIFI_POWER_SHUTDOWN>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @WIFI_POWER_SHUTDOWN() {
ret i32 0
}

LLVM IR (-O2):
define i32 @WIFI_POWER_SHUTDOWN() {
ret i32 0
}
/* Variables and functions */
void *malloc(int);
int initMemory(int n, void *p) {
  p = malloc(n);
  return 0;
}


x86 assembly (clang, -O0):
<initMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initMemory>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @initMemory(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i8* @malloc(i32 %5)
store i8* %6, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @initMemory(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct timespec {
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long round(double);
long TimeStamp() {
  struct timespec spec;
  clock_gettime(CLOCK_REALTIME, &spec);
  return round(spec.tv_nsec / 1.0e6);
}


x86 assembly (clang, -O0):
<TimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeStamp>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movsd  (%rsp),%xmm0
divsd  0xec1(%rip),%xmm0
call   1040 <round@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { double }
@CLOCK_REALTIME = global i32 0
define i64 @TimeStamp() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
%7 = call i64 @round(double %6)
ret i64 %7
}

LLVM IR (-O2):
%struct.timespec = type { double }
@CLOCK_REALTIME = global i32 0
define i64 @TimeStamp() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = call i64 @round(double %7)
ret i64 %8
}
void interrupt_pendsv(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<interrupt_pendsv>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <interrupt_pendsv+0x9>
jmp    1109 <interrupt_pendsv+0x9>

x86 assembly (clang, -O2):
<interrupt_pendsv>:
jmp    1100 <interrupt_pendsv>

LLVM IR (-O0):
define void @interrupt_pendsv() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @interrupt_pendsv() {
br label %1
1: ; preds = %0, %1
br label %1
}
void func5(float *fp) {
#pragma acc data deviceptr(fp)
  ;
}


x86 assembly (clang, -O0):
<func5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func5>:
ret

LLVM IR (-O0):
define void @func5(float* %0) {
%2 = alloca float*
store float* %0, float** %2
ret void
}

LLVM IR (-O2):
define void @func5(float* nocapture %0) {
ret void
}
/* Variables and functions */
__attribute__((__nothrow__))
__my_memcpy_chk(void *__restrict __dest, __const void *__restrict __src,
                size_t __len, size_t buf_len) {}


x86 assembly (clang, -O0):
<__my_memcpy_chk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__my_memcpy_chk>:
ret

LLVM IR (-O0):
define i32 @__my_memcpy_chk(i8* noalias %0, i8* noalias %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @__my_memcpy_chk(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i64 %2, i64 %3) {
ret i32 undef
}
long e4c_library_version(void) {
  return ((long)(((long)0 * 10000000L) + ((long)3 * 1000000L) +
                 ((long)0 * 1000L) + ((long)6 * 1L)));
}


x86 assembly (clang, -O0):
<e4c_library_version>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2dc6c6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e4c_library_version>:
mov    $0x2dc6c6,%eax
ret

LLVM IR (-O0):
define i64 @e4c_library_version() {
ret i64 3000006
}

LLVM IR (-O2):
define i64 @e4c_library_version() {
ret i64 3000006
}
double fibonacci(int n) {
  if (n <= 2) {
    return 1;
  } else
    return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1137 <fibonacci+0x27>
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1163 <fibonacci+0x53>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jg     1124 <fibonacci+0x14>
movsd  0xede(%rip),%xmm0
jmp    1144 <fibonacci+0x34>
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
movsd  %xmm0,0x8(%rsp)
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <fibonacci@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fibonacci(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call double @fibonacci(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = call double @fibonacci(i32 %12)
%14 = fadd double %10, %13
store double %14, double* %2
br label %15
15: ; preds = %7, %6
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %10, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call double @fibonacci(i32 %6)
%8 = add nsw i32 %0, -2
%9 = tail call double @fibonacci(i32 %8)
%10 = fadd double %7, %9
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
char *dstrinsn(char *, size_t, char *);
char *dvsprintf(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *dvsprintfi(char *dest, size_t pos, const char *fmt, va_list args) {
  char *ins = dvsprintf(fmt, args);
  char *ret;
  if (dest == NULL)
    return ins;
  ret = dstrinsn(dest, pos, ins);
  free(ins);
  return ret;
}


x86 assembly (clang, -O0):
<dvsprintfi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <dvsprintf@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <dvsprintfi+0x3f>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1195 <dvsprintfi+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <dstrinsn@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvsprintfi>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
mov    %ecx,%esi
call   1050 <dvsprintf@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     116b <dvsprintfi+0x3b>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <dstrinsn@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
jmp    116e <dvsprintfi+0x3e>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @dvsprintfi(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%12 = load i8*, i8** %8
%13 = load i32, i32* %9
%14 = call i8* @dvsprintf(i8* %12, i32 %13)
store i8* %14, i8** %10
%15 = load i8*, i8** %6
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = load i8*, i8** %10
store i8* %18, i8** %5
br label %27
19: ; preds = %4
%20 = load i8*, i8** %6
%21 = load i64, i64* %7
%22 = load i8*, i8** %10
%23 = call i8* @dstrinsn(i8* %20, i64 %21, i8* %22)
store i8* %23, i8** %11
%24 = load i8*, i8** %10
%25 = call i32 @free(i8* %24)
%26 = load i8*, i8** %11
store i8* %26, i8** %5
br label %27
27: ; preds = %19, %17
%28 = load i8*, i8** %5
ret i8* %28
}

LLVM IR (-O2):
define i8* @dvsprintfi(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @dvsprintf(i8* %2, i32 %3)
%6 = icmp eq i8* %0, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i8* @dstrinsn(i8* %0, i64 %1, i8* %5)
%9 = tail call i32 @free(i8* %5)
br label %10
10: ; preds = %4, %7
%11 = phi i8* [ %8, %7 ], [ %5, %4 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *);
void usage() {
  extern const char *__progname;
  errx(1, "usage: %s [-bp]", __progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xed6(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rdx
lea    0xedf(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"usage: %s [-bp]\00"
@__progname = external global i8*
define void @usage() {
%1 = load i8*, i8** @__progname
%2 = call i32 @errx(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"usage: %s [-bp]\00"
@__progname = external global i8*
define void @usage() {
%1 = load i8*, i8** @__progname
%2 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void answer_computer(void) {}


x86 assembly (clang, -O0):
<answer_computer>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer_computer>:
ret

LLVM IR (-O0):
define void @answer_computer() {
ret void
}

LLVM IR (-O2):
define void @answer_computer() {
ret void
}
void UARTDSRInterruptControl(unsigned int baseAdd, unsigned int controlFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x40)))) &= ~((0x00000020u));
  (*((volatile unsigned int *)(baseAdd + (0x40)))) |=
      (controlFlag & (0x00000020u));
}


x86 assembly (clang, -O0):
<UARTDSRInterruptControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x20,%edx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDSRInterruptControl>:
add    $0x40,%edi
andl   $0xffffffdf,(%rdi)
and    $0x20,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTDSRInterruptControl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 64
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -33
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 32
%13 = load i32, i32* %3
%14 = add i32 %13, 64
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTDSRInterruptControl(i32 %0, i32 %1) {
%3 = add i32 %0, 64
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -33
store volatile i32 %7, i32* %5
%8 = and i32 %1, 32
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Type definitions */
struct out {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pf(struct out *, char *, char const *, char const *);
void print_include(struct out *out, const char *filename, const char *postfix) {
  pf(out, "# include \"%s%s\"\n", filename, postfix);
}


x86 assembly (clang, -O0):
<print_include>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <pf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_include>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <pf@plt>

LLVM IR (-O0):
%struct.out = type { i32 }
@.str = [18 x i8] c"# include \22%s%s\22\0A\00"
define void @print_include(%struct.out* %0, i8* %1, i8* %2) {
%4 = alloca %struct.out*
%5 = alloca i8*
%6 = alloca i8*
store %struct.out* %0, %struct.out** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.out*, %struct.out** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @pf(%struct.out* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.out = type { i32 }
@.str = [18 x i8] c"# include \22%s%s\22\0A\00"
define void @print_include(%struct.out* %0, i8* %1, i8* %2) {
%4 = tail call i32 @pf(%struct.out* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double my_wtime_() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<my_wtime_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_wtime_>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @my_wtime_() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @my_wtime_() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ bar(void *);
void f(void *cd) { bar(((void *)((unsigned long)(cd) ^ -1))); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    $0xffffffffffffffff,%rdi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
not    %rdi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = xor i64 %4, -1
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @bar(i8* %6)
ret void
}

LLVM IR (-O2):
define void @f(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = xor i64 %2, -1
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @bar(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isupper(int /*<<< orphan*/);
int iswupper(wint_t wc) { return isupper(wc); }


x86 assembly (clang, -O0):
<iswupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswupper>:
jmp    1030 <isupper@plt>

LLVM IR (-O0):
define i32 @iswupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isupper(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @iswupper(i32 %0) {
%2 = tail call i32 @isupper(i32 %0)
ret i32 %2
}
/* Variables and functions */
int newDbGetLastupdateDevicesDev(int /*<<< orphan*/, int /*<<< orphan*/);
int newDbGetLastupdateDevices(void) {
  return newDbGetLastupdateDevicesDev(0, 0);
}


x86 assembly (clang, -O0):
<newDbGetLastupdateDevices>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <newDbGetLastupdateDevicesDev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newDbGetLastupdateDevices>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <newDbGetLastupdateDevicesDev@plt>

LLVM IR (-O0):
define i32 @newDbGetLastupdateDevices() {
%1 = call i32 @newDbGetLastupdateDevicesDev(i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @newDbGetLastupdateDevices() {
%1 = tail call i32 @newDbGetLastupdateDevicesDev(i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ rffti1(size_t, double *, size_t *);
void rffti(size_t n, double wsave[]) {
  if (n != 1)
    rffti1(n, wsave + n, (size_t *)(wsave + 2 * n));
}


x86 assembly (clang, -O0):
<rffti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     1156 <rffti+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <rffti1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rffti>:
cmp    $0x1,%rdi
jne    1117 <rffti+0x7>
ret
lea    (%rsi,%rdi,8),%rax
mov    %rdi,%rdx
shl    $0x4,%rdx
add    %rsi,%rdx
mov    %rax,%rsi
jmp    1030 <rffti1@plt>

LLVM IR (-O0):
define void @rffti(i64 %0, double* %1) {
%3 = alloca i64
%4 = alloca double*
store i64 %0, i64* %3
store double* %1, double** %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 1
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i64, i64* %3
%9 = load double*, double** %4
%10 = load i64, i64* %3
%11 = getelementptr inbounds double, double* %9, i64 %10
%12 = load double*, double** %4
%13 = load i64, i64* %3
%14 = mul i64 2, %13
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = bitcast double* %15 to i64*
%17 = call i32 @rffti1(i64 %8, double* %11, i64* %16)
br label %18
18: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @rffti(i64 %0, double* %1) {
%3 = icmp eq i64 %0, 1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds double, double* %1, i64 %0
%6 = shl i64 %0, 1
%7 = getelementptr inbounds double, double* %1, i64 %6
%8 = bitcast double* %7 to i64*
%9 = tail call i32 @rffti1(i64 %0, double* %5, i64* %8)
br label %10
10: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef char wchar_t;
struct _Locale_time {
  int dummy;
};

/* Variables and functions */
const wchar_t *_WLocale_pm_str(struct _Locale_time *ltime, wchar_t *buf,
                               size_t bufSize) {
  return L"PM";
}


x86 assembly (clang, -O0):
<_WLocale_pm_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_WLocale_pm_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct._Locale_time = type { i32 }
@.str = [3 x i32] [i32 80, i32 77, i32 0]
define i8* @_WLocale_pm_str(%struct._Locale_time* %0, i8* %1, i64 %2) {
%4 = alloca %struct._Locale_time*
%5 = alloca i8*
%6 = alloca i64
store %struct._Locale_time* %0, %struct._Locale_time** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* bitcast ([3 x i32]* @.str to i8*)
}

LLVM IR (-O2):
%struct._Locale_time = type { i32 }
@.str = [3 x i32] [i32 80, i32 77, i32 0]
define i8* @_WLocale_pm_str(%struct._Locale_time* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* bitcast ([3 x i32]* @.str to i8*)
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_filename(char *str) {
  char *p = strrchr(str, '/');
  return p ? &p[1] : str;
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <get_filename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <get_filename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @get_filename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0xFFFF803C))) =
      (ui32IntFlags & 0x00070000) >> 16;
}


x86 assembly (clang, -O0):
<DESIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x70000,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    $0xffff803c,%eax
mov    %eax,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIntClear>:
shr    $0x10,%esi
and    $0x7,%esi
add    $0xffff803c,%edi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @DESIntClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 458752
%7 = ashr i32 %6, 16
%8 = sext i32 %7 to i64
%9 = load i32, i32* %3
%10 = add i32 %9, -32708
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i64*
store volatile i64 %8, i64* %12
ret void
}

LLVM IR (-O2):
define void @DESIntClear(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 7
%5 = zext i32 %4 to i64
%6 = add i32 %0, -32708
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}
/* Type definitions */
struct mtwist_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mtwist_state *);
void mtwist_free(struct mtwist_state *mt) {
  if (mt)
    free(mt);
}


x86 assembly (clang, -O0):
<mtwist_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <mtwist_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtwist_free>:
test   %rdi,%rdi
je     111a <mtwist_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.mtwist_state = type { i32 }
define void @mtwist_free(%struct.mtwist_state* %0) {
%2 = alloca %struct.mtwist_state*
store %struct.mtwist_state* %0, %struct.mtwist_state** %2
%3 = load %struct.mtwist_state*, %struct.mtwist_state** %2
%4 = icmp ne %struct.mtwist_state* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.mtwist_state*, %struct.mtwist_state** %2
%7 = call i32 @free(%struct.mtwist_state* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.mtwist_state = type { i32 }
define void @mtwist_free(%struct.mtwist_state* %0) {
%2 = icmp eq %struct.mtwist_state* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.mtwist_state* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void Timer_1_SaveConfig(void) {}


x86 assembly (clang, -O0):
<Timer_1_SaveConfig>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer_1_SaveConfig>:
ret

LLVM IR (-O0):
define void @Timer_1_SaveConfig() {
ret void
}

LLVM IR (-O2):
define void @Timer_1_SaveConfig() {
ret void
}
int filterAdultWeight_bool(char AdultWeight, int noadultpages) {
  if (noadultpages > 10) {
    if (AdultWeight) {
      return 1;
    } else {
      return 0;
    }
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<filterAdultWeight_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jle    1139 <filterAdultWeight_bool+0x39>
cmpb   $0x0,-0x5(%rbp)
je     112d <filterAdultWeight_bool+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1140 <filterAdultWeight_bool+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1140 <filterAdultWeight_bool+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterAdultWeight_bool>:
cmp    $0xb,%esi
setge  %al
test   %dil,%dil
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @filterAdultWeight_bool(i8 signext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8, i8* %4
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %3
br label %14
12: ; preds = %8
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @filterAdultWeight_bool(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 10
%4 = icmp ne i8 %0, 0
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int remove(char const *);
void Remove(const char *pathname) {
  int retval;
  retval = remove(pathname);
  if (retval == -1)
    Sys_failure("remove");
}


x86 assembly (clang, -O0):
<Remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    114e <Remove+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Remove>:
push   %rax
call   1030 <remove@plt>
cmp    $0xffffffff,%eax
je     112d <Remove+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <Sys_failure@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"remove\00"
define void @Remove(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @remove(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @Sys_failure(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"remove\00"
define void @Remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int sscanf(char *, char *, int *);
int get_version(char *str) {
  int v;
  if (str[0] != 'v')
    return 0;
  if (sscanf(str + 1, "%d", &v) != 1)
    return 0;
  return v;
}


x86 assembly (clang, -O0):
<get_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x76,%eax
je     1138 <get_version+0x28>
movl   $0x0,-0x4(%rbp)
jmp    116b <get_version+0x5b>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xeb9(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1165 <get_version+0x55>
movl   $0x0,-0x4(%rbp)
jmp    116b <get_version+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_version>:
push   %rax
xor    %eax,%eax
cmpb   $0x76,(%rdi)
jne    113a <get_version+0x2a>
add    $0x1,%rdi
lea    0xedd(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    113a <get_version+0x2a>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @get_version(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 118
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %19
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 0, i32* %2
br label %19
17: ; preds = %11
%18 = load i32, i32* %4
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %16, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @get_version(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 118
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = icmp eq i32 %8, 1
%10 = load i32, i32* %2
%11 = select i1 %9, i32 %10, i32 0
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
char *strcpy(char *restrict s1, const char *restrict s2) {
  char *dst = s1;
  const char *src = s2;
  while ((*dst++ = *src++) != '\0')
    ;
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114f <strcpy+0x4f>
jmp    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
br label %9
9: ; preds = %17, %2
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %6
%12 = load i8, i8* %10
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
store i8 %12, i8* %13
%15 = sext i8 %12 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int test_imm_D6int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xd6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6int64_highword_mem>:
testb  $0xd6,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D6int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 214
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D6int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 919123001344
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, size_t, size_t, int /*<<< orphan*/ *);
void Sys_write(char *s, size_t size, size_t count, FILE *fp) {
  fwrite(s, size, count, fp);
}


x86 assembly (clang, -O0):
<Sys_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_write>:
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define void @Sys_write(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i32 @fwrite(i8* %9, i64 %10, i64 %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @Sys_write(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i32 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
ret void
}
/* Variables and functions */
scalar_t__ class_num(char);
scalar_t__ class_upper(char);
char conv_ctoi(char c) {
  if (class_num(c)) {
    return (char)(c - '0');
  } else if (class_upper(c)) {
    return (char)(c - 'A' + (char)10);
  }
  return (char)(-1);
}


x86 assembly (clang, -O0):
<conv_ctoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <class_num@plt>
cmp    $0x0,%rax
je     1150 <conv_ctoi+0x30>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    117e <conv_ctoi+0x5e>
movsbl -0x2(%rbp),%edi
call   1030 <class_upper@plt>
cmp    $0x0,%rax
je     1175 <conv_ctoi+0x55>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    117e <conv_ctoi+0x5e>
jmp    117a <conv_ctoi+0x5a>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_ctoi>:
push   %rbx
mov    %edi,%ebx
call   1040 <class_num@plt>
test   %rax,%rax
je     1132 <conv_ctoi+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <class_upper@plt>
lea    -0x37(%rbx),%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %cl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @conv_ctoi(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @class_num(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %24
12: ; preds = %1
%13 = load i8, i8* %3
%14 = call i64 @class_upper(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
%20 = add nsw i32 %19, 10
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %24
22: ; preds = %12
br label %23
23: ; preds = %22
store i8 -1, i8* %2
br label %24
24: ; preds = %23, %16, %7
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @conv_ctoi(i8 signext %0) {
%2 = tail call i64 @class_num(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %11
6: ; preds = %1
%7 = tail call i64 @class_upper(i8 signext %0)
%8 = icmp eq i64 %7, 0
%9 = add i8 %0, -55
%10 = select i1 %8, i8 -1, i8 %9
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ %5, %4 ], [ %10, %6 ]
ret i8 %12
}
long long foo4(long long x) { return x | 1; }


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
mov    %rdi,%rax
or     $0x1,%rax
ret

LLVM IR (-O0):
define i64 @foo4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @foo4(i64 %0) {
%2 = or i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ r_strncpy(char *, char const *, size_t);
scalar_t__ r_zmalloc(size_t);
char *r_strndup(const char *s, size_t size) {
  char *dupstr = (char *)r_zmalloc(size + 1);
  if (dupstr) {
    r_strncpy(dupstr, s, size);
  }
  return dupstr;
}


x86 assembly (clang, -O0):
<r_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <r_zmalloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115d <r_strndup+0x3d>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <r_strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1030 <r_zmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114a <r_strndup+0x2a>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <r_strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @r_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i64 @r_zmalloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
%16 = call i32 @r_strncpy(i8* %13, i8* %14, i64 %15)
br label %17
17: ; preds = %12, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @r_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @r_zmalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @r_strncpy(i8* %5, i8* %0, i64 %1)
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn58() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn58");
  return result;
}


x86 assembly (clang, -O0):
<fn58>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn58>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn58\00"
define i8* @fn58() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn58\00"
define i8* @fn58() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
char *getenv(char const *);
char *strdup(char const *);
char *read_config_string(const char *key, const char *default_value) {
  char *ret;
  ret = getenv(key);
  if (ret) {
    ret = strdup(ret);
  } else {
    if (default_value)
      ret = strdup(default_value);
  }
  return ret;
}


x86 assembly (clang, -O0):
<read_config_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115a <read_config_string+0x3a>
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    1177 <read_config_string+0x57>
cmpq   $0x0,-0x10(%rbp)
je     1172 <read_config_string+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    1177 <read_config_string+0x57>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_config_string>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
jne    1136 <read_config_string+0x16>
mov    %rbx,%rax
test   %rbx,%rbx
je     113f <read_config_string+0x1f>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @read_config_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @getenv(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %5
br label %20
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i8*, i8** %4
%18 = call i8* @strdup(i8* %17)
store i8* %18, i8** %5
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %10
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @read_config_string(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = icmp eq i8* %1, null
br i1 %6, label %10, label %7
7: ; preds = %5, %2
%8 = phi i8* [ %3, %2 ], [ %1, %5 ]
%9 = tail call i8* @strdup(i8* %8)
br label %10
10: ; preds = %7, %5
%11 = phi i8* [ null, %5 ], [ %9, %7 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int unacceptable_basis(int j) {
  j++;
  printf("This Is Unacceptable!\n");
  return j;
}


x86 assembly (clang, -O0):
<unacceptable_basis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unacceptable_basis>:
push   %rbx
lea    0x1(%rdi),%ebx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"This Is Unacceptable!\0A\00"
define i32 @unacceptable_basis(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@str = [22 x i8] c"This Is Unacceptable!\00"
define i32 @unacceptable_basis(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 %2
}