xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stdout;
void free_str(void *elt) {
  char *str = *(char **)elt;
  fprintf(stdout, "Freeing string: %s\n", str);
  free(str);
}


x86 assembly (clang, -O0):
<free_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_str>:
push   %rbx
mov    (%rdi),%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [20 x i8] c"Freeing string: %s\0A\00"
define void @free_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %3
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [20 x i8] c"Freeing string: %s\0A\00"
define void @free_str(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = tail call i32 @free(i8* %3)
ret void
}
int ti_lag_start(double const *options) { return (int)options[0]; }


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

x86 assembly (clang, -O2):
<ti_lag_start>:
cvttsd2si (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ti_lag_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ti_lag_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
char *or_parsenum(char *numstr) {
  char *number;
  number = (char *)malloc(10 * sizeof(char));
  number[0] = '\0';
  return number;
}


x86 assembly (clang, -O0):
<or_parsenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_parsenum>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @or_parsenum(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @or_parsenum(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8 0, i8* %3
ret i8* %3
}
/* Variables and functions */
int fileCompString(long const, void const *);
int ascending(const long pos, const void *a2) {
  return fileCompString(pos, a2);
}


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

x86 assembly (clang, -O2):
<ascending>:
jmp    1030 <fileCompString@plt>

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

LLVM IR (-O2):
define i32 @ascending(i64 %0, i8* %1) {
%3 = tail call i32 @fileCompString(i64 %0, i8* %1)
ret i32 %3
}
void av_expr_count_vars() {}


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

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

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

LLVM IR (-O2):
define void @av_expr_count_vars() {
ret void
}
char *ft_strcpy(char *dst, const char *src) {
  int i;
  i = 0;
  while (src[i] != '\0') {
    dst[i] = src[i];
    i++;
  }
  dst[i] = '\0';
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <ft_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <ft_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <ft_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <ft_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ EVP_cleanup();
void destroy_crypto(void) {
  EVP_cleanup();
  ERR_free_strings();
}


x86 assembly (clang, -O0):
<destroy_crypto>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EVP_cleanup@plt>
mov    $0x0,%al
call   1040 <ERR_free_strings@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_crypto>:
push   %rax
xor    %eax,%eax
call   1030 <EVP_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ERR_free_strings@plt>

LLVM IR (-O0):
define void @destroy_crypto() {
%1 = call i32 (...) @EVP_cleanup()
%2 = call i32 (...) @ERR_free_strings()
ret void
}

LLVM IR (-O2):
define void @destroy_crypto() {
%1 = tail call i32 (...) @EVP_cleanup()
%2 = tail call i32 (...) @ERR_free_strings()
ret void
}
void apush() {
  asm volatile("popq %%rax\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r14, %%rsp\n\t"
               "pushq %%rax\n\t"
               "movq %%rsp, %%r14\n\t"
               "movq %%r13, %%rsp\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<apush>:
push   %rbp
mov    %rsp,%rbp
pop    %rax
mov    %rsp,%r13
mov    %r14,%rsp
push   %rax
mov    %rsp,%r14
mov    %r13,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apush>:
pop    %rax
mov    %rsp,%r13
mov    %r14,%rsp
push   %rax
mov    %rsp,%r14
mov    %r13,%rsp
ret

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

LLVM IR (-O2):
define void @apush() {
tail call void asm sideeffect "popq %rax\0A\09movq %rsp, %r13\0A\09movq %r14, %rsp\0A\09pushq %rax\0A\09movq %rsp, %r14\0A\09movq %r13, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_alloc(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void log_alloc_finish() { log_alloc(0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<log_alloc_finish>:
push   %rbp
mov    %rsp,%rbp
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <log_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_alloc_finish>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <log_alloc@plt>

LLVM IR (-O0):
define void @log_alloc_finish() {
%1 = call i32 @log_alloc(i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @log_alloc_finish() {
%1 = tail call i32 @log_alloc(i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void english_ISO_8859_1_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<english_ISO_8859_1_close_env>:
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @english_ISO_8859_1_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @english_ISO_8859_1_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
void delay(int tt) {
  int i;
  for (; tt > 0; tt--) {
    for (i = 0; i < 10000; i++) {
    }
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114b <delay+0x4b>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    1138 <delay+0x38>
jmp    112a <delay+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <delay+0x18>
jmp    113d <delay+0x3d>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10000
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %8
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, -1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
void tst_shift(void) {
  int i = 1;
  long long l = 1;
  i = i << 32;
  l = l << 64;
}


x86 assembly (clang, -O0):
<tst_shift>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x40,%ecx
shl    %cl,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tst_shift() {
%1 = alloca i32
%2 = alloca i64
store i32 1, i32* %1
store i64 1, i64* %2
%3 = load i32, i32* %1
%4 = shl i32 %3, 32
store i32 %4, i32* %1
%5 = load i64, i64* %2
%6 = shl i64 %5, 64
store i64 %6, i64* %2
ret void
}

LLVM IR (-O2):
define void @tst_shift() {
ret void
}
int ld_bgt_mr1(long double *a1, long double a2) {
  return (__builtin_isgreater(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_bgt_mr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_mr1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_bgt_mr1(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp ogt x86_fp80 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_bgt_mr1(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp ogt x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void initmydpss(void) {}


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

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

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

LLVM IR (-O2):
define void @initmydpss() {
ret void
}
/* Variables and functions */
int guessNumber(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", guessNumber(6)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1040 <guessNumber@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1040 <guessNumber@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @guessNumber(i32 6)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @guessNumber(i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_ptr;

/* Variables and functions */
scalar_t__ mpz_cmp_ui(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void gmp_negate(mpz_ptr value, mpz_ptr order) {
  if (mpz_cmp_ui(value, 0) == 0) {
    mpz_set_ui(value, 0);
  } else {
    mpz_sub(value, order, value);
  }
}


x86 assembly (clang, -O0):
<gmp_negate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
jne    1161 <gmp_negate+0x31>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <mpz_set_ui@plt>
jmp    116f <gmp_negate+0x3f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <mpz_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmp_negate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %esi,%esi
call   1040 <mpz_cmp_ui@plt>
test   %rax,%rax
je     1154 <gmp_negate+0x24>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mpz_sub@plt>
mov    %ebx,%edi
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mpz_set_ui@plt>

LLVM IR (-O0):
define void @gmp_negate(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 = call i64 @mpz_cmp_ui(i32 %5, i32 0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = call i32 @mpz_set_ui(i32 %9, i32 0)
br label %16
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @mpz_sub(i32 %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @gmp_negate(i32 %0, i32 %1) {
%3 = tail call i64 @mpz_cmp_ui(i32 %0, i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @mpz_set_ui(i32 %0, i32 0)
br label %9
7: ; preds = %2
%8 = tail call i32 @mpz_sub(i32 %0, i32 %1, i32 %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint16_t scrypt_be16dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint16_t)(p[1]) + ((uint16_t)(p[0]) << 8));
}


x86 assembly (clang, -O0):
<scrypt_be16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_be16dec>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @scrypt_be16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @scrypt_be16dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = add nsw i32 %9, %6
ret i32 %10
}
__attribute__((always_)) int net_idget(volatile int *lock) {
  return __sync_fetch_and_add(lock, 0);
}


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

x86 assembly (clang, -O2):
<net_idget>:
mfence
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @net_idget(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = atomicrmw add i32* %3, i32 0 seq_cst
ret i32 %4
}

LLVM IR (-O2):
define i32 @net_idget(i32* nocapture %0) {
%2 = atomicrmw or i32* %0, i32 0 seq_cst
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *gstrdup(char const *);
void setdup(char **old, const char *str) {
  free(*old);
  *old = gstrdup(str);
}


x86 assembly (clang, -O0):
<setdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <gstrdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <gstrdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @setdup(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @gstrdup(i8* %8)
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
ret void
}

LLVM IR (-O2):
define void @setdup(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @free(i8* %3)
%5 = tail call i8* @gstrdup(i8* %1)
store i8* %5, i8** %0
ret void
}
int EmptyQueue(float *Q) {
  if (Q[0] < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<EmptyQueue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomiss (%rax),%xmm0
jbe    1124 <EmptyQueue+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <EmptyQueue+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmptyQueue>:
xorps  %xmm0,%xmm0
xor    %eax,%eax
ucomiss (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @EmptyQueue(float* %0) {
%2 = alloca i32
%3 = alloca float*
store float* %0, float** %3
%4 = load float*, float** %3
%5 = getelementptr inbounds float, float* %4, i64 0
%6 = load float, float* %5
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @EmptyQueue(float* nocapture %0) {
%2 = load float, float* %0
%3 = fcmp olt float %2, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ parse(int, char **);
int main(int argc, char *argv[]) { parse(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(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 = load i8**, i8*** %4
%7 = call i32 @parse(i32 %5, i8** %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, int);
int triad(int len, double xx, double *a, double *b, double *c) {
  int i = 0, bytes = 8;
  memset((void *)a, i, len * sizeof(double));
  return bytes;
}


x86 assembly (clang, -O0):
<triad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x8,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%esi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memset@plt>
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triad>:
push   %rax
lea    0x0(,%rdi,8),%edx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @triad(i32 %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
store i32 0, i32* %11
store i32 8, i32* %12
%13 = load double*, double** %8
%14 = bitcast double* %13 to i8*
%15 = load i32, i32* %11
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 8
%19 = trunc i64 %18 to i32
%20 = call i32 @memset(i8* %14, i32 %15, i32 %19)
%21 = load i32, i32* %12
ret i32 %21
}

LLVM IR (-O2):
define i32 @triad(i32 %0, double %1, double* %2, double* nocapture readnone %3, double* nocapture readnone %4) {
%6 = bitcast double* %2 to i8*
%7 = shl i32 %0, 3
%8 = tail call i32 @memset(i8* %6, i32 0, i32 %7)
ret i32 8
}
void GENERAL_SUBTREE_free(void) {}


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

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

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

LLVM IR (-O2):
define void @GENERAL_SUBTREE_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ msgheader();
int /*<<< orphan*/ stderr;
void closelog(void) {
  msgheader();
  fputs("closelog()\n", stderr);
}


x86 assembly (clang, -O0):
<closelog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <msgheader@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<closelog>:
push   %rax
xor    %eax,%eax
call   1040 <msgheader@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"closelog()\0A\00"
@stderr = global i32 0
define void @closelog() {
%1 = call i32 (...) @msgheader()
%2 = load i32, i32* @stderr
%3 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"closelog()\0A\00"
@stderr = global i32 0
define void @closelog() {
%1 = tail call i32 (...) @msgheader()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int my_strlen(char *s) {
  int rv = 0;
  while (*s++)
    rv++;
  return rv;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <my_strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111c <my_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int STC31xx_ReadByte8(int);
int STC31xx_WriteByte8(int, int);
int STC31xx_AlarmSet(void) {
  int res;
  res = STC31xx_ReadByte8(0x00);
  res = STC31xx_WriteByte8(0x00, (res | 0x08));
  if (res != 0)
    return (res);
  return (0);
}


x86 assembly (clang, -O0):
<STC31xx_AlarmSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <STC31xx_ReadByte8@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
or     $0x8,%esi
xor    %edi,%edi
call   1040 <STC31xx_WriteByte8@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1157 <STC31xx_AlarmSet+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <STC31xx_AlarmSet+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC31xx_AlarmSet>:
push   %rax
xor    %edi,%edi
call   1030 <STC31xx_ReadByte8@plt>
or     $0x8,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <STC31xx_WriteByte8@plt>

LLVM IR (-O0):
define i32 @STC31xx_AlarmSet() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @STC31xx_ReadByte8(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = or i32 %4, 8
%6 = call i32 @STC31xx_WriteByte8(i32 0, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @STC31xx_AlarmSet() {
%1 = tail call i32 @STC31xx_ReadByte8(i32 0)
%2 = or i32 %1, 8
%3 = tail call i32 @STC31xx_WriteByte8(i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_token(char const *);
int lookup_hid_token_by_name(char *);
int parse_hid(const char *p) {
  int num = -9999;
  char *t = get_token(p);
  if (!t)
    goto ret;
  num = lookup_hid_token_by_name(t);
  free(t);
ret:
  return num;
}


x86 assembly (clang, -O0):
<parse_hid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffd8f1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_token@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <parse_hid+0x30>
jmp    1175 <parse_hid+0x45>
mov    -0x18(%rbp),%rdi
call   1040 <lookup_hid_token_by_name@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_hid>:
push   %rbp
push   %rbx
push   %rax
call   1050 <get_token@plt>
test   %rax,%rax
je     1156 <parse_hid+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <lookup_hid_token_by_name@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115b <parse_hid+0x2b>
mov    $0xffffd8f1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_hid(i8* %0) {
%2 = tail call i8* @get_token(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @lookup_hid_token_by_name(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ -9999, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ assume(int);
int main() {
  int start;
  assume(start > 0);
  int i;
  i = start;
  while (i) {
    i = i - 1;
  }
  if (start > 2) {
    assert(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115e <main+0x3e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
cmpl   $0x2,-0x8(%rbp)
jle    116f <main+0x4f>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assume@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
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assume(i32 %6)
%8 = load i32, i32* %2
store i32 %8, i32* %3
br label %9
9: ; preds = %12, %0
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %3
br label %9
15: ; preds = %9
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @assert(i32 0)
br label %20
20: ; preds = %18, %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
ret i32 0
}
__attribute__((weak)) void USART1_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @USART1_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int test_imm_F9uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F9uint64_midword_mem>:
testb  $0xf9,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F9uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 249
%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_F9uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16318464
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int x;
typedef int uint32_t;

/* Variables and functions */
uint32_t change_endian32(uint32_t x) {
  return (((x) << 24) | ((x) >> 24) | (((x)&0x0000ff00) << 8) |
          (((x)&0x00ff0000) >> 8));
}


x86 assembly (clang, -O0):
<change_endian32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_endian32>:
mov    %edi,%eax
shl    $0x18,%eax
mov    %edi,%ecx
sar    $0x18,%ecx
or     %eax,%ecx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %ecx,%eax
shr    $0x8,%edi
and    $0xff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @change_endian32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = ashr i32 %5, 24
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = and i32 %8, 65280
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = load i32, i32* %2
%13 = and i32 %12, 16711680
%14 = ashr i32 %13, 8
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @change_endian32(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr i32 %0, 24
%4 = or i32 %2, %3
%5 = shl i32 %0, 8
%6 = and i32 %5, 16711680
%7 = or i32 %4, %6
%8 = lshr i32 %0, 8
%9 = and i32 %8, 65280
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int _upnp_delete_redir(unsigned short, int /*<<< orphan*/);
int /*<<< orphan*/ proto_atoi(char const *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, unsigned short,
                          char const *);
int upnp_delete_redirection(unsigned short eport, const char *protocol) {
  syslog(LOG_INFO, "removing redirect rule port %hu %s", eport, protocol);
  return _upnp_delete_redir(eport, proto_atoi(protocol));
}


x86 assembly (clang, -O0):
<upnp_delete_redirection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rcx
lea    0xea5(%rip),%rsi
movzwl %ax,%edx
call   1050 <syslog@plt>
mov    -0x2(%rbp),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <proto_atoi@plt>
mov    %eax,%esi
mov    -0x12(%rbp),%ax
movzwl %ax,%edi
call   1040 <_upnp_delete_redir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upnp_delete_redirection>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1050 <syslog@plt>
mov    %rbx,%rdi
call   1030 <proto_atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_upnp_delete_redir@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [35 x i8] c"removing redirect rule port %hu %s\00"
define i32 @upnp_delete_redirection(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i32, i32* @LOG_INFO
%6 = load i16, i16* %3
%7 = load i8*, i8** %4
%8 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i16 zeroext %6, i8* %7)
%9 = load i16, i16* %3
%10 = load i8*, i8** %4
%11 = call i32 @proto_atoi(i8* %10)
%12 = call i32 @_upnp_delete_redir(i16 zeroext %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [35 x i8] c"removing redirect rule port %hu %s\00"
define i32 @upnp_delete_redirection(i16 zeroext %0, i8* %1) {
%3 = load i32, i32* @LOG_INFO
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i8* %1)
%5 = tail call i32 @proto_atoi(i8* %1)
%6 = tail call i32 @_upnp_delete_redir(i16 zeroext %0, i32 %5)
ret i32 %6
}
char *langEnumControlsJoyAsciiLaser() {
  return "ASCII Plus-X Terminator Laser";
}


x86 assembly (clang, -O0):
<langEnumControlsJoyAsciiLaser>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"ASCII Plus-X Terminator Laser\00"
define i8* @langEnumControlsJoyAsciiLaser() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [30 x i8] c"ASCII Plus-X Terminator Laser\00"
define i8* @langEnumControlsJoyAsciiLaser() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}
double coco_double_max(const double a, const double b) {
  if (a >= b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<coco_double_max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <coco_double_max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <coco_double_max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<coco_double_max>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @coco_double_max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp oge double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @coco_double_max(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int mini(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<mini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <mini+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <mini+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @mini(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 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @mini(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void bill(char *arg) { printf("bill: we passed %s\n", arg); }


x86 assembly (clang, -O0):
<bill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bill>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"bill: we passed %s\0A\00"
define void @bill(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"bill: we passed %s\0A\00"
define void @bill(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p1(char);
int p2(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  char c = 'a';
  int x, y, z;
  x = 1;
  y = 2;
  p1(c);
  z = p2(x, y);
  printf("%d = %d + %d\n", z, x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1050 <p1@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <p2@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1050 <p1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <p2@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d = %d + %d\0A\00"
define i32 @main() {
%1 = tail call i32 @p1(i8 signext 97)
%2 = tail call i32 @p2(i32 1, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ terminal_delete_char();
void terminal_action_del(int c, void (*process_line)(char *line)) {
  terminal_delete_char();
}


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

x86 assembly (clang, -O2):
<terminal_action_del>:
xor    %eax,%eax
jmp    1030 <terminal_delete_char@plt>

LLVM IR (-O0):
define void @terminal_action_del(i32 %0, void (i8*)* %1) {
%3 = alloca i32
%4 = alloca void (i8*)*
store i32 %0, i32* %3
store void (i8*)* %1, void (i8*)** %4
%5 = call i32 (...) @terminal_delete_char()
ret void
}

LLVM IR (-O2):
define void @terminal_action_del(i32 %0, void (i8*)* nocapture readnone %1) {
%3 = tail call i32 (...) @terminal_delete_char()
ret void
}
void g_shell_error_quark() {}


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

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

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

LLVM IR (-O2):
define void @g_shell_error_quark() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fctl_biased_fb(void *, unsigned char);
void ctl_biased_fb(void *d, unsigned char uc) { fctl_biased_fb(d, uc / 127.0); }


x86 assembly (clang, -O0):
<ctl_biased_fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
call   1030 <fctl_biased_fb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctl_biased_fb>:
cvtsi2sd %esi,%xmm0
divsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
jmp    1030 <fctl_biased_fb@plt>

LLVM IR (-O0):
define void @ctl_biased_fb(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.270000e+02
%10 = fptoui double %9 to i8
%11 = call i32 @fctl_biased_fb(i8* %5, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @ctl_biased_fb(i8* %0, i8 zeroext %1) {
%3 = uitofp i8 %1 to double
%4 = fdiv double %3, 1.270000e+02
%5 = fptoui double %4 to i8
%6 = tail call i32 @fctl_biased_fb(i8* %0, i8 zeroext %5)
ret void
}