xunge/DecIR huggingface dataset:
/* Type definitions */
struct entry {
  int dummy;
};
typedef struct entry archnode;

/* Variables and functions */
scalar_t__ av_namespace_get(struct entry *);
int /*<<< orphan*/ av_namespace_set(struct entry *, void *);
int /*<<< orphan*/ av_unref_obj(struct entry *);
void av_arch_del_node(struct entry *ent) {
  struct archnode *nod;
  nod = (struct archnode *)av_namespace_get(ent);
  av_namespace_set(ent, ((void *)0));
  av_unref_obj(nod);
  av_unref_obj(ent);
}


x86 assembly (clang, -O0):
<av_arch_del_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <av_namespace_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <av_namespace_set@plt>
mov    -0x10(%rbp),%rdi
call   1030 <av_unref_obj@plt>
mov    -0x8(%rbp),%rdi
call   1030 <av_unref_obj@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_arch_del_node>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <av_namespace_get@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <av_namespace_set@plt>
mov    %r14,%rdi
call   1030 <av_unref_obj@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <av_unref_obj@plt>

LLVM IR (-O0):
%struct.entry = type { i32 }
%struct.archnode = type opaque
define void @av_arch_del_node(%struct.entry* %0) {
%2 = alloca %struct.entry*
%3 = alloca %struct.archnode*
store %struct.entry* %0, %struct.entry** %2
%4 = load %struct.entry*, %struct.entry** %2
%5 = call i64 @av_namespace_get(%struct.entry* %4)
%6 = inttoptr i64 %5 to %struct.archnode*
store %struct.archnode* %6, %struct.archnode** %3
%7 = load %struct.entry*, %struct.entry** %2
%8 = call i32 @av_namespace_set(%struct.entry* %7, i8* null)
%9 = load %struct.archnode*, %struct.archnode** %3
%10 = bitcast %struct.archnode* %9 to %struct.entry*
%11 = call i32 @av_unref_obj(%struct.entry* %10)
%12 = load %struct.entry*, %struct.entry** %2
%13 = call i32 @av_unref_obj(%struct.entry* %12)
ret void
}

LLVM IR (-O2):
%struct.entry = type { i32 }
define void @av_arch_del_node(%struct.entry* %0) {
%2 = tail call i64 @av_namespace_get(%struct.entry* %0)
%3 = tail call i32 @av_namespace_set(%struct.entry* %0, i8* null)
%4 = inttoptr i64 %2 to %struct.entry*
%5 = tail call i32 @av_unref_obj(%struct.entry* %4)
%6 = tail call i32 @av_unref_obj(%struct.entry* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hoic_sw(int, int);
int hdoip_cli_vrb_play(int fd, int fdr, char **argv, int argc) {
  hoic_sw(fd, (0x31000007));
  return 0;
}


x86 assembly (clang, -O0):
<hdoip_cli_vrb_play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x31000007,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdoip_cli_vrb_play>:
push   %rax
mov    $0x31000007,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hdoip_cli_vrb_play(i32 %0, i32 %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @hoic_sw(i32 %0, i32 822083591)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nfc_preset();
int nfc_send_command(int);
int nfc_reset() {
  nfc_preset();
  return nfc_send_command(0xff);
}


x86 assembly (clang, -O0):
<nfc_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nfc_preset@plt>
mov    $0xff,%edi
call   1040 <nfc_send_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfc_reset>:
push   %rax
xor    %eax,%eax
call   1030 <nfc_preset@plt>
mov    $0xff,%edi
pop    %rax
jmp    1040 <nfc_send_command@plt>

LLVM IR (-O0):
define i32 @nfc_reset() {
%1 = call i32 (...) @nfc_preset()
%2 = call i32 @nfc_send_command(i32 255)
ret i32 %2
}

LLVM IR (-O2):
define i32 @nfc_reset() {
%1 = tail call i32 (...) @nfc_preset()
%2 = tail call i32 @nfc_send_command(i32 255)
ret i32 %2
}
unsigned short getShort(unsigned char *data, int offset) {
  unsigned short res;
  res = data[offset + 0] << 0;
  res += data[offset + 1] << 8;
  return res;
}


x86 assembly (clang, -O0):
<getShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x0,%eax
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
shl    $0x8,%ecx
movzwl -0xe(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xe(%rbp)
movzwl -0xe(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getShort>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @getShort(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = add nsw i32 %1, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i16
%11 = shl nuw i16 %10, 8
%12 = zext i8 %5 to i16
%13 = or i16 %11, %12
ret i16 %13
}
__attribute__((no)) int mulv(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @mulv(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mulv(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int __libc_allocate_rtsig_private(int);
int __libc_allocate_rtsig(int high) {
  return __libc_allocate_rtsig_private(high);
}


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

x86 assembly (clang, -O2):
<__libc_allocate_rtsig>:
jmp    1030 <__libc_allocate_rtsig_private@plt>

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

LLVM IR (-O2):
define i32 @__libc_allocate_rtsig(i32 %0) {
%2 = tail call i32 @__libc_allocate_rtsig_private(i32 %0)
ret i32 %2
}
void _cgo_panic(void *a, int c) {}


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

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

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

LLVM IR (-O2):
define void @_cgo_panic(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void swi_handler(void) { printf("SWI HANDLER\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"SWI HANDLER\0A\00"
define void @swi_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"SWI HANDLER\00"
define void @swi_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void rop3_71_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_71_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_71_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_71_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = load i8*, i8** %4
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = load i8, i8* %6
%54 = zext i8 %53 to i32
%55 = and i32 %52, %54
%56 = or i32 %49, %55
%57 = trunc i32 %56 to i8
%58 = load i8*, i8** %4
store i8 %57, i8* %58
ret void
}

LLVM IR (-O2):
define void @rop3_71_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ gl2psMsg(int, char *);
void *realloc(void *, size_t);
void *gl2psRealloc(void *ptr, size_t size) {
  if (!size)
    return (NULL);
  ptr = realloc(ptr, size);
  if (!ptr) {
    gl2psMsg(3, "Couldn't reallocate requested memory");
    exit(1);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<gl2psRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <gl2psRealloc+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1197 <gl2psRealloc+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118f <gl2psRealloc+0x5f>
mov    $0x3,%edi
lea    0xe80(%rip),%rsi
call   1030 <gl2psMsg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl2psRealloc>:
push   %rax
test   %rsi,%rsi
je     1142 <gl2psRealloc+0x12>
call   1040 <realloc@plt>
test   %rax,%rax
je     1146 <gl2psRealloc+0x16>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb3(%rip),%rsi
mov    $0x3,%edi
call   1030 <gl2psMsg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Couldn't reallocate requested memory\00"
define i8* @gl2psRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %2
store i8* null, i8** %3
br label %20
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = call i32 @gl2psMsg(i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %9
%19 = load i8*, i8** %4
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %8
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [37 x i8] c"Couldn't reallocate requested memory\00"
define noalias i8* @gl2psRealloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @gl2psMsg(i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4, %2
%11 = phi i8* [ null, %2 ], [ %5, %4 ]
ret i8* %11
}
main() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int _close(int fildes __attribute__((unused))) {
  errno = ENOSYS;
  return -1;
}


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

x86 assembly (clang, -O2):
<_close>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_close(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
void USART6_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @USART6_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Planner_Reset();
void Planner_Init(void) { Planner_Reset(); }


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

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

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

LLVM IR (-O2):
define void @Planner_Init() {
%1 = tail call i32 (...) @Planner_Reset()
ret void
}
int adis16400_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @adis16400_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int Gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("Gcd( 45, 35 ) = %d\n", Gcd(45, 35));
  printf("Gcd( 1989, 1590 ) = %d\n", Gcd(1989, 1590));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2d,%edi
mov    $0x23,%esi
call   1040 <Gcd@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7c5,%edi
mov    $0x636,%esi
call   1040 <Gcd@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2d,%edi
mov    $0x23,%esi
call   1040 <Gcd@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7c5,%edi
mov    $0x636,%esi
call   1040 <Gcd@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Gcd( 45, 35 ) = %d\0A\00"
@.str.1 = [24 x i8] c"Gcd( 1989, 1590 ) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @Gcd(i32 45, i32 35)
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @Gcd(i32 1989, i32 1590)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Gcd( 45, 35 ) = %d\0A\00"
@.str.1 = [24 x i8] c"Gcd( 1989, 1590 ) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Gcd(i32 45, i32 35)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @Gcd(i32 1989, i32 1590)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dumpsys_gen_pa_init();
void dumpsys_pa_init(void) { dumpsys_gen_pa_init(); }


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

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

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

LLVM IR (-O2):
define void @dumpsys_pa_init() {
%1 = tail call i32 (...) @dumpsys_gen_pa_init()
ret void
}
int externfunc(int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i32 @externfunc(i32 returned %0) {
ret i32 %0
}
float ny(float f) { return 1.0 - f; }


x86 assembly (clang, -O0):
<ny>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ny>:
movss  0xef8(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ny(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @ny(float %0) {
%2 = fsub float 1.000000e+00, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ flush_init();
void render_clear() { flush_init(); }


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

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

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

LLVM IR (-O2):
define void @render_clear() {
%1 = tail call i32 (...) @flush_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void labelIfStart(int number) { printf(".L%dS:\n", number); }


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

x86 assembly (clang, -O2):
<labelIfStart>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c".L%dS:\0A\00"
define void @labelIfStart(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 = [13 x i8] c"hello World\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float *vec3(float *result, float x, float y, float z) {
  result[0] = x;
  result[1] = y;
  result[2] = z;
  return result;
}


x86 assembly (clang, -O0):
<vec3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3>:
mov    %rdi,%rax
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
ret

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

LLVM IR (-O2):
define float* @vec3(float* returned writeonly %0, float %1, float %2, float %3) {
store float %1, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %5
%6 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %6
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ amd8111_enable_rom();
void bootblock_southbridge_init(void) { amd8111_enable_rom(); }


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

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

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

LLVM IR (-O2):
define void @bootblock_southbridge_init() {
%1 = tail call i32 (...) @amd8111_enable_rom()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ip_acl_new() {
  printf("NOT IMPLEMENTED:"
         "pa_ip_acl_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_ip_acl_new\0A\00"
define i32 @pa_ip_acl_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_ip_acl_new\00"
define i32 @pa_ip_acl_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned int ctoi(unsigned char c) {
  if (c > '9')
    return (unsigned int)(c & 0x0F) + 9;
  else
    return (unsigned int)(c & 0x0F);
}


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1129 <ctoi+0x29>
movzbl -0x5(%rbp),%eax
and    $0xf,%eax
add    $0x9,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <ctoi+0x33>
movzbl -0x5(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoi>:
mov    %edi,%ecx
and    $0xf,%ecx
lea    0x9(%rcx),%eax
cmp    $0x3a,%dil
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ctoi(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sgt i32 %5, 57
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = add i32 %10, 9
store i32 %11, i32* %2
br label %16
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = and i32 %14, 15
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ctoi(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 57
%3 = and i8 %0, 15
%4 = zext i8 %3 to i32
%5 = add nuw nsw i32 %4, 9
%6 = select i1 %2, i32 %5, i32 %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, ("usage: logger [-is] [-f file] [-p pri] [-t tag] [-u "
                         "socket] [ message ... ]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [77 x i8] c"usage: logger [-is] [-f file] [-p pri] [-t tag] [-u socket] [ message ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [77 x i8] c"usage: logger [-is] [-f file] [-p pri] [-t tag] [-u socket] [ message ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *fmt_f32(float);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void print_input(float input) {
  char *in_fmt = fmt_f32(input);
  printf("from single: %s\n", in_fmt);
  free(in_fmt);
}


x86 assembly (clang, -O0):
<print_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <fmt_f32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_input>:
push   %rbx
call   1050 <fmt_f32@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"from single: %s\0A\00"
define void @print_input(float %0) {
%2 = alloca float
%3 = alloca i8*
store float %0, float* %2
%4 = load float, float* %2
%5 = call i8* @fmt_f32(float %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"from single: %s\0A\00"
define void @print_input(float %0) {
%2 = tail call i8* @fmt_f32(float %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int Strcmp2(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char target[] = "stackf";
  char source[] = "stacked";
  printf("%d\n", Strcmp2(source, target));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x13(%rbp)
lea    -0x13(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1040 <Strcmp2@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x666b63,0xb(%rsp)
movl   $0x63617473,0x8(%rsp)
63
movabs $0x64656b63617473,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <Strcmp2@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.target = [7 x i8] c"stackf\00"
@__const.main.source = [8 x i8] c"stacked\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [8 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = bitcast [8 x i8]* %3 to i8*
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%8 = call i32 @Strcmp2(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.target = [7 x i8] c"stackf\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 28259009574302835, i64* %2
%5 = call i32 @Strcmp2(i8* %4, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int answer_to_everything() { return 40 + 2; }


x86 assembly (clang, -O0):
<answer_to_everything>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @answer_to_everything() {
ret i32 42
}

LLVM IR (-O2):
define i32 @answer_to_everything() {
ret i32 42
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t next_dayofweek_offset(uint8_t dayofweek_of_cur, uint8_t dayofweek) {
  return (7 + dayofweek - dayofweek_of_cur) % 7;
}


x86 assembly (clang, -O0):
<next_dayofweek_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7,%eax
sub    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_dayofweek_offset>:
sub    %edi,%esi
mov    %esi,%eax
add    $0x7,%eax
cltq
imul   $0xffffffff92492493,%rax,%rax
shr    $0x20,%rax
add    %esi,%eax
add    $0x7,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x2,%eax
add    %ecx,%eax
lea    0x0(,%rax,8),%ecx
sub    %ecx,%eax
add    %esi,%eax
add    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @next_dayofweek_offset(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 = add nsw i32 7, %5
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %8, 7
ret i32 %9
}

LLVM IR (-O2):
define i32 @next_dayofweek_offset(i32 %0, i32 %1) {
%3 = sub i32 7, %0
%4 = add i32 %3, %1
%5 = srem i32 %4, 7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void t1_usage(void) {
  fprintf(stderr, "usage: ./flocks_test 1 on|off -c|-f|-l /path/to/file\n");
}


x86 assembly (clang, -O0):
<t1_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"usage: ./flocks_test 1 on|off -c|-f|-l /path/to/file\0A\00"
define void @t1_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"usage: ./flocks_test 1 on|off -c|-f|-l /path/to/file\0A\00"
define void @t1_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}
int ctest3(int i) { return i + 1; }


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

x86 assembly (clang, -O2):
<ctest3>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ctest3(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int int_abs(int a) { return a >= 0 ? a : -a; }


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

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

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

LLVM IR (-O2):
define i32 @int_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void g(int (*compar)()) {}


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

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

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

LLVM IR (-O2):
define void @g(i32 (...)* nocapture %0) {
ret void
}
int param__is_list_closing_char(char c) { return (c == ']'); }


x86 assembly (clang, -O0):
<param__is_list_closing_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<param__is_list_closing_char>:
xor    %eax,%eax
cmp    $0x5d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @param__is_list_closing_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 93
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @param__is_list_closing_char(i8 signext %0) {
%2 = icmp eq i8 %0, 93
%3 = zext i1 %2 to i32
ret i32 %3
}
int ilogn(int n) {
  int r = 0;
  while (n) {
    n >>= 1;
    ++r;
  }
  return r;
}


x86 assembly (clang, -O0):
<ilogn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <ilogn+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ilogn+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilogn>:
xor    %eax,%eax
test   %edi,%edi
je     111c <ilogn+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ilogn+0x10>
ret

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

LLVM IR (-O2):
define i32 @ilogn(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int jhash_1word(int /*<<< orphan*/, int);
int ppi_hash_pid(pid_t pid) {
  return jhash_1word(pid, (0x3af5f2ee)) & ((1 << (8)) - 1);
}


x86 assembly (clang, -O0):
<ppi_hash_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3af5f2ee,%esi
call   1030 <jhash_1word@plt>
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppi_hash_pid>:
push   %rax
mov    $0x3af5f2ee,%esi
call   1030 <jhash_1word@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ppi_hash_pid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @jhash_1word(i32 %3, i32 989197038)
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @ppi_hash_pid(i32 %0) {
%2 = tail call i32 @jhash_1word(i32 %0, i32 989197038)
%3 = and i32 %2, 255
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xvisibility_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xvisibility.window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xvisibility_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cdflib_beta_log(double *, double *);
double exp(int /*<<< orphan*/);
double cdflib_beta(double a, double b) {
  return (exp(cdflib_beta_log(&a, &b)));
}


x86 assembly (clang, -O0):
<cdflib_beta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <cdflib_beta_log@plt>
mov    %eax,%edi
call   1040 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_beta>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <cdflib_beta_log@plt>
mov    %eax,%edi
call   1040 <exp@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @cdflib_beta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @cdflib_beta_log(double* %3, double* %4)
%6 = call double @exp(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @cdflib_beta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @cdflib_beta_log(double* %3, double* %4)
%6 = call double @exp(i32 %5)
ret double %6
}
short min(short a, short b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    112e <min+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <min+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @min(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @min(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
int movegt(int x, int y, long long a) {
  int i;
  int ret = 0;
  for (i = 0; i < y; i++) {
    if (a >= (long long)0xf000000000000000LL)
      ret = x;
    else
      ret = y;
  }
  return ret;
}


x86 assembly (clang, -O0):
<movegt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1160 <movegt+0x60>
movabs $0xf000000000000000,%rax
cmp    %rax,-0x10(%rbp)
jl     1147 <movegt+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <movegt+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1152 <movegt+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <movegt+0x1c>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movegt>:
movabs $0xefffffffffffffff,%rax
ff ff ef
cmp    %rax,%rdx
cmovle %esi,%edi
xor    %eax,%eax
test   %esi,%esi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @movegt(i32 %0, i32 %1, i64 %2) {
%4 = icmp sgt i32 %1, 0
%5 = icmp sgt i64 %2, -1152921504606846977
%6 = select i1 %5, i32 %0, i32 %1
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
int fun824() { return 824; }


x86 assembly (clang, -O0):
<fun824>:
push   %rbp
mov    %rsp,%rbp
mov    $0x338,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun824() {
ret i32 824
}

LLVM IR (-O2):
define i32 @fun824() {
ret i32 824
}
void cb_cut(struct Screen *scrn) {}


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

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

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

LLVM IR (-O2):
%struct.Screen = type opaque
define void @cb_cut(%struct.Screen* nocapture %0) {
ret void
}
/* Variables and functions */
int get_mdterm();
void md_draw_line_red(int x1, int y1, int x2, int y2, int width) {
  switch (get_mdterm()) {}
}


x86 assembly (clang, -O0):
<md_draw_line_red>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
call   1030 <get_mdterm@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @md_draw_line_red(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @get_mdterm()
switch i32 %11, label %12 [
]
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @md_draw_line_red(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @get_mdterm()
ret void
}