xunge/DecIR huggingface dataset:
void returnPound(char *channel, char *fixedChannel) {
  int i;
  fixedChannel[0] = '#';
  for (i = 0; channel[i] != '\0'; i++) {
    fixedChannel[i + 1] = channel[i];
  }
  fixedChannel[i + 1] = '\0';
}


x86 assembly (clang, -O0):
<returnPound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x23,(%rax)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <returnPound+0x58>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <returnPound+0x1a>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnPound>:
movb   $0x23,(%rsi)
mov    (%rdi),%al
test   %al,%al
je     1126 <returnPound+0x26>
mov    $0x1,%ecx
xchg   %ax,%ax
mov    %al,(%rsi,%rcx,1)
movzbl (%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <returnPound+0x10>
mov    %ecx,%eax
movb   $0x0,(%rsi,%rax,1)
ret
mov    $0x1,%eax
movb   $0x0,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @returnPound(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 35, i8* %7
store i32 0, i32* %5
br label %8
8: ; preds = %27, %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %30
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
store i8 %21, i8* %26
br label %27
27: ; preds = %16
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %8
30: ; preds = %8
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %31, i64 %34
store i8 0, i8* %35
ret void
}

LLVM IR (-O2):
define void @returnPound(i8* nocapture %0, i8* nocapture writeonly %1) {
store i8 35, i8* %1
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 %7, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add nuw i64 %6, 2
%15 = and i64 %14, 4294967295
br label %16
16: ; preds = %13, %2
%17 = phi i64 [ 1, %2 ], [ %15, %13 ]
%18 = getelementptr inbounds i8, i8* %1, i64 %17
store i8 0, i8* %18
ret void
}
int flipSign(int number) { return (~number) + 1; }


x86 assembly (clang, -O0):
<flipSign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flipSign>:
mov    %edi,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @flipSign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @flipSign(i32 %0) {
%2 = sub i32 0, %0
ret i32 %2
}
/* Variables and functions */
double EvalAngCor_alpha0_2plus_0plus_15097_L2(double);
double funcAngCor_alpha0_2plus_0plus_15097_L2(double *x, double *par) {
  double result;
  result = par[0] * EvalAngCor_alpha0_2plus_0plus_15097_L2(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngCor_alpha0_2plus_0plus_15097_L2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngCor_alpha0_2plus_0plus_15097_L2@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngCor_alpha0_2plus_0plus_15097_L2>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngCor_alpha0_2plus_0plus_15097_L2@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngCor_alpha0_2plus_0plus_15097_L2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngCor_alpha0_2plus_0plus_15097_L2(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngCor_alpha0_2plus_0plus_15097_L2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngCor_alpha0_2plus_0plus_15097_L2(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo1(int);
int main(void) {
  int x = 2;
  int result = fibo1(x);
  if (result == 1) {
  ERROR:
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibo1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1157 <main+0x37>
jmp    1150 <main+0x30>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <fibo1@plt>
cmp    $0x1,%eax
jne    1137 <main+0x17>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fibo1(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %0
br label %9
9: ; preds = %8
%10 = call i32 (...) @__VERIFIER_error()
br label %11
11: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo1(i32 2)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
unsigned int csum_partial(char *, int, int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
                                                int len, int sum,
                                                int *csum_err) {
  barrier();
  if (csum_err)
    *csum_err = 0;
  memcpy(dst, src, len);
  return csum_partial(dst, len, sum);
  barrier();
}


x86 assembly (clang, -O0):
<csum_partial_copy_from_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0x0,%al
call   1030 <barrier@plt>
cmpq   $0x0,-0x20(%rbp)
je     1166 <csum_partial_copy_from_user+0x36>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <csum_partial@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_partial_copy_from_user>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%rbp
mov    %ecx,%r14d
mov    %edx,%r12d
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <barrier@plt>
test   %rbp,%rbp
je     115a <csum_partial_copy_from_user+0x2a>
movl   $0x0,0x0(%rbp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <csum_partial@plt>

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

LLVM IR (-O2):
define i32 @csum_partial_copy_from_user(i8* %0, i8* %1, i32 %2, i32 %3, i32* writeonly %4) {
%6 = tail call i32 (...) @barrier()
%7 = icmp eq i32* %4, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %8, %5
%10 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %2)
%11 = tail call i32 @csum_partial(i8* %1, i32 %2, i32 %3)
ret i32 %11
}
/* Variables and functions */
size_t snprintf(char *, size_t, char *, char *, char const *);
const char *router_format_linemodeip(const char *in, char *out, size_t *outlen,
                                     char *srcaddr) {
  *outlen = snprintf(out, *outlen, "%s %s", srcaddr, in);
  return out;
}


x86 assembly (clang, -O0):
<router_format_linemodeip>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<router_format_linemodeip>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r8
mov    (%rdx),%rsi
lea    0xed9(%rip),%rdx
mov    %r14,%rdi
call   1030 <snprintf@plt>
mov    %rax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
define i8* @router_format_linemodeip(i8* %0, i8* %1, i64* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i64*, i64** %7
%11 = load i64, i64* %10
%12 = load i8*, i8** %8
%13 = load i8*, i8** %5
%14 = call i64 @snprintf(i8* %9, i64 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = load i64*, i64** %7
store i64 %14, i64* %15
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
define i8* @router_format_linemodeip(i8* %0, i8* returned %1, i64* nocapture %2, i8* %3) {
%5 = load i64, i64* %2
%6 = tail call i64 @snprintf(i8* %1, i64 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0)
store i64 %6, i64* %2
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void saveSourceFileName(char *name) {
  FILE *f = fopen("asmtovhd_settings.txt", "w");
  if (f) {
    fprintf(f, "%s", name);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<saveSourceFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117b <saveSourceFileName+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveSourceFileName>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116c <saveSourceFileName+0x3c>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"asmtovhd_settings.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%s\00"
define void @saveSourceFileName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i32*, i32** %3
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"asmtovhd_settings.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @saveSourceFileName(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @fputs(i8* %0, i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int cur;

/* Variables and functions */
uint32_t update_pn(uint32_t cur) {
  return cur << 1 |
         ((((cur) & (1 << (27))) >> (27)) ^ (((cur) & (1 << (30))) >> (30)));
}


x86 assembly (clang, -O0):
<update_pn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x8000000,%ecx
sar    $0x1b,%ecx
mov    -0x4(%rbp),%edx
and    $0x40000000,%edx
sar    $0x1e,%edx
xor    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_pn>:
mov    %edi,%eax
shr    $0x1b,%eax
mov    %edi,%ecx
shr    $0x1e,%ecx
xor    %eax,%ecx
and    $0x1,%ecx
lea    (%rcx,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @update_pn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 134217728
%7 = ashr i32 %6, 27
%8 = load i32, i32* %2
%9 = and i32 %8, 1073741824
%10 = ashr i32 %9, 30
%11 = xor i32 %7, %10
%12 = or i32 %4, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @update_pn(i32 %0) {
%2 = shl i32 %0, 1
%3 = lshr i32 %0, 27
%4 = lshr i32 %0, 30
%5 = xor i32 %3, %4
%6 = and i32 %5, 1
%7 = or i32 %6, %2
ret i32 %7
}
void i2d_X509_CERT_AUX(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_X509_CERT_AUX() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_y(void *_p, int _v) {
  ((XButtonReleasedEvent *)_p)->y = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonReleasedEvent_y>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonReleasedEvent_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void test_reg32_imm32(int reg32, unsigned long imm32) {
  put8(0xF7);
  put8(0xC0 + reg32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<test_reg32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xc0,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reg32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xc0,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @test_reg32_imm32(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = call i32 @put8(i32 247)
%6 = load i32, i32* %3
%7 = add nsw i32 192, %6
%8 = call i32 @put8(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @put32(i64 %9)
ret void
}

LLVM IR (-O2):
define void @test_reg32_imm32(i32 %0, i64 %1) {
%3 = tail call i32 @put8(i32 247)
%4 = add nsw i32 %0, 192
%5 = tail call i32 @put8(i32 %4)
%6 = tail call i32 @put32(i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_put_str(int /*<<< orphan*/, char *, int,
                             int /*<<< orphan*/);
int clear_sidebar(int height_start, int height_end) {
  int index;
  for (index = height_start; index <= height_end; index++) {
    c_put_str(0, "             ", index, 0);
  }
  return 1;
}


x86 assembly (clang, -O0):
<clear_sidebar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1151 <clear_sidebar+0x41>
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
lea    0xec4(%rip),%rsi
mov    %ecx,%edi
call   1030 <c_put_str@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <clear_sidebar+0x14>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_sidebar>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jg     1145 <clear_sidebar+0x35>
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <c_put_str@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <clear_sidebar+0x20>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c" \00"
define i32 @clear_sidebar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
br label %7
7: ; preds = %14, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %5
%13 = call i32 @c_put_str(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12, i32 0)
br label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %7
17: ; preds = %7
ret i32 1
}

LLVM IR (-O2):
@.str = [14 x i8] c" \00"
define i32 @clear_sidebar(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @c_put_str(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 0)
%7 = add i32 %5, 1
%8 = icmp eq i32 %5, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 1
}
void ble_rsp_gap_set_filtering(
    const struct ble_msg_gap_set_filtering_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_gap_set_filtering_rsp_t = type opaque
define void @ble_rsp_gap_set_filtering(%struct.ble_msg_gap_set_filtering_rsp_t* %0) {
%2 = alloca %struct.ble_msg_gap_set_filtering_rsp_t*
store %struct.ble_msg_gap_set_filtering_rsp_t* %0, %struct.ble_msg_gap_set_filtering_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_gap_set_filtering_rsp_t = type opaque
define void @ble_rsp_gap_set_filtering(%struct.ble_msg_gap_set_filtering_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *gethostbyname(char *);
void request_hostname(char *hostname) {
  if (gethostbyname(hostname) == NULL) {
    {};
  }
  {};
}


x86 assembly (clang, -O0):
<request_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
cmp    $0x0,%rax
jne    1134 <request_hostname+0x24>
jmp    1134 <request_hostname+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_hostname>:
jmp    1030 <gethostbyname@plt>

LLVM IR (-O0):
define void @request_hostname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @gethostbyname(i8* %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @request_hostname(i8* %0) {
%2 = tail call i32* @gethostbyname(i8* %0)
ret void
}
double po2kg(double d) { return (d * 453.592) / 1000; }


x86 assembly (clang, -O0):
<po2kg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<po2kg>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @po2kg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 4.535920e+02
%5 = fdiv double %4, 1.000000e+03
ret double %5
}

LLVM IR (-O2):
define double @po2kg(double %0) {
%2 = fmul double %0, 4.535920e+02
%3 = fdiv double %2, 1.000000e+03
ret double %3
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int sscanf(char const *, char *, int *);
int parse_mode(mode_t *mode_num, const char *mode_text) {
  if (sscanf(mode_text, "%o", mode_num) != 1)
    return -1;
  if (*mode_num > 07777)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<parse_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1149 <parse_mode+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <parse_mode+0x5c>
mov    -0x10(%rbp),%rax
cmpl   $0xfff,(%rax)
jle    1165 <parse_mode+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <parse_mode+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_mode>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x1,%ecx
jne    1142 <parse_mode+0x32>
xor    %eax,%eax
cmpl   $0x1000,(%rbx)
setge  %al
neg    %eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%o\00"
define i32 @parse_mode(i32* %0, i8* nocapture %1) {
%3 = tail call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %0
%7 = icmp sgt i32 %6, 4095
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
int am33xx_bbu_spi_nor_mlo_register_handler(const char *name,
                                            char *devicefile) {
  return 0;
}


x86 assembly (clang, -O0):
<am33xx_bbu_spi_nor_mlo_register_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @am33xx_bbu_spi_nor_mlo_register_handler(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @am33xx_bbu_spi_nor_mlo_register_handler(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double Dpow(double x, double y) { return pow(x, y); }


x86 assembly (clang, -O0):
<Dpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dpow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @Dpow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @Dpow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Variables and functions */
long long madd(int, int);
long long foo() { return madd(0x0000000100000001LL, 0x0000011100000001LL); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <madd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <madd@plt>

LLVM IR (-O0):
define i64 @foo() {
%1 = call i64 @madd(i32 1, i32 1)
ret i64 %1
}

LLVM IR (-O2):
define i64 @foo() {
%1 = tail call i64 @madd(i32 1, i32 1)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ dbgf(char *, int, char *);
int dbg_write(void *self, const void *buf, int cnt) {
  dbgf("%.*s", cnt, (char *)buf);
  return cnt;
}


x86 assembly (clang, -O0):
<dbg_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xecf(%rip),%rdi
call   1030 <dbgf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_write>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdx
lea    0xee3(%rip),%rdi
mov    %ebx,%esi
call   1030 <dbgf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.*s\00"
define i32 @dbg_write(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %5
%9 = call i32 @dbgf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.*s\00"
define i32 @dbg_write(i8* nocapture readnone %0, i8* %1, i32 returned %2) {
%4 = tail call i32 @dbgf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
ret i32 %2
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  {
    state[0UL] = (input[0UL] + 914778474UL) - (unsigned char)183;
    if (state[0UL] & (unsigned char)1) {
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] - 912013688UL) + (unsigned char)189;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x3686696a,%rax
sub    $0xb7,%rax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1144 <RandomFunc+0x44>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
jmp    1151 <RandomFunc+0x51>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
sub    $0x365c3978,%rax
add    $0xbd,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    %al,%al
add    $0xab,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = add i64 %9, 914778474
%11 = sub i64 %10, 183
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %12, i8* %13
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %2
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nsw i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
br label %37
28: ; preds = %2
%29 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = add nsw i32 %34, %31
%36 = trunc i32 %35 to i8
store i8 %36, i8* %32
br label %37
37: ; preds = %28, %19
%38 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%39 = load i8, i8* %38
%40 = zext i8 %39 to i64
%41 = sub i64 %40, 912013688
%42 = add i64 %41, 189
%43 = trunc i64 %42 to i8
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i64 0
store i8 %43, i8* %45
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = shl i8 %3, 1
%5 = add i8 %4, -85
store i8 %5, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void hDpMatFree(double *arr, int len) {
  int i;
  free(arr);
}


x86 assembly (clang, -O0):
<hDpMatFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hDpMatFree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @hDpMatFree(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = call i32 @free(double* %6)
ret void
}

LLVM IR (-O2):
define void @hDpMatFree(double* nocapture %0, i32 %1) {
%3 = tail call i32 @free(double* %0)
ret void
}
int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) {
  return channel ? 15 : 14;
}


x86 assembly (clang, -O0):
<pci_get_legacy_ide_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xe,%eax
mov    $0xf,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_get_legacy_ide_irq>:
cmp    $0x1,%esi
mov    $0xf,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_get_legacy_ide_irq(%struct.pci_dev* %0, i32 %1) {
%3 = alloca %struct.pci_dev*
%4 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 15, i32 14
ret i32 %8
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_get_legacy_ide_irq(%struct.pci_dev* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 14, i32 15
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int random();
int main() {
  volatile int tmp = random();
  printf("#define HAVE_RANDOM\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,-0x8(%rbp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,0x4(%rsp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"#define HAVE_RANDOM\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @random()
store volatile i32 %3, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"#define HAVE_RANDOM\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @random()
store volatile i32 %3, i32* %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *(mps_lib_memset)(void *s, int c, size_t n) { return memset(s, c, n); }


x86 assembly (clang, -O0):
<mps_lib_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mps_lib_memset>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @mps_lib_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
void g5() {}


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

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

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

LLVM IR (-O2):
define void @g5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
void print_timing(double tvegas, double thome, double tapprox) {
  printf("VEGAS Time: %.6f  Custom Time: %.6f  Dipole Approximation: %.6f",
         tvegas, thome, tapprox);
}


x86 assembly (clang, -O0):
<print_timing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timing>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"VEGAS Time: %.6f Custom Time: %.6f Dipole Approximation: %.6f\00"
define void @print_timing(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), double %7, double %8, double %9)
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"VEGAS Time: %.6f Custom Time: %.6f Dipole Approximation: %.6f\00"
define void @print_timing(double %0, double %1, double %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %2)
ret void
}
int if_bad_loop() {
  int p = 10;
  for (int j = 0; j < 5; j++) {
    if (j < 2) {
      p++;
    } else {
      p = 3;
      for (int k = 0; k < 10; k++) {
        int m = 0;
      }
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<if_bad_loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1179 <if_bad_loop+0x79>
cmpl   $0x2,-0x8(%rbp)
jge    1134 <if_bad_loop+0x34>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <if_bad_loop+0x66>
movl   $0x3,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1161 <if_bad_loop+0x61>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <if_bad_loop+0x42>
jmp    1166 <if_bad_loop+0x66>
jmp    116b <if_bad_loop+0x6b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <if_bad_loop+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @if_bad_loop() {
ret i32 3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *m_strdup(char *o) {
  int l = strlen(o) + 1;
  char *ns = (char *)malloc(l * sizeof(char));
  strcpy(ns, o);
  if (ns == NULL)
    return NULL;
  else
    return ns;
}


x86 assembly (clang, -O0):
<m_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1183 <m_strdup+0x53>
movq   $0x0,-0x8(%rbp)
jmp    118b <m_strdup+0x5b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @m_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %1
store i8* null, i8** %2
br label %23
21: ; preds = %1
%22 = load i8*, i8** %5
store i8* %22, i8** %2
br label %23
23: ; preds = %21, %20
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @m_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ to_hexadecimal(int);
int main() {
  int num = 254;
  to_hexadecimal(num);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfe,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <to_hexadecimal@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfe,%edi
call   1030 <to_hexadecimal@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 254, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @to_hexadecimal(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @to_hexadecimal(i32 254)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
double ls_cost_nm3_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<ls_cost_nm3_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ls_cost_nm3_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <ls_cost_nm3_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <ls_cost_nm3_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <ls_cost_nm3_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm3_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm3_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @ls_cost_nm3_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
char *strchr(char *, char);
char *authvchkpw_isvirtual(char *c) {
  char *p;
  if ((p = strchr(c, '@')) != 0)
    return (p);
  if ((p = strchr(c, ':')) != 0)
    return (p);
  return (0);
}


x86 assembly (clang, -O0):
<authvchkpw_isvirtual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1145 <authvchkpw_isvirtual+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <authvchkpw_isvirtual+0x66>
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116e <authvchkpw_isvirtual+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <authvchkpw_isvirtual+0x66>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<authvchkpw_isvirtual>:
push   %rbx
mov    %rdi,%rbx
mov    $0x40,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1125 <authvchkpw_isvirtual+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x3a,%esi
pop    %rbx
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @authvchkpw_isvirtual(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %2, %1 ], [ %5, %4 ]
ret i8* %7
}
int f(int a) { return a & (((0xffffff) << 3)); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffff8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
and    $0x7fffff8,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 134217720
ret i32 %2
}