xunge/DecIR huggingface dataset:
/* Type definitions */
struct cq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cq_flush(struct cq *);
int /*<<< orphan*/ free(struct cq *);
void cq_free(struct cq *cq) {
  cq_flush(cq);
  free(cq);
  return;
}


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

x86 assembly (clang, -O2):
<cq_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <cq_flush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cq = type { i32 }
define void @cq_free(%struct.cq* %0) {
%2 = alloca %struct.cq*
store %struct.cq* %0, %struct.cq** %2
%3 = load %struct.cq*, %struct.cq** %2
%4 = call i32 @cq_flush(%struct.cq* %3)
%5 = load %struct.cq*, %struct.cq** %2
%6 = call i32 @free(%struct.cq* %5)
ret void
}

LLVM IR (-O2):
%struct.cq = type { i32 }
define void @cq_free(%struct.cq* %0) {
%2 = tail call i32 @cq_flush(%struct.cq* %0)
%3 = tail call i32 @free(%struct.cq* %0)
ret void
}
inverhbuf(p, n) register *p;
{
  for (; --n >= 0; ++p)
    *p = inverhword(*p);
}


x86 assembly (clang, -O0):
<inverhbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     1157 <inverhbuf+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <inverhword@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <inverhbuf+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverhbuf>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1137 <inverhbuf+0x27>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
mov    (%rbx),%edi
xor    %eax,%eax
call   1030 <inverhword@plt>
mov    %eax,(%rbx)
add    $0x4,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <inverhbuf+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inverhbuf(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = add nsw i32 %7, -1
store i32 %8, i32* %5
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = call i32 (i32, ...) bitcast (i32 (...)* @inverhword to i32 (i32, ...)*)(i32 %12)
%14 = load i32*, i32** %4
store i32 %13, i32* %14
br label %15
15: ; preds = %10
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %4
br label %6
18: ; preds = %6
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @inverhbuf(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = load i32, i32* %6
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @inverhword to i32 (i32, ...)*)(i32 %8)
store i32 %9, i32* %6
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret i32 undef
}
void kasan_alloc_pages(struct page *page, unsigned int order) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @kasan_alloc_pages(%struct.page* %0, i32 %1) {
%3 = alloca %struct.page*
%4 = alloca i32
store %struct.page* %0, %struct.page** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @kasan_alloc_pages(%struct.page* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t gettimeofday64(void) {
  uint64_t timestamp;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  timestamp = tv.tv_sec;
  timestamp += tv.tv_usec / 1000000;
  timestamp *= 1000000;
  timestamp += tv.tv_usec % 1000000;
  return timestamp;
}


x86 assembly (clang, -O0):
<gettimeofday64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday64>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%edx
add    (%rsp),%ecx
imul   $0xf4240,%ecx,%ecx
sub    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @gettimeofday64() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %1
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000000
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %8
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, 1000000
store i32 %12, i32* %1
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%14 = load i32, i32* %13
%15 = srem i32 %14, 1000000
%16 = load i32, i32* %1
%17 = add nsw i32 %16, %15
store i32 %17, i32* %1
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @gettimeofday64() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000000
%9 = add nsw i32 %8, %5
%10 = mul nsw i32 %9, 1000000
%11 = srem i32 %7, 1000000
%12 = add nsw i32 %10, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ append();
char current();
int /*<<< orphan*/ expect_ch(char);
scalar_t__ isalnum(char);
int identifier(void) {
  while (isalnum(current()))
    append();
  if (':' == current()) {
    expect_ch(':');
    return 2;
  } else {
    return 3;
  }
}


x86 assembly (clang, -O0):
<identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <current@plt>
movsbl %al,%edi
call   1050 <isalnum@plt>
cmp    $0x0,%rax
je     116d <identifier+0x2d>
mov    $0x0,%al
call   1030 <append@plt>
jmp    1148 <identifier+0x8>
mov    $0x0,%al
call   1060 <current@plt>
movsbl %al,%ecx
mov    $0x3a,%eax
cmp    %ecx,%eax
jne    119a <identifier+0x5a>
mov    $0x3a,%edi
call   1040 <expect_ch@plt>
movl   $0x2,-0x4(%rbp)
jmp    11a1 <identifier+0x61>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identifier>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <current@plt>
movsbl %al,%edi
call   1050 <isalnum@plt>
test   %rax,%rax
je     116d <identifier+0x2d>
xor    %eax,%eax
call   1030 <append@plt>
jmp    1150 <identifier+0x10>
xor    %eax,%eax
call   1060 <current@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    $0x3a,%cl
jne    118f <identifier+0x4f>
mov    $0x3a,%edi
call   1040 <expect_ch@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @identifier() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @current()
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @append()
br label %2
8: ; preds = %2
%9 = call signext i8 (...) @current()
%10 = sext i8 %9 to i32
%11 = icmp eq i32 58, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @expect_ch(i8 signext 58)
store i32 2, i32* %1
br label %15
14: ; preds = %8
store i32 3, i32* %1
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @identifier() {
%1 = tail call signext i8 (...) @current()
%2 = tail call i64 @isalnum(i8 signext %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @append()
%6 = tail call signext i8 (...) @current()
%7 = tail call i64 @isalnum(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call signext i8 (...) @current()
%11 = icmp eq i8 %10, 58
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @expect_ch(i8 signext 58)
br label %14
14: ; preds = %9, %12
%15 = phi i32 [ 2, %12 ], [ 3, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void mcsp_rawnamenode_hook_free(void *hook) {
  if (hook) {
    sfree(hook);
  }
  return;
}


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

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

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

LLVM IR (-O2):
define void @mcsp_rawnamenode_hook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *get_string_at_field(char *, int);
char *get_habit(char *line) { return get_string_at_field(line, 1); }


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

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

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

LLVM IR (-O2):
define i8* @get_habit(i8* %0) {
%2 = tail call i8* @get_string_at_field(i8* %0, i32 1)
ret i8* %2
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ zero_user_segments(struct page *, unsigned int, unsigned int,
                                      int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) void zero_user(struct page *page, unsigned start,
                                        unsigned size) {
  zero_user_segments(page, start, start + size, 0, 0);
}


x86 assembly (clang, -O0):
<zero_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <zero_user_segments@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_user>:
add    %esi,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <zero_user_segments@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @zero_user(%struct.page* %0, i32 %1, i32 %2) {
%4 = alloca %struct.page*
%5 = alloca i32
%6 = alloca i32
store %struct.page* %0, %struct.page** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.page*, %struct.page** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = call i32 @zero_user_segments(%struct.page* %7, i32 %8, i32 %11, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @zero_user(%struct.page* %0, i32 %1, i32 %2) {
%4 = add i32 %2, %1
%5 = tail call i32 @zero_user_segments(%struct.page* %0, i32 %1, i32 %4, i32 0, i32 0)
ret void
}
void set_bishop(char *p) { *p |= (1 << 2); }


x86 assembly (clang, -O0):
<set_bishop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x4,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bishop>:
orb    $0x4,(%rdi)
ret

LLVM IR (-O0):
define void @set_bishop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @set_bishop(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = or i8 %2, 4
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void libmain() {
  while (1) {
    puts("Hello world");
    sleep(3);
  }
}


x86 assembly (clang, -O0):
<libmain>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <libmain+0x9>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
jmp    1129 <libmain+0x9>

x86 assembly (clang, -O2):
<libmain>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
jmp    1130 <libmain+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define void @libmain() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 3)
br label %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @libmain() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 3)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned int be8put(void *p, uint8_t v) {
  uint8_t *a;
  a = p;
  a[0] = v;
  return 1;
}


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

x86 assembly (clang, -O2):
<be8put>:
mov    %esi,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @be8put(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ RB_BuildTables();
void RB_InitBackend(void) { RB_BuildTables(); }


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

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

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

LLVM IR (-O2):
define void @RB_InitBackend() {
%1 = tail call i32 (...) @RB_BuildTables()
ret void
}
void RTUtf16ToLatin1Tag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16ToLatin1Tag() {
ret void
}
int max(int m, int n) { return m > n ? m : n; }


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

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

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

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


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

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

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

LLVM IR (-O2):
@str = [78 x i8] c"------ -------\0A| | >>-------> | |\0A------ -------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int Bank_int_IsValidName(const char *Name) {
  if (!Name)
    return 0;
  while (*Name) {
    if (*Name == '\'')
      return 0;
    Name++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<Bank_int_IsValidName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <Bank_int_IsValidName+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1165 <Bank_int_IsValidName+0x65>
jmp    1124 <Bank_int_IsValidName+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <Bank_int_IsValidName+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    114d <Bank_int_IsValidName+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <Bank_int_IsValidName+0x65>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Bank_int_IsValidName+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bank_int_IsValidName>:
xor    %eax,%eax
test   %rdi,%rdi
je     1127 <Bank_int_IsValidName+0x27>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1122 <Bank_int_IsValidName+0x22>
cmp    $0x27,%cl
je     1127 <Bank_int_IsValidName+0x27>
add    $0x1,%rdi
jmp    1110 <Bank_int_IsValidName+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Bank_int_IsValidName(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %9
i8 39, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
br label %9
9: ; preds = %3, %8, %1
%10 = phi i32 [ 0, %1 ], [ 0, %8 ], [ 1, %3 ]
ret i32 %10
}
/* Variables and functions */
int insert_mode();
int /*<<< orphan*/ lnend();
int append_end(void) {
  lnend();
  return insert_mode();
}


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

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

LLVM IR (-O0):
define i32 @append_end() {
%1 = call i32 (...) @lnend()
%2 = call i32 (...) @insert_mode()
ret i32 %2
}

LLVM IR (-O2):
define i32 @append_end() {
%1 = tail call i32 (...) @lnend()
%2 = tail call i32 (...) @insert_mode()
ret i32 %2
}
char *strcpy(char *s1, const char *s2) {
  register char *s = s1;
  while ((*s++ = *s2++) != 0)
    ;
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *orig_localtime(scalar_t__ *);
struct tm *localtime(const time_t *timep) {
  time_t t = *timep - 60 * 60 * 24;
  return orig_localtime(&t);
}


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

x86 assembly (clang, -O2):
<localtime>:
push   %rax
mov    $0xfffffffffffeae80,%rax
add    (%rdi),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <orig_localtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = sub nsw i64 %5, 86400
store i64 %6, i64* %3
%7 = call %struct.tm* @orig_localtime(i64* %3)
ret %struct.tm* %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i64* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %0
%5 = add nsw i64 %4, -86400
store i64 %5, i64* %2
%6 = call %struct.tm* @orig_localtime(i64* %2)
ret %struct.tm* %6
}
/* Variables and functions */
scalar_t__ fabs(float);
float QuickDistance2d(float x, float y) {
  float Min;
  x = (float)fabs(x);
  y = (float)fabs(y);
  if (x > y) {
    Min = y;
  } else {
    Min = x;
  }
  return (x + y - (0.5f * Min));
}


x86 assembly (clang, -O0):
<QuickDistance2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1168 <QuickDistance2d+0x58>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1172 <QuickDistance2d+0x62>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  0xe77(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickDistance2d>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movaps %xmm1,%xmm0
movss  (%rsp),%xmm2
minss  %xmm2,%xmm0
addss  %xmm1,%xmm2
mulss  0xeac(%rip),%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @QuickDistance2d(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = call i64 @fabs(float %6)
%8 = sitofp i64 %7 to float
store float %8, float* %3
%9 = load float, float* %4
%10 = call i64 @fabs(float %9)
%11 = sitofp i64 %10 to float
store float %11, float* %4
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fcmp ogt float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load float, float* %4
store float %16, float* %5
br label %19
17: ; preds = %2
%18 = load float, float* %3
store float %18, float* %5
br label %19
19: ; preds = %17, %15
%20 = load float, float* %3
%21 = load float, float* %4
%22 = fadd float %20, %21
%23 = load float, float* %5
%24 = call float @llvm.fmuladd.f32(float -5.000000e-01, float %23, float %22)
ret float %24
}

LLVM IR (-O2):
define float @QuickDistance2d(float %0, float %1) {
%3 = tail call i64 @fabs(float %0)
%4 = sitofp i64 %3 to float
%5 = tail call i64 @fabs(float %1)
%6 = sitofp i64 %5 to float
%7 = fcmp ogt float %4, %6
%8 = select i1 %7, float %6, float %4
%9 = fadd float %4, %6
%10 = tail call float @llvm.fmuladd.f32(float %8, float -5.000000e-01, float %9)
ret float %10
}
/* Variables and functions */
size_t ZSTD_minGain(size_t srcSize) { return (srcSize >> 6) + 2; }


x86 assembly (clang, -O0):
<ZSTD_minGain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x6,%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZSTD_minGain>:
shr    $0x6,%rdi
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @ZSTD_minGain(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 6
%5 = add i64 %4, 2
ret i64 %5
}

LLVM IR (-O2):
define i64 @ZSTD_minGain(i64 %0) {
%2 = lshr i64 %0, 6
%3 = add nuw nsw i64 %2, 2
ret i64 %3
}
/* Variables and functions */
scalar_t__ gets(char *);
int hash(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char word[4096 + 1];
  while (gets(word))
    printf("%s=%d\n", word, hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1010(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     118c <main+0x5c>
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
lea    -0x1010(%rbp),%rdi
call   1030 <hash@plt>
mov    -0x1018(%rbp),%rsi
mov    %eax,%edx
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    %rsp,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     1182 <main+0x52>
mov    %rsp,%rbx
lea    0xeaf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <hash@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4097 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [4097 x i8], [4097 x i8]* %2, i64 0, i64 0
%5 = call i64 @gets(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = getelementptr inbounds [4097 x i8], [4097 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4097 x i8], [4097 x i8]* %2, i64 0, i64 0
%10 = call i32 @hash(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %10)
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s=%d\0A\00"
define i32 @main() {
%1 = alloca [4097 x i8]
%2 = getelementptr inbounds [4097 x i8], [4097 x i8]* %1, i64 0, i64 0
%3 = call i64 @gets(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = call i32 @hash(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %6)
%8 = call i64 @gets(i8* %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ inv_fifo_protocol_helper_decode_q30_quat(void const *,
                                                            int /*<<< orphan*/,
                                                            float *, float *,
                                                            float *, float *,
                                                            float *);
void inv_fifo_protocol_helper_decode_georv_data(const void *in, uint16_t len,
                                                float *x, float *y, float *z,
                                                float *w, float *a) {
  inv_fifo_protocol_helper_decode_q30_quat(in, len, x, y, z, w, a);
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_georv_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <inv_fifo_protocol_helper_decode_q30_quat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_georv_data>:
jmp    1030 <inv_fifo_protocol_helper_decode_q30_quat@plt>

LLVM IR (-O0):
define void @inv_fifo_protocol_helper_decode_georv_data(i8* %0, i32 %1, float* %2, float* %3, float* %4, float* %5, float* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
store i8* %0, i8** %8
store i32 %1, i32* %9
store float* %2, float** %10
store float* %3, float** %11
store float* %4, float** %12
store float* %5, float** %13
store float* %6, float** %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load float*, float** %10
%18 = load float*, float** %11
%19 = load float*, float** %12
%20 = load float*, float** %13
%21 = load float*, float** %14
%22 = call i32 @inv_fifo_protocol_helper_decode_q30_quat(i8* %15, i32 %16, float* %17, float* %18, float* %19, float* %20, float* %21)
ret void
}

LLVM IR (-O2):
define void @inv_fifo_protocol_helper_decode_georv_data(i8* %0, i32 %1, float* %2, float* %3, float* %4, float* %5, float* %6) {
%8 = tail call i32 @inv_fifo_protocol_helper_decode_q30_quat(i8* %0, i32 %1, float* %2, float* %3, float* %4, float* %5, float* %6)
ret void
}
int test_imm_C2int8_mem(signed char *val) {
  return ((*val) & (-0xC2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C2int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff3e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C2int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -194
%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_C2int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -194
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ AddFPS34();
void addfps() { AddFPS34(); }


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

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

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

LLVM IR (-O2):
define void @addfps() {
%1 = tail call i32 (...) @AddFPS34()
ret void
}
/* Variables and functions */
scalar_t__ roundf(float);
int interpNN_b(unsigned char *sl, int w, int h, float x, float y,
               unsigned char *v) {
  *v = sl[(int)roundf(x) + (int)roundf(y) * w];
  return 0;
}


x86 assembly (clang, -O0):
<interpNN_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <roundf@plt>
mov    %eax,-0x2c(%rbp)
movss  -0x18(%rbp),%xmm0
call   1030 <roundf@plt>
mov    -0x2c(%rbp),%ecx
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
imul   -0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpNN_b>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
movss  %xmm1,0x4(%rsp)
mov    %esi,%ebp
mov    %rdi,%r15
call   1030 <roundf@plt>
mov    %rax,%rbx
movss  0x4(%rsp),%xmm0
call   1030 <roundf@plt>
imul   %ebp,%eax
add    %ebx,%eax
cltq
mov    (%r15,%rax,1),%al
mov    %al,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @interpNN_b(i8* %0, i32 %1, i32 %2, float %3, float %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca i8*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store float %3, float* %10
store float %4, float* %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load float, float* %10
%15 = call i64 @roundf(float %14)
%16 = trunc i64 %15 to i32
%17 = load float, float* %11
%18 = call i64 @roundf(float %17)
%19 = trunc i64 %18 to i32
%20 = load i32, i32* %8
%21 = mul nsw i32 %19, %20
%22 = add nsw i32 %16, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %13, i64 %23
%25 = load i8, i8* %24
%26 = load i8*, i8** %12
store i8 %25, i8* %26
ret i32 0
}

LLVM IR (-O2):
define i32 @interpNN_b(i8* nocapture %0, i32 %1, i32 %2, float %3, float %4, i8* nocapture writeonly %5) {
%7 = tail call i64 @roundf(float %3)
%8 = trunc i64 %7 to i32
%9 = tail call i64 @roundf(float %4)
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, %1
%12 = add nsw i32 %11, %8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
store i8 %15, i8* %5
ret i32 0
}
char *get_opt(void *val) { return "?"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
define i8* @get_opt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @get_opt(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ match(char const *, char const *);
int match2strings(const char *patrn, const char *string) {
  return !match(patrn, string);
}


x86 assembly (clang, -O0):
<match2strings>:
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 <match@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @match2strings(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 i32 @match(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @match2strings(i8* %0, i8* %1) {
%3 = tail call i32 @match(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XResizeRequestEvent;

/* Variables and functions */
unsigned long get_XResizeRequestEvent_serial(void *_p) {
  return (unsigned long)((XResizeRequestEvent *)_p)->serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XResizeRequestEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
void get_random_bytes(uint8_t *buf, size_t len) {
  for (size_t i = 0; i < len; i++) {
    buf[i] = rand();
  }
}


x86 assembly (clang, -O0):
<get_random_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115b <get_random_bytes+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <get_random_bytes+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_bytes>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <get_random_bytes+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <get_random_bytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @get_random_bytes(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %7, i32* %8
%9 = add nuw i64 %6, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %4, label %5
}
int vecsize_from_writemask(const int m) {
  return (m & 1) + ((m >> 1) & 1) + ((m >> 2) & 1) + ((m >> 3) & 1);
}


x86 assembly (clang, -O0):
<vecsize_from_writemask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecsize_from_writemask>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x3,%edi
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @vecsize_from_writemask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %6, 1
%8 = add nsw i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = and i32 %10, 1
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 3
%15 = and i32 %14, 1
%16 = add nsw i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @vecsize_from_writemask(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %4, %2
%6 = lshr i32 %0, 2
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %5, %7
%9 = lshr i32 %0, 3
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int);
int main() {
  assert(foo(0) == 1);
  assert(foo(1) == 9);
  assert(foo(2) == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
call   1040 <foo@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @foo(i32 1)
%7 = icmp eq i32 %6, 9
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @foo(i32 2)
%11 = icmp eq i32 %10, 3
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @foo(i32 1)
%6 = icmp eq i32 %5, 9
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @foo(i32 2)
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}
/* Variables and functions */
int isgraph(int);
int sim_isgraph(int c) { return ((c < 0) || (c >= 128)) ? 0 : isgraph(c); }


x86 assembly (clang, -O0):
<sim_isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1132 <sim_isgraph+0x22>
cmpl   $0x80,-0x4(%rbp)
jl     113c <sim_isgraph+0x2c>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <sim_isgraph+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isgraph@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_isgraph>:
cmp    $0x7f,%edi
jbe    1118 <sim_isgraph+0x8>
xor    %eax,%eax
ret
jmp    1030 <isgraph@plt>

LLVM IR (-O0):
define i32 @sim_isgraph(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 %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 128
br i1 %7, label %8, label %9
8: ; preds = %5, %1
br label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32 @isgraph(i32 %10)
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ 0, %8 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @sim_isgraph(i32 %0) {
%2 = icmp ugt i32 %0, 127
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isgraph(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t _close(int32_t fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}