xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
void uninit_puts(void) {
  const char *s;
  puts(s);
}


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

x86 assembly (clang, -O2):
<uninit_puts>:
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @uninit_puts() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @puts(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninit_puts() {
%1 = tail call i32 @puts(i8* dereferenceable(1) undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chmod(char *, int);
int /*<<< orphan*/ rmdir(char *);
void cleanup(void) {
  chmod("top-bug-138", 0777);
  rmdir("top-bug-138/a/b");
  rmdir("top-bug-138/a");
  rmdir("top-bug-138");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1ff,%esi
call   1040 <chmod@plt>
lea    0xed0(%rip),%rdi
call   1030 <rmdir@plt>
lea    0xed4(%rip),%rdi
call   1030 <rmdir@plt>
lea    0xeac(%rip),%rdi
call   1030 <rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1ff,%esi
call   1040 <chmod@plt>
lea    0xed0(%rip),%rdi
call   1030 <rmdir@plt>
lea    0xed4(%rip),%rdi
call   1030 <rmdir@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <rmdir@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"top-bug-138\00"
@.str.1 = [16 x i8] c"top-bug-138/a/b\00"
@.str.2 = [14 x i8] c"top-bug-138/a\00"
define void @cleanup() {
%1 = call i32 @chmod(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 511)
%2 = call i32 @rmdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @rmdir(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @rmdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"top-bug-138\00"
@.str.1 = [16 x i8] c"top-bug-138/a/b\00"
@.str.2 = [14 x i8] c"top-bug-138/a\00"
define void @cleanup() {
%1 = tail call i32 @chmod(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 511)
%2 = tail call i32 @rmdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @rmdir(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @rmdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long stb_randLCG_explicit(unsigned long seed) {
  return seed * 2147001325 + 715136305;
}


x86 assembly (clang, -O0):
<stb_randLCG_explicit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x7ff8a3ed,-0x8(%rbp),%rax
7f
add    $0x2aa01d31,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_randLCG_explicit>:
imul   $0x7ff8a3ed,%rdi,%rax
add    $0x2aa01d31,%rax
ret

LLVM IR (-O0):
define i64 @stb_randLCG_explicit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 2147001325
%5 = add i64 %4, 715136305
ret i64 %5
}

LLVM IR (-O2):
define i64 @stb_randLCG_explicit(i64 %0) {
%2 = mul i64 %0, 2147001325
%3 = add i64 %2, 715136305
ret i64 %3
}
int shift(int l, int r) { return l << r; }


x86 assembly (clang, -O0):
<shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @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* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @shift(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
uint32_t rotl32(uint32_t x, int8_t r) {
  r = r % 32;
  if (r < 0)
    r += 32;
  return (x << r) | (x >> (32 - r));
}


x86 assembly (clang, -O0):
<rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112b <rotl32+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl32>:
lea    0x1f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xffffffe0,%eax
sub    %eax,%esi
lea    0x20(%rsi),%eax
test   %esi,%esi
movzbl %al,%ecx
cmovns %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl32(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 = srem i32 %5, 32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 32
store i32 %11, i32* %4
br label %12
12: ; preds = %9, %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 %13, %14
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sub nsw i32 32, %17
%19 = ashr i32 %16, %18
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = srem i32 %1, 32
%4 = icmp slt i32 %3, 0
%5 = add nsw i32 %3, 32
%6 = select i1 %4, i32 %5, i32 %3
%7 = shl i32 %0, %6
%8 = sub nuw nsw i32 32, %6
%9 = ashr i32 %0, %8
%10 = or i32 %9, %7
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t u64_min(uint64_t x, uint64_t y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<u64_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <u64_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <u64_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u64_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @u64_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int foo() {
  static int x = 0;
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@foo.x = internal global i32 0
define i32 @foo() {
%1 = load i32, i32* @foo.x
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int ENOTSUP;
int fesetenv(const fenv_t *envp) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<fesetenv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetenv>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @fesetenv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @fesetenv(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ exp(double);
float expf(float s) { return (float)exp((double)s); }


x86 assembly (clang, -O0):
<expf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <exp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @expf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @exp(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @expf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @exp(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
scalar_t__ asprintf(char **, char *, char const *);
char *get_fd_dir_path(const char *proc_dir) {
  char *buf;
  if (asprintf(&buf, "/proc/%s/fd", proc_dir) < 0) {
    return NULL;
  }
  return buf;
}


x86 assembly (clang, -O0):
<get_fd_dir_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0x0,%rax
jge    1147 <get_fd_dir_path+0x37>
movq   $0x0,-0x8(%rbp)
jmp    114f <get_fd_dir_path+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fd_dir_path>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
test   %rax,%rax
js     112e <get_fd_dir_path+0x1e>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/proc/%s/fd\00"
define i8* @get_fd_dir_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @asprintf(i8** %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %11
11: ; preds = %9, %8
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"/proc/%s/fd\00"
define i8* @get_fd_dir_path(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @asprintf(i8** %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp slt i64 %4, 0
%6 = load i8*, i8** %2
%7 = select i1 %5, i8* null, i8* %6
ret i8* %7
}
void parport() {}


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

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

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

LLVM IR (-O2):
define void @parport() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stderr;
int yyerror(const char *msg) {
  extern char *yytext;
  fprintf(stderr, "Parse error near token \"%s\": %s\n", yytext, msg);
  return -1;
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%rcx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rcx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%rdx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Parse error near token \22%s\22: %s\0A\00"
@yytext = external global i8*
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** @yytext
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Parse error near token \22%s\22: %s\0A\00"
@yytext = external global i8*
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** @yytext
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0)
ret i32 -1
}
extern void log_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @log_init() {
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stat(char *, struct stat *);
int main() {
  struct stat buf;
  stat("stat.c", &buf);
  printf("stat.c file size = %d\n", buf.st_size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [7 x i8] c"stat.c\00"
@.str.1 = [23 x i8] c"stat.c file size = %d\0A\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = call i32 @stat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%3 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [7 x i8] c"stat.c\00"
@.str.1 = [23 x i8] c"stat.c file size = %d\0A\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doit();
int main() { doit(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @doit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @doit()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int CRCCCITT(int *, int, int, int);
int8_t update_crc16(uint8_t *buffer) {
  uint16_t crc = CRCCCITT(buffer, 10, 0xffff, 0xffff);
  buffer[10] = crc >> 8;
  buffer[11] = crc & 0xff;
}


x86 assembly (clang, -O0):
<update_crc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
mov    $0xffff,%ecx
mov    %ecx,%edx
call   1030 <CRCCCITT@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x28(%rax)
mov    -0x14(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x2c(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_crc16>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
mov    $0xffff,%edx
mov    $0xffff,%ecx
call   1030 <CRCCCITT@plt>
movzbl %al,%ecx
sar    $0x8,%eax
mov    %eax,0x28(%rbx)
mov    %ecx,0x2c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @update_crc16(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @CRCCCITT(i32* %5, i32 10, i32 65535, i32 65535)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 10
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 11
store i32 %12, i32* %14
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @update_crc16(i32* %0) {
%2 = tail call i32 @CRCCCITT(i32* %0, i32 10, i32 65535, i32 65535)
%3 = ashr i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 10
store i32 %3, i32* %4
%5 = and i32 %2, 255
%6 = getelementptr inbounds i32, i32* %0, i64 11
store i32 %5, i32* %6
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ sig_block(int /*<<< orphan*/);
extern void sig_child_block(void) { sig_block(SIGCHLD); }


x86 assembly (clang, -O0):
<sig_child_block>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_child_block>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_block@plt>

LLVM IR (-O0):
@SIGCHLD = global i32 0
define void @sig_child_block() {
%1 = load i32, i32* @SIGCHLD
%2 = call i32 @sig_block(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
define void @sig_child_block() {
%1 = load i32, i32* @SIGCHLD
%2 = tail call i32 @sig_block(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int ex_hashcasecmp_str(const char *s1, const char *s2) {
  return (0 == strcasecmp(s1, s2));
}


x86 assembly (clang, -O0):
<ex_hashcasecmp_str>:
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 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_hashcasecmp_str>:
push   %rax
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ex_hashcasecmp_str(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** %4
%7 = call i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ex_hashcasecmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int q1j() {
  int a[] = {11, 22};
  int *p = a;
  int *q = a + 1;
  printf("\n%s\n", "q1j ------");
  p++;
  q++;
  printf("%d %d\n", *p, *q);
  return 1;
}


x86 assembly (clang, -O0):
<q1j>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1j>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.q1j.a = [2 x i32] [i32 11, i32 22]
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1j ------\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @q1j() {
%1 = alloca [2 x i32]
%2 = alloca i32*
%3 = alloca i32*
%4 = bitcast [2 x i32]* %1 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32* %5, i32** %2
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32* %7, i32** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %2
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %16)
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1j ------\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @q1j() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 22, i32 poison)
ret i32 1
}
/* Variables and functions */
memchar() {
  char x, *p;
  &x, &p;
  x = *p++;
  x = *++p;
  x = *p--;
  x = *--p;
}


x86 assembly (clang, -O0):
<memchar>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x1(%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
mov    -0x1(%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @memchar() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %3
%6 = load i8, i8* %4
store i8 %6, i8* %2
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %8
store i8 %9, i8* %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 -1
store i8* %11, i8** %3
%12 = load i8, i8* %10
store i8 %12, i8* %2
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 -1
store i8* %14, i8** %3
%15 = load i8, i8* %14
store i8 %15, i8* %2
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @memchar() {
ret i32 undef
}
/* Variables and functions */
char *strchr(char *, char);
char *strdup(char *);
void strsplit6(char *string, char sep, char *first, char *second) {
  char *copy = strdup(string);
  char *sep_ptr = strchr(copy, sep);
  *copy = '\0';
  first = copy;
  second = sep_ptr + 1;
}


x86 assembly (clang, -O0):
<strsplit6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @strsplit6(i8* %0, i8 signext %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = load i8*, i8** %5
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = load i8, i8* %6
%15 = call i8* @strchr(i8* %13, i8 signext %14)
store i8* %15, i8** %10
%16 = load i8*, i8** %9
store i8 0, i8* %16
%17 = load i8*, i8** %9
store i8* %17, i8** %7
%18 = load i8*, i8** %10
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8* %19, i8** %8
ret void
}

LLVM IR (-O2):
define void @strsplit6(i8* nocapture %0, i8 signext %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf_realnum(int /*<<< orphan*/ *, char *, double,
                                   char *);
void fprintf_float(FILE *s, char *m1, double x, char *m2) {
  fprintf_realnum(s, m1, x, m2);
}


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

x86 assembly (clang, -O2):
<fprintf_float>:
jmp    1030 <fprintf_realnum@plt>

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

LLVM IR (-O2):
define void @fprintf_float(i32* %0, i8* %1, double %2, i8* %3) {
%5 = tail call i32 @fprintf_realnum(i32* %0, i8* %1, double %2, i8* %3)
ret void
}
/* Variables and functions */
char *decode_dup(char *, int);
char *decode_simple(char *input_string) { return decode_dup(input_string, 1); }


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

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

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

LLVM IR (-O2):
define i8* @decode_simple(i8* %0) {
%2 = tail call i8* @decode_dup(i8* %0, i32 1)
ret i8* %2
}
unsigned long long ull_hash(void *location) {
  return *((unsigned long long *)location);
}


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

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

LLVM IR (-O0):
define i64 @ull_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @ull_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void open() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @open() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRE3_set(void) { return U_WMRCORENONE_set("U_WMRE3"); }


x86 assembly (clang, -O0):
<U_WMRE3_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE3\00"
define i8* @U_WMRE3_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE3\00"
define i8* @U_WMRE3_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag) {}


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

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

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

LLVM IR (-O2):
%struct.bpf_sk_storage_diag = type opaque
define void @bpf_sk_storage_diag_free(%struct.bpf_sk_storage_diag* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ASRT_PrintInit() {
  printf("\nRunning tests");
  printf("\n================================");
}


x86 assembly (clang, -O0):
<ASRT_PrintInit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASRT_PrintInit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0ARunning tests\00"
@.str.1 = [34 x i8] c"\0A================================\00"
define void @ASRT_PrintInit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0ARunning tests\00"
@.str.1 = [34 x i8] c"\0A================================\00"
define void @ASRT_PrintInit() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_syntax(void) {
  printf("syntax:\n\n"
         "   compress    :  appack c <file> <packed_file>\n"
         "   decompress  :  appack d <packed_file> <depacked_file>\n\n");
}


x86 assembly (clang, -O0):
<show_syntax>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [116 x i8] c"syntax:\0A\0A compress : appack c <file> <packed_file>\0A decompress : appack d <packed_file> <depacked_file>\0A\0A\00"
define void @show_syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [115 x i8] c"syntax:\0A\0A compress : appack c <file> <packed_file>\0A decompress : appack d <packed_file> <depacked_file>\0A\00"
define void @show_syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([115 x i8], [115 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_inquiry_result_with_rssi_get_reserved(const uint8_t *event) {
  return event[10];
}


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

x86 assembly (clang, -O2):
<hci_event_inquiry_result_with_rssi_get_reserved>:
mov    0x28(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_inquiry_result_with_rssi_get_reserved(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 10
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ UP3D_GetParameter(int);
float UP3D_GetHeight() {
  uint32_t f = UP3D_GetParameter(0x0B);
  return *((float *)&f);
}


x86 assembly (clang, -O0):
<UP3D_GetHeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetHeight>:
push   %rax
mov    $0xb,%edi
call   1030 <UP3D_GetParameter@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @UP3D_GetHeight() {
%1 = alloca i32
%2 = call i32 @UP3D_GetParameter(i32 11)
store i32 %2, i32* %1
%3 = bitcast i32* %1 to float*
%4 = load float, float* %3
ret float %4
}

LLVM IR (-O2):
define float @UP3D_GetHeight() {
%1 = tail call i32 @UP3D_GetParameter(i32 11)
%2 = bitcast i32 %1 to float
ret float %2
}
compar(s, t) char *s, *t;
{
  while (*t)
    if (*s++ != *t++)
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <compar+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <compar+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <compar+0x5d>
jmp    110c <compar+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1127 <compar+0x27>
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <compar+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ emitf(int, char *, ...);
void emit_je(char *label) {
  emitf(657, "\t"
             "test %%rax, %%rax");
  emitf(658,
        "\t"
        "je %s",
        label);
}


x86 assembly (clang, -O0):
<emit_je>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x291,%edi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <emitf@plt>
mov    -0x8(%rbp),%rdx
mov    $0x292,%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <emitf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_je>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x291,%edi
xor    %eax,%eax
call   1030 <emitf@plt>
lea    0xee5(%rip),%rsi
mov    $0x292,%edi
mov    %rbx,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <emitf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\09test %%rax, %%rax\00"
@.str.1 = [7 x i8] c"\09je %s\00"
define void @emit_je(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i8*, ...) @emitf(i32 657, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @emitf(i32 658, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\09test %%rax, %%rax\00"
@.str.1 = [7 x i8] c"\09je %s\00"
define void @emit_je(i8* %0) {
%2 = tail call i32 (i32, i8*, ...) @emitf(i32 657, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, i8*, ...) @emitf(i32 658, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wlhybrid();
void sweepWL(double sweeps) {
  int i;
  for (i = 0; i < sweeps; ++i) {
    wlhybrid();
  };
}


x86 assembly (clang, -O0):
<sweepWL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <sweepWL+0x3d>
mov    $0x0,%al
call   1030 <wlhybrid@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <sweepWL+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweepWL>:
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <sweepWL+0x3d>
mov    $0x1,%ebx
movsd  %xmm0,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <wlhybrid@plt>
movsd  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
add    $0x1,%ebx
ucomisd %xmm1,%xmm0
ja     1130 <sweepWL+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @sweepWL(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = call i32 (...) @wlhybrid()
br label %11
11: ; preds = %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @sweepWL(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @wlhybrid()
%6 = add nuw nsw i32 %4, 1
%7 = sitofp i32 %6 to double
%8 = fcmp olt double %7, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _renice_error(char const *message, int ret) {
  fputs("renice"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_renice_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_renice_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"renice: \00"
@stderr = global i32 0
define i32 @_renice_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"renice: \00"
@stderr = global i32 0
define i32 @_renice_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
int main() {
  char *src = "string with\200inside !";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"string with\80inside !\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
long money_sub(long x, long y) { return x - y; }


x86 assembly (clang, -O0):
<money_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @money_sub(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @money_sub(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
OP(ed, fd) {}


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

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
void RTErrConvertToErrno(void) {}


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

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

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

LLVM IR (-O2):
define void @RTErrConvertToErrno() {
ret void
}
char *langDbgDevAy8910() { return "AY8910 PSG"; }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"AY8910 PSG\00"
define i8* @langDbgDevAy8910() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"AY8910 PSG\00"
define i8* @langDbgDevAy8910() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
void http_multi_data(char ch) {}


x86 assembly (clang, -O0):
<http_multi_data>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @http_multi_data(i8 signext %0) {
ret void
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int quat_is_near_zero(float *, float);
__attribute__((always_)) bool psquat_is_near_zero(struct quat *a,
                                                  float epsilon) {
  return quat_is_near_zero((float *)a, epsilon);
}


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

x86 assembly (clang, -O2):
<psquat_is_near_zero>:
jmp    1030 <quat_is_near_zero@plt>

LLVM IR (-O0):
%struct.quat = type { i32 }
define i32 @psquat_is_near_zero(%struct.quat* %0, float %1) {
%3 = alloca %struct.quat*
%4 = alloca float
store %struct.quat* %0, %struct.quat** %3
store float %1, float* %4
%5 = load %struct.quat*, %struct.quat** %3
%6 = bitcast %struct.quat* %5 to float*
%7 = load float, float* %4
%8 = call i32 @quat_is_near_zero(float* %6, float %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define i32 @psquat_is_near_zero(%struct.quat* %0, float %1) {
%3 = bitcast %struct.quat* %0 to float*
%4 = tail call i32 @quat_is_near_zero(float* %3, float %1)
ret i32 %4
}
void gtk_container_get_focus_hadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_get_focus_hadjustment() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ UINT16_MAX;
uint16_t __hsail_sat_add_u16(uint16_t a, uint16_t b) {
  uint32_t c = (uint32_t)a + (uint32_t)b;
  if (c > UINT16_MAX)
    return UINT16_MAX;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_add_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%rax
jle    113f <__hsail_sat_add_u16+0x3f>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <__hsail_sat_add_u16+0x47>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_add_u16>:
lea    (%rdi,%rsi,1),%rax
mov    0x2ed5(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rcx,%rax
cmovg  %rcx,%rax
ret

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

LLVM IR (-O2):
@UINT16_MAX = global i64 0
define i64 @__hsail_sat_add_u16(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = load i64, i64* @UINT16_MAX
%5 = icmp sgt i64 %3, %4
%6 = select i1 %5, i64 %4, i64 %3
ret i64 %6
}
int main() {
  *((unsigned int *)1) = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,0x1
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* inttoptr (i64 1 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store i32 0, i32* inttoptr (i64 1 to i32*)
ret i32 0
}