xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ randombytes(unsigned char *, size_t);
int dummy_rng(void *state, unsigned char *bytes, size_t len) {
  ((void)state);
  randombytes(bytes, len);
  return 0;
}


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

x86 assembly (clang, -O2):
<dummy_rng>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <randombytes@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dummy_rng(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = tail call i32 @randombytes(i8* %1, i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xf1() {
  Assert_real((isgraph(241) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1210, ("isgraph should be 0 for 0xf1"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xf1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf1,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4ba,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xf1>:
push   %rax
mov    $0xf1,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ba,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf1\00"
define void @t_isgraph_0xf1() {
%1 = call i64 @isgraph(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf1\00"
define void @t_isgraph_0xf1() {
%1 = tail call i64 @isgraph(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void clean_exit(int _signal) { exit(0); }


x86 assembly (clang, -O0):
<clean_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<clean_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @clean_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @clean_exit(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double log2_rd(double);
double log2_ru(double);
double log2_rz(double x) {
  if (x > 1)
    return log2_rd(x);
  else
    return log2_ru(x);
}


x86 assembly (clang, -O0):
<log2_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1158 <log2_rz+0x38>
movsd  -0x10(%rbp),%xmm0
call   1040 <log2_rd@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <log2_rz+0x47>
movsd  -0x10(%rbp),%xmm0
call   1030 <log2_ru@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_rz>:
ucomisd 0xed8(%rip),%xmm0
jbe    112f <log2_rz+0xf>
jmp    1040 <log2_rd@plt>
jmp    1030 <log2_ru@plt>

LLVM IR (-O0):
define double @log2_rz(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @log2_rd(double %7)
store double %8, double* %2
br label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = call double @log2_ru(double %10)
store double %11, double* %2
br label %12
12: ; preds = %9, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @log2_rz(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @log2_rd(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @log2_ru(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(unsigned int);
unsigned int getuid();
char *detect_tags_file() {
  unsigned int uid = getuid();
  struct passwd *user_data = getpwuid(uid);
  return user_data->pw_name;
}


x86 assembly (clang, -O0):
<detect_tags_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detect_tags_file>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @detect_tags_file() {
%1 = alloca i32
%2 = alloca %struct.passwd*
%3 = call i32 (...) @getuid()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %2
%6 = load %struct.passwd*, %struct.passwd** %2
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %6, i32 0, i32 0
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @detect_tags_file() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%4 = load i8*, i8** %3
ret i8* %4
}
/* Variables and functions */
scalar_t__ skytraq_waitchar(int, int);
void skytraq_flush(int fd) {
  while (skytraq_waitchar(fd, 1) >= 0)
    ;
}


x86 assembly (clang, -O0):
<skytraq_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <skytraq_waitchar@plt>
cmp    $0x0,%rax
jl     1137 <skytraq_flush+0x27>
jmp    111b <skytraq_flush+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skytraq_flush>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <skytraq_waitchar@plt>
test   %rax,%rax
jns    1120 <skytraq_flush+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @skytraq_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = call i64 @skytraq_waitchar(i32 %4, i32 1)
%6 = icmp sge i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @skytraq_flush(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @skytraq_waitchar(i32 %0, i32 1)
%4 = icmp sgt i64 %3, -1
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
unsigned long int unsignedlongint_ignoring_signedchar(unsigned long int x,
                                                      signed char y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlongint_ignoring_signedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlongint_ignoring_signedchar>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlongint_ignoring_signedchar(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_signedchar(i64 returned %0, i8 signext %1) {
ret i64 %0
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ counts_get_direct(struct hdr_histogram *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ normalize_index(struct hdr_histogram *, int /*<<< orphan*/);
int32_t counts_get_normalised(struct hdr_histogram *h, int32_t index) {
  return counts_get_direct(h, normalize_index(h, index));
}


x86 assembly (clang, -O0):
<counts_get_normalised>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <normalize_index@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <counts_get_direct@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counts_get_normalised>:
push   %rbx
mov    %rdi,%rbx
call   1040 <normalize_index@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <counts_get_direct@plt>

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @counts_get_normalised(%struct.hdr_histogram* %0, i32 %1) {
%3 = alloca %struct.hdr_histogram*
%4 = alloca i32
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %3
store i32 %1, i32* %4
%5 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%6 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%7 = load i32, i32* %4
%8 = call i32 @normalize_index(%struct.hdr_histogram* %6, i32 %7)
%9 = call i32 @counts_get_direct(%struct.hdr_histogram* %5, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @counts_get_normalised(%struct.hdr_histogram* %0, i32 %1) {
%3 = tail call i32 @normalize_index(%struct.hdr_histogram* %0, i32 %1)
%4 = tail call i32 @counts_get_direct(%struct.hdr_histogram* %0, i32 %3)
ret i32 %4
}
int consume_int(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @consume_int(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
FILE *open_file(const char *filename, const char *mode) {
  FILE *fp;
  fp = fopen(filename, mode);
  if (fp == NULL) {
    printf("Error - can't open or create file: %s\n", filename);
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <open_file+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <open_file+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Error - can't open or create file: %s\0A\00"
define i32* @open_file(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** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [39 x i8] c"Error - can't open or create file: %s\0A\00"
define noalias i32* @open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
/* Variables and functions */
unsigned int urlencode_put(char *, unsigned int const, char *,
                           unsigned int const);
unsigned int encodeURIComponent(char input[], char output[],
                                const unsigned int input_len,
                                const unsigned int output_max) {
  return urlencode_put(output, output_max, input, input_len);
}


x86 assembly (clang, -O0):
<encodeURIComponent>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <urlencode_put@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeURIComponent>:
mov    %edx,%eax
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    %ecx,%esi
mov    %eax,%ecx
jmp    1030 <urlencode_put@plt>

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

LLVM IR (-O2):
define i32 @encodeURIComponent(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @urlencode_put(i8* %1, i32 %3, i8* %0, i32 %2)
ret i32 %5
}
int unpackop(unsigned char *buf) { return (buf[0] << 8) | (buf[1] & 0xff); }


x86 assembly (clang, -O0):
<unpackop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackop>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @unpackop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @unpackop(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int swap_add(int *, int *);
int caller() {
  int arg1 = 123;
  int arg2 = 456;
  int sum = swap_add(&arg1, &arg2);
  int diff = arg1 - arg2;
  return sum * diff;
}


x86 assembly (clang, -O0):
<caller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7b,-0x4(%rbp)
movl   $0x1c8,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <swap_add@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller>:
push   %rax
movl   $0x7b,0x4(%rsp)
movl   $0x1c8,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <swap_add@plt>
mov    0x4(%rsp),%ecx
sub    (%rsp),%ecx
imul   %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @caller() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 123, i32* %1
store i32 456, i32* %2
%5 = call i32 @swap_add(i32* %1, i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @caller() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 123, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 456, i32* %2
%5 = call i32 @swap_add(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = mul nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
char *oauth_send_data(const char *u, const char *data, size_t len,
                      const char *customheader, const char *httpMethod) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @oauth_send_data(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @oauth_send_data(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int pass(char *msg) {
  printf("%s\n", msg);
  printf("PASS\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<pass>:
push   %rax
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @pass(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int absv(int x) { return (x < 0 ? -x : x); }


x86 assembly (clang, -O0):
<absv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <absv+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absv+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @absv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @absv(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int weak_fn_isoarg(int arg __attribute__((weak))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @weak_fn_isoarg(i32 %0) {
ret i32 0
}
int min(int a, int b) {
  if (a <= b) {
    return a;
  } else {
    return b;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int i8k_get_cpu_temp();
int /*<<< orphan*/ printf(char *, int);
int cpu_temperature() {
  printf("%d\n", i8k_get_cpu_temp());
  return 0;
}


x86 assembly (clang, -O0):
<cpu_temperature>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <i8k_get_cpu_temp@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_temperature>:
push   %rax
xor    %eax,%eax
call   1040 <i8k_get_cpu_temp@plt>
lea    0xed1(%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 @cpu_temperature() {
%1 = call i32 (...) @i8k_get_cpu_temp()
%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 @cpu_temperature() {
%1 = tail call i32 (...) @i8k_get_cpu_temp()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int my_shift(unsigned int left, unsigned int right) {
  return (right > 100) ? left : (left >> right);
}


x86 assembly (clang, -O0):
<my_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jbe    111f <my_shift+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112a <my_shift+0x2a>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_shift>:
xor    %ecx,%ecx
cmp    $0x65,%esi
cmovb  %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @my_shift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ugt i32 %5, 100
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = lshr i32 %10, %11
br label %13
13: ; preds = %9, %7
%14 = phi i32 [ %8, %7 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @my_shift(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 100
%4 = select i1 %3, i32 0, i32 %1
%5 = lshr i32 %0, %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void blueLEDOff(void) { (*((volatile uint32_t *)0x40025010)) &= ~0x04; }


x86 assembly (clang, -O0):
<blueLEDOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40025010,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    $0x40025010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<blueLEDOff>:
andl   $0xfffffffb,0x40025010
fb
ret

LLVM IR (-O0):
define void @blueLEDOff() {
%1 = load volatile i32, i32* inttoptr (i64 1073893392 to i32*)
%2 = and i32 %1, -5
store volatile i32 %2, i32* inttoptr (i64 1073893392 to i32*)
ret void
}

LLVM IR (-O2):
define void @blueLEDOff() {
%1 = load volatile i32, i32* inttoptr (i64 1073893392 to i32*)
%2 = and i32 %1, -5
store volatile i32 %2, i32* inttoptr (i64 1073893392 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int null_init_fini(FILE *f) {
  (void)f;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @null_init_fini(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/, int,
                           int);
int /*<<< orphan*/ stdout;
void show_version() { fprintf(stdout, "\nauthprogs %d.%d.%d\n", 0, 9, 103); }


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
xor    %edx,%edx
mov    $0x9,%ecx
mov    $0x67,%r8d
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
xor    %edx,%edx
mov    $0x9,%ecx
mov    $0x67,%r8d
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [21 x i8] c"\0Aauthprogs %d.%d.%d\0A\00"
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 0, i32 9, i32 103)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [21 x i8] c"\0Aauthprogs %d.%d.%d\0A\00"
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 0, i32 9, i32 103)
ret void
}
unsigned alarm(unsigned seconds) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1132 <alarm+0x22>

x86 assembly (clang, -O2):
<alarm>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <alarm+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.alarm = [6 x i8] c"alarm\00"
define i32 @alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.alarm, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.alarm = [6 x i8] c"alarm\00"
define i32 @alarm(i32 %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.alarm, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_scalbnf();
scalar_t__ scalbnf(float, int);
void test_scalbnf(float f, int x) {
  if (scalbnf(f, x) != scalbnf(f, x))
    link_failure_scalbnf();
}


x86 assembly (clang, -O0):
<test_scalbnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <scalbnf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <scalbnf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_scalbnf+0x45>
mov    $0x0,%al
call   1040 <link_failure_scalbnf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalbnf>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movss  %xmm0,0x4(%rsp)
call   1030 <scalbnf@plt>
mov    %rax,%r14
movss  0x4(%rsp),%xmm0
mov    %ebx,%edi
call   1030 <scalbnf@plt>
cmp    %rax,%r14
jne    114e <test_scalbnf+0x2e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_scalbnf@plt>

LLVM IR (-O0):
define void @test_scalbnf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call i64 @scalbnf(float %5, i32 %6)
%8 = load float, float* %3
%9 = load i32, i32* %4
%10 = call i64 @scalbnf(float %8, i32 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_scalbnf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_scalbnf(float %0, i32 %1) {
%3 = tail call i64 @scalbnf(float %0, i32 %1)
%4 = tail call i64 @scalbnf(float %0, i32 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_scalbnf()
br label %8
8: ; preds = %6, %2
ret void
}
void reverse_str(char *begin, char *end) {
  while (begin < end) {
    char tmp = *begin;
    *begin = *end;
    *end = tmp;
    begin++;
    end--;
  }
}


x86 assembly (clang, -O0):
<reverse_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1155 <reverse_str+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <reverse_str+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_str>:
cmp    %rsi,%rdi
jae    112c <reverse_str+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl (%rdi),%eax
movzbl 0x1(%rsi),%ecx
mov    %cl,(%rdi)
mov    %al,0x1(%rsi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <reverse_str+0x10>
ret

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

LLVM IR (-O2):
define void @reverse_str(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
store i8 %8, i8* %5
store i8 %7, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = getelementptr inbounds i8, i8* %6, i64 -1
%11 = icmp ult i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
void ajResourceoutExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ajResourceoutExit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_BLUE;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
void init_colors() {
  start_color();
  init_pair(0, COLOR_WHITE, COLOR_BLACK);
  init_pair(1, COLOR_BLUE, COLOR_BLACK);
  init_pair(2, COLOR_RED, COLOR_BLACK);
}


x86 assembly (clang, -O0):
<init_colors>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <start_color@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <init_pair@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
mov    0x2e78(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_colors>:
push   %rbx
xor    %eax,%eax
call   1040 <start_color@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edx
xor    %edi,%edi
call   1030 <init_pair@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
pop    %rbx
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_RED = global i32 0
define void @init_colors() {
%1 = call i32 (...) @start_color()
%2 = load i32, i32* @COLOR_WHITE
%3 = load i32, i32* @COLOR_BLACK
%4 = call i32 @init_pair(i32 0, i32 %2, i32 %3)
%5 = load i32, i32* @COLOR_BLUE
%6 = load i32, i32* @COLOR_BLACK
%7 = call i32 @init_pair(i32 1, i32 %5, i32 %6)
%8 = load i32, i32* @COLOR_RED
%9 = load i32, i32* @COLOR_BLACK
%10 = call i32 @init_pair(i32 2, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_RED = global i32 0
define void @init_colors() {
%1 = tail call i32 (...) @start_color()
%2 = load i32, i32* @COLOR_WHITE
%3 = load i32, i32* @COLOR_BLACK
%4 = tail call i32 @init_pair(i32 0, i32 %2, i32 %3)
%5 = load i32, i32* @COLOR_BLUE
%6 = load i32, i32* @COLOR_BLACK
%7 = tail call i32 @init_pair(i32 1, i32 %5, i32 %6)
%8 = load i32, i32* @COLOR_RED
%9 = load i32, i32* @COLOR_BLACK
%10 = tail call i32 @init_pair(i32 2, i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rotate0(int *, int);
void rotate1(int *nums, int size, int k) {
  k %= size;
  rotate0(nums, size);
  rotate0(nums, k);
  rotate0(nums + k, size - k);
}


x86 assembly (clang, -O0):
<rotate1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <rotate0@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <rotate0@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <rotate0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate1>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%eax
mov    %esi,%ebx
mov    %rdi,%r14
cltd
idiv   %esi
mov    %edx,%ebp
call   1030 <rotate0@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <rotate0@plt>
movslq %ebp,%rax
lea    (%r14,%rax,4),%rdi
sub    %eax,%ebx
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <rotate0@plt>

LLVM IR (-O0):
define void @rotate1(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = srem i32 %8, %7
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = call i32 @rotate0(i32* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = call i32 @rotate0(i32* %13, i32 %14)
%16 = load i32*, i32** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = sub nsw i32 %20, %21
%23 = call i32 @rotate0(i32* %19, i32 %22)
ret void
}

LLVM IR (-O2):
define void @rotate1(i32* %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %1
%5 = tail call i32 @rotate0(i32* %0, i32 %1)
%6 = tail call i32 @rotate0(i32* %0, i32 %4)
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %4
%10 = tail call i32 @rotate0(i32* %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wdctl_command(int);
void wdctl_clear_trusted_local_maclist(void) { wdctl_command(35); }


x86 assembly (clang, -O0):
<wdctl_clear_trusted_local_maclist>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1030 <wdctl_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdctl_clear_trusted_local_maclist>:
mov    $0x23,%edi
jmp    1030 <wdctl_command@plt>

LLVM IR (-O0):
define void @wdctl_clear_trusted_local_maclist() {
%1 = call i32 @wdctl_command(i32 35)
ret void
}

LLVM IR (-O2):
define void @wdctl_clear_trusted_local_maclist() {
%1 = tail call i32 @wdctl_command(i32 35)
ret void
}
/* Variables and functions */
scalar_t__ _U_Qfcmp(long double, long double, int);
int _U_Qfge(long double a, long double b) {
  return (_U_Qfcmp(a, b, 1 | 4 | 16) != 0);
}


x86 assembly (clang, -O0):
<_U_Qfge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x15,%edi
call   1030 <_U_Qfcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfge>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    $0x15,%edi
call   1030 <_U_Qfcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @_U_Qfge(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* %4
%7 = call i64 @_U_Qfcmp(x86_fp80 %5, x86_fp80 %6, i32 21)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_U_Qfge(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @_U_Qfcmp(x86_fp80 %0, x86_fp80 %1, i32 21)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void print_float(float out) { printf("%f\n", out); }


x86 assembly (clang, -O0):
<print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @print_float(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ty();
void __attribute__((simd)) gf() { ty(); }


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

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

LLVM IR (-O0):
define void @gf() {
%1 = call i32 (...) @ty()
ret void
}

LLVM IR (-O2):
define void @gf() {
%1 = tail call i32 (...) @ty()
ret void
}
int test_imm_10uint8_mem(unsigned char *val) {
  return ((*val) & (0x10 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_10uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 16
%7 = icmp ne i32 %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_10uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 16
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clog_write(int *, char *);
void clog_write__(int *clen, char *c) { clog_write(clen, c); }


x86 assembly (clang, -O0):
<clog_write__>:
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 <clog_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clog_write__>:
jmp    1030 <clog_write@plt>

LLVM IR (-O0):
define void @clog_write__(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 @clog_write(i32* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @clog_write__(i32* %0, i8* %1) {
%3 = tail call i32 @clog_write(i32* %0, i8* %1)
ret void
}
float fahr_to_celsius(float fahr) { return (5.0 * (fahr - 32) / 9); }


x86 assembly (clang, -O0):
<fahr_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xefa(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_celsius>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr_to_celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fpext float %4 to double
%6 = fmul double 5.000000e+00, %5
%7 = fdiv double %6, 9.000000e+00
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @fahr_to_celsius(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fmul double %3, 5.000000e+00
%5 = fdiv double %4, 9.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
unsigned char *hmac_gost(unsigned char *, unsigned char const *, size_t,
                         unsigned char const *, size_t);
unsigned char *mac_hmac_gost(unsigned char *out, const unsigned char *key,
                             size_t key_len, const unsigned char *msg,
                             size_t msg_len) {
  return hmac_gost(out, key, key_len, msg, msg_len);
}


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

x86 assembly (clang, -O2):
<mac_hmac_gost>:
jmp    1030 <hmac_gost@plt>

LLVM IR (-O0):
define i8* @mac_hmac_gost(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_gost(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_gost(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_gost(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Variables and functions */
long factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  printf("Provide a number:\n");
  scanf("%d", &n);
  long val = factorial(n);
  printf("factorial: %ld\n", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <factorial@plt>
lea    0xe8d(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Provide a number:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"factorial: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i64 @factorial(i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"factorial: %ld\0A\00"
@str = [18 x i8] c"Provide a number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %6)
ret i32 0
}