xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getbyte();
void copy_in(unsigned char *adr, int len) {
  while (len--) {
    *adr++ = getbyte();
  }
}


x86 assembly (clang, -O0):
<copy_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1152 <copy_in+0x42>
mov    $0x0,%al
call   1030 <getbyte@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111f <copy_in+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @copy_in(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = tail call i32 (...) @getbyte()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
bool nrf52_errata_42(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_42() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_42() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short angle2;
};
typedef TYPE_1__ XArc;

/* Variables and functions */
void set_XArc_angle2(void *_p, short _v) { ((XArc *)_p)->angle2 = (short)_v; }


x86 assembly (clang, -O0):
<set_XArc_angle2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XArc_angle2>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XArc_angle2(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t coap_opt_put_string(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                           char const *, char);
size_t coap_opt_put_uri_path(uint8_t *buf, uint16_t lastonum, const char *uri) {
  return coap_opt_put_string(buf, lastonum, (11), uri, '/');
}


x86 assembly (clang, -O0):
<coap_opt_put_uri_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0xb,%edx
mov    $0x2f,%r8d
call   1030 <coap_opt_put_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_opt_put_uri_path>:
mov    %rdx,%rcx
mov    $0xb,%edx
mov    $0x2f,%r8d
jmp    1030 <coap_opt_put_string@plt>

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

LLVM IR (-O2):
define i64 @coap_opt_put_uri_path(i32* %0, i32 %1, i8* %2) {
%4 = tail call i64 @coap_opt_put_string(i32* %0, i32 %1, i32 11, i8* %2, i8 signext 47)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ Elf64_Off;
typedef int /*<<< orphan*/ Elf64_Addr;

/* Variables and functions */
int elfrw_write_Addr(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int elfrw_write_Off(FILE *fp, Elf64_Off const *out) {
  return elfrw_write_Addr(fp, (Elf64_Addr const *)out);
}


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

x86 assembly (clang, -O2):
<elfrw_write_Off>:
jmp    1030 <elfrw_write_Addr@plt>

LLVM IR (-O0):
define i32 @elfrw_write_Off(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 = call i32 @elfrw_write_Addr(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @elfrw_write_Off(i32* %0, i32* %1) {
%3 = tail call i32 @elfrw_write_Addr(i32* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ xcb_atom_t;

/* Variables and functions */
int /*<<< orphan*/ XCB_ATOM_WM_SIZE_HINTS;
int /*<<< orphan*/ xcb_get_property(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, long, int);
xcb_get_property_cookie_t xcb_icccm_get_wm_size_hints(xcb_connection_t *c,
                                                      xcb_window_t window,
                                                      xcb_atom_t property) {
  return xcb_get_property(c, 0, window, property, XCB_ATOM_WM_SIZE_HINTS, 0L,
                          18);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_size_hints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2eb5(%rip),%rax
mov    (%rax),%r8d
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r9d
movl   $0x12,(%rsp)
call   1030 <xcb_get_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_size_hints>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2ecc(%rip),%rax
mov    (%rax),%r8d
movl   $0x12,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_WM_SIZE_HINTS = global i32 0
define i32 @xcb_icccm_get_wm_size_hints(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @XCB_ATOM_WM_SIZE_HINTS
%11 = call i32 @xcb_get_property(i32* %7, i32 0, i32 %8, i32 %9, i32 %10, i64 0, i32 18)
ret i32 %11
}

LLVM IR (-O2):
@XCB_ATOM_WM_SIZE_HINTS = global i32 0
define i32 @xcb_icccm_get_wm_size_hints(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @XCB_ATOM_WM_SIZE_HINTS
%5 = tail call i32 @xcb_get_property(i32* %0, i32 0, i32 %1, i32 %2, i32 %4, i64 0, i32 18)
ret i32 %5
}
void RTFileReadAll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileReadAll() {
ret void
}
void i2sStartRecord(void) {
  *((volatile unsigned int *)((0xB0009000 + 0x20))) = 0x1;
  *((volatile unsigned int *)((0xB0009000 + 0x04))) =
      (*((volatile unsigned int *)((0xB0009000 + 0x04)))) | (1 << 6);
}


x86 assembly (clang, -O0):
<i2sStartRecord>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0009020,%eax
movl   $0x1,(%rax)
mov    $0xb0009004,%eax
mov    (%rax),%ecx
or     $0x40,%ecx
mov    $0xb0009004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2sStartRecord>:
mov    $0xb0009004,%eax
movl   $0x1,0x1c(%rax)
orl    $0x40,(%rax)
ret

LLVM IR (-O0):
define void @i2sStartRecord() {
store volatile i32 1, i32* inttoptr (i64 2952826912 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 2952826884 to i32*)
%2 = or i32 %1, 64
store volatile i32 %2, i32* inttoptr (i64 2952826884 to i32*)
ret void
}

LLVM IR (-O2):
define void @i2sStartRecord() {
store volatile i32 1, i32* inttoptr (i64 2952826912 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 2952826884 to i32*)
%2 = or i32 %1, 64
store volatile i32 %2, i32* inttoptr (i64 2952826884 to i32*)
ret void
}
void log_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @log_shutdown() {
ret void
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clad_sb_alloc();
struct clad_sb *clad_sb_init_sb(int /*<<< orphan*/, struct clad_sb *);
struct clad_sb *clad_sb_dup(struct clad_sb *other) {
  return clad_sb_init_sb(clad_sb_alloc(), other);
}


x86 assembly (clang, -O0):
<clad_sb_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clad_sb_alloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <clad_sb_init_sb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_sb_dup>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clad_sb_alloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <clad_sb_init_sb@plt>

LLVM IR (-O0):
%struct.clad_sb = type { i32 }
define %struct.clad_sb* @clad_sb_dup(%struct.clad_sb* %0) {
%2 = alloca %struct.clad_sb*
store %struct.clad_sb* %0, %struct.clad_sb** %2
%3 = call i32 (...) @clad_sb_alloc()
%4 = load %struct.clad_sb*, %struct.clad_sb** %2
%5 = call %struct.clad_sb* @clad_sb_init_sb(i32 %3, %struct.clad_sb* %4)
ret %struct.clad_sb* %5
}

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define %struct.clad_sb* @clad_sb_dup(%struct.clad_sb* %0) {
%2 = tail call i32 (...) @clad_sb_alloc()
%3 = tail call %struct.clad_sb* @clad_sb_init_sb(i32 %2, %struct.clad_sb* %0)
ret %struct.clad_sb* %3
}
void mixedDoubles(int a, double d1) {}


x86 assembly (clang, -O0):
<mixedDoubles>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mixedDoubles(i32 %0, double %1) {
ret void
}
void halt() {
  asm("cli \n\t"
      "hlt \n\t");
}


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

x86 assembly (clang, -O2):
<halt>:
cli
hlt
ret

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "cli \0A\09hlt \0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ calculate_meta_size(unsigned long long);
scalar_t__ calculate_ref_size(unsigned long long);
scalar_t__ calculate_stream_data_size(unsigned long long);
unsigned long long calculate_required_space(unsigned long long total_msgs) {
  unsigned long long space_required = 0;
  space_required += calculate_stream_data_size(total_msgs);
  space_required += calculate_meta_size(total_msgs);
  space_required += calculate_ref_size(total_msgs);
  return space_required;
}


x86 assembly (clang, -O0):
<calculate_required_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <calculate_stream_data_size@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calculate_meta_size@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <calculate_ref_size@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_required_space>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <calculate_stream_data_size@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <calculate_meta_size@plt>
mov    %rax,%rbx
add    %r14,%rbx
mov    %r15,%rdi
call   1050 <calculate_ref_size@plt>
add    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @calculate_required_space(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = call i64 @calculate_stream_data_size(i64 %4)
%6 = load i64, i64* %3
%7 = add i64 %6, %5
store i64 %7, i64* %3
%8 = load i64, i64* %2
%9 = call i64 @calculate_meta_size(i64 %8)
%10 = load i64, i64* %3
%11 = add i64 %10, %9
store i64 %11, i64* %3
%12 = load i64, i64* %2
%13 = call i64 @calculate_ref_size(i64 %12)
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @calculate_required_space(i64 %0) {
%2 = tail call i64 @calculate_stream_data_size(i64 %0)
%3 = tail call i64 @calculate_meta_size(i64 %0)
%4 = add i64 %3, %2
%5 = tail call i64 @calculate_ref_size(i64 %0)
%6 = add i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main(int argc, char *argv[]) {
  if (argc > 1)
    test(argv[1]);
  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)
cmpl   $0x1,-0x8(%rbp)
jle    113d <main+0x2d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1123 <main+0x13>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <test@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @test(i8* %11)
br label %13
13: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @test(i8* %6)
br label %8
8: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int f160(int *);
int f161(int *p) { return f160(p); }


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

x86 assembly (clang, -O2):
<f161>:
jmp    1030 <f160@plt>

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

LLVM IR (-O2):
define i32 @f161(i32* %0) {
%2 = tail call i32 @f160(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ReopenALog();
int /*<<< orphan*/ ReopenMLog();
void StartLog2(int PrintLog) {
  ReopenALog();
  ReopenMLog();
}


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

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

LLVM IR (-O0):
define void @StartLog2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ReopenALog()
%4 = call i32 (...) @ReopenMLog()
ret void
}

LLVM IR (-O2):
define void @StartLog2(i32 %0) {
%2 = tail call i32 (...) @ReopenALog()
%3 = tail call i32 (...) @ReopenMLog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pair_p_stuff() {
  printf("Placeholder for another strange file in subdirectory\n");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"Placeholder for another strange file in subdirectory\0A\00"
define void @pair_p_stuff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"Placeholder for another strange file in subdirectory\00"
define void @pair_p_stuff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret void
}
void glUniform1uiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform1uiv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *tree_zmalloc(size_t, void *);
char *tree_zstrdup(const char *str, void *parent) {
  size_t size;
  char *copy = NULL;
  size = strlen(str) + 1;
  if ((copy = tree_zmalloc(size, parent)) == NULL) {
    return NULL;
  }
  memcpy(copy, str, size);
  return copy;
}


x86 assembly (clang, -O0):
<tree_zstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <tree_zmalloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1182 <tree_zstrdup+0x52>
movq   $0x0,-0x8(%rbp)
jmp    119b <tree_zstrdup+0x6b>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_zstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <tree_zmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1167 <tree_zstrdup+0x37>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @tree_zstrdup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* null, i8** %7
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i8*, i8** %5
%14 = call i8* @tree_zmalloc(i64 %12, i8* %13)
store i8* %14, i8** %7
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %2
store i8* null, i8** %3
br label %23
17: ; preds = %2
%18 = load i8*, i8** %7
%19 = load i8*, i8** %4
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %7
store i8* %22, i8** %3
br label %23
23: ; preds = %17, %16
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @tree_zstrdup(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = tail call i8* @tree_zmalloc(i64 %5, i8* %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %5)
br label %10
10: ; preds = %2, %8
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ Add(int, int);
int main() { Add(5, 10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0xa,%esi
call   1030 <Add@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0xa,%esi
call   1030 <Add@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @Add(i32 5, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Add(i32 5, i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
extern int _swift_Glibc_open(const char *path, int oflag, mode_t mode) {
  return open(path, oflag, mode);
}


x86 assembly (clang, -O0):
<_swift_Glibc_open>:
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    -0x10(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swift_Glibc_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @_swift_Glibc_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void foo301() {}


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

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

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

LLVM IR (-O2):
define void @foo301() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DATA_widg();
int /*<<< orphan*/ LibraryHeader(char *, char *);
int /*<<< orphan*/ STARTUP_widg();
LIBRARY_widg() {
  LibraryHeader("widg", "Sat Feb  1 10:41:37 2014 ");
  DATA_widg();
  STARTUP_widg();
}


x86 assembly (clang, -O0):
<LIBRARY_widg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <LibraryHeader@plt>
mov    $0x0,%al
call   1050 <DATA_widg@plt>
mov    $0x0,%al
call   1040 <STARTUP_widg@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBRARY_widg>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1030 <LibraryHeader@plt>
xor    %eax,%eax
call   1050 <DATA_widg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <STARTUP_widg@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"widg\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:37 2014 \00"
define i32 @LIBRARY_widg() {
%1 = alloca i32
%2 = call i32 @LibraryHeader(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @DATA_widg()
%4 = call i32 (...) @STARTUP_widg()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [5 x i8] c"widg\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:37 2014 \00"
define i32 @LIBRARY_widg() {
%1 = tail call i32 @LibraryHeader(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @DATA_widg()
%3 = tail call i32 (...) @STARTUP_widg()
ret i32 undef
}
signed char convert_signed_char_to_signed_char(signed char x) { return x; }


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

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

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

LLVM IR (-O2):
define signext i8 @convert_signed_char_to_signed_char(i8 returned signext %0) {
ret i8 %0
}
/* Type definitions */
struct network_status {
  int dummy;
};
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_is_data(struct item *);
struct network_status *network_bind_and_accept(int);
int /*<<< orphan*/ network_disconnect(struct network_status *);
struct item *network_receive(struct network_status *);
struct item *receive() {
  struct network_status *net_stat = network_bind_and_accept(121212);
  struct item *m = network_receive(net_stat);
  check_is_data(m);
  network_disconnect(net_stat);
  return m;
}


x86 assembly (clang, -O0):
<receive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1d97c,%edi
call   1050 <network_bind_and_accept@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <network_receive@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <check_is_data@plt>
mov    -0x8(%rbp),%rdi
call   1060 <network_disconnect@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive>:
push   %r14
push   %rbx
push   %rax
mov    $0x1d97c,%edi
call   1050 <network_bind_and_accept@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <network_receive@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <check_is_data@plt>
mov    %r14,%rdi
call   1060 <network_disconnect@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.item = type { i32 }
%struct.network_status = type { i32 }
define %struct.item* @receive() {
%1 = alloca %struct.network_status*
%2 = alloca %struct.item*
%3 = call %struct.network_status* @network_bind_and_accept(i32 121212)
store %struct.network_status* %3, %struct.network_status** %1
%4 = load %struct.network_status*, %struct.network_status** %1
%5 = call %struct.item* @network_receive(%struct.network_status* %4)
store %struct.item* %5, %struct.item** %2
%6 = load %struct.item*, %struct.item** %2
%7 = call i32 @check_is_data(%struct.item* %6)
%8 = load %struct.network_status*, %struct.network_status** %1
%9 = call i32 @network_disconnect(%struct.network_status* %8)
%10 = load %struct.item*, %struct.item** %2
ret %struct.item* %10
}

LLVM IR (-O2):
%struct.item = type { i32 }
%struct.network_status = type { i32 }
define %struct.item* @receive() {
%1 = tail call %struct.network_status* @network_bind_and_accept(i32 121212)
%2 = tail call %struct.item* @network_receive(%struct.network_status* %1)
%3 = tail call i32 @check_is_data(%struct.item* %2)
%4 = tail call i32 @network_disconnect(%struct.network_status* %1)
ret %struct.item* %2
}
/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int);
void _Exit(int ec) {
  __syscall(252, ec);
  __syscall(1, ec);
}


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xfc,%edi
call   1030 <__syscall@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <__syscall@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rbx
mov    %edi,%ebx
mov    $0xfc,%edi
mov    %ebx,%esi
call   1030 <__syscall@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <__syscall@plt>

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__syscall(i32 252, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @__syscall(i32 1, i32 %5)
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @__syscall(i32 252, i32 %0)
%3 = tail call i32 @__syscall(i32 1, i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void read_gpio(int *value, void *virtual_address, int page_offset) {
  *value = *((unsigned *)(virtual_address + page_offset));
  printf("The value on GPIO input is: %08x\n", *value);
}


x86 assembly (clang, -O0):
<read_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_gpio>:
movslq %edx,%rax
mov    (%rsi,%rax,1),%esi
mov    %esi,(%rdi)
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"The value on GPIO input is: %08x\0A\00"
define void @read_gpio(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr i8, i8* %7, i64 %9
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"The value on GPIO input is: %08x\0A\00"
define void @read_gpio(i32* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr i8, i8* %1, i64 %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imp();
int /*<<< orphan*/ textcolor(int);
ln1() {
  textcolor(8);
  imp();
}


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

x86 assembly (clang, -O2):
<ln1>:
push   %rax
mov    $0x8,%edi
call   1040 <textcolor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <imp@plt>

LLVM IR (-O0):
define i32 @ln1() {
%1 = alloca i32
%2 = call i32 @textcolor(i32 8)
%3 = call i32 (...) @imp()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ln1() {
%1 = tail call i32 @textcolor(i32 8)
%2 = tail call i32 (...) @imp()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ event_mm_free_(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
void evthread_posix_lock_free(void *_lock, unsigned locktype) {
  pthread_mutex_t *lock = _lock;
  pthread_mutex_destroy(lock);
  event_mm_free_(lock);
}


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

x86 assembly (clang, -O2):
<evthread_posix_lock_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pthread_mutex_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <event_mm_free_@plt>

LLVM IR (-O0):
define void @evthread_posix_lock_free(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** %5
%9 = call i32 @pthread_mutex_destroy(i32* %8)
%10 = load i32*, i32** %5
%11 = call i32 @event_mm_free_(i32* %10)
ret void
}

LLVM IR (-O2):
define void @evthread_posix_lock_free(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @pthread_mutex_destroy(i32* %3)
%5 = tail call i32 @event_mm_free_(i32* %3)
ret void
}
int fun896() { return 896; }


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

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

LLVM IR (-O0):
define i32 @fun896() {
ret i32 896
}

LLVM IR (-O2):
define i32 @fun896() {
ret i32 896
}
/* Variables and functions */
int identity(int /*<<< orphan*/);
int main(void) { return identity(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <identity@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @identity(i32 0)
ret i32 %1
}
void crypto_init() {}


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

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

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

LLVM IR (-O2):
define void @crypto_init() {
ret void
}
char *hmac512base64(bitstr, bitcnt, key, keylen)
unsigned char *bitstr;
unsigned long bitcnt;
unsigned char *key;
unsigned int keylen;
{ return ((char *)hmaccomp(512, 3, bitstr, bitcnt, key, keylen)); }


x86 assembly (clang, -O0):
<hmac512base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x200,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <hmaccomp@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac512base64>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x200,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <hmaccomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hmac512base64(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 512, i32 3, i8* %9, i64 %10, i8* %11, i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @hmac512base64(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 512, i32 3, i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
signed int explicit_signed_char_to_signed_int(signed char src) {
  return (signed int)src;
}


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

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

LLVM IR (-O0):
define i32 @explicit_signed_char_to_signed_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @explicit_signed_char_to_signed_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
int atm_header_get_vci(unsigned char *cell) {
  return ((((int)(cell[1] & 0x0f)) << 12) | (((int)cell[2]) << 4) |
          (((int)(cell[3] & 0xf0)) >> 4));
}


x86 assembly (clang, -O0):
<atm_header_get_vci>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0xf,%eax
shl    $0xc,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atm_header_get_vci>:
movzbl 0x1(%rdi),%eax
and    $0xf,%eax
shl    $0xc,%eax
movzbl 0x2(%rdi),%ecx
shl    $0x4,%ecx
or     %eax,%ecx
movzbl 0x3(%rdi),%eax
shr    $0x4,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atm_header_get_vci(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 15
%8 = shl i32 %7, 12
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 4
%14 = or i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 240
%20 = ashr i32 %19, 4
%21 = or i32 %14, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @atm_header_get_vci(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = and i8 %3, 15
%5 = zext i8 %4 to i32
%6 = shl nuw nsw i32 %5, 12
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 4
%11 = or i32 %6, %10
%12 = getelementptr inbounds i8, i8* %0, i64 3
%13 = load i8, i8* %12
%14 = lshr i8 %13, 4
%15 = zext i8 %14 to i32
%16 = or i32 %11, %15
ret i32 %16
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getrusage(int, struct rusage *);
int /*<<< orphan*/ perror(char *);
void gt_xgetrusage(int who, struct rusage *rusage) {
  if (getrusage(who, rusage)) {
    perror("cannot getrusage");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<gt_xgetrusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
cmp    $0x0,%rax
je     116f <gt_xgetrusage+0x3f>
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_xgetrusage>:
push   %rax
call   1030 <getrusage@plt>
test   %rax,%rax
jne    113d <gt_xgetrusage+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
@.str = [17 x i8] c"cannot getrusage\00"
@EXIT_FAILURE = global i32 0
define void @gt_xgetrusage(i32 %0, %struct.rusage* %1) {
%3 = alloca i32
%4 = alloca %struct.rusage*
store i32 %0, i32* %3
store %struct.rusage* %1, %struct.rusage** %4
%5 = load i32, i32* %3
%6 = load %struct.rusage*, %struct.rusage** %4
%7 = call i64 @getrusage(i32 %5, %struct.rusage* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@.str = [17 x i8] c"cannot getrusage\00"
@EXIT_FAILURE = global i32 0
define void @gt_xgetrusage(i32 %0, %struct.rusage* %1) {
%3 = tail call i64 @getrusage(i32 %0, %struct.rusage* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
int mylib_bb() { return 48; }


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

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

LLVM IR (-O0):
define i32 @mylib_bb() {
ret i32 48
}

LLVM IR (-O2):
define i32 @mylib_bb() {
ret i32 48
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b() { printf("I am B\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"I am B\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int __test() {
  int x = 0;
  x += sizeof("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bcforres/ccc/refs/heads/master/test/"
              "tests/cpp/directive_line_test.c");
  x += 556;
  x += 557;
  x += sizeof("foo.c");
  x += 1338;
  x += 1339;
  return x;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x9e,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x22c,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x22d,%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x6,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x53a,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x53b,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = sext i32 %2 to i64
%4 = add i64 %3, 158
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 556
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 557
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = add i64 %11, 6
%13 = trunc i64 %12 to i32
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1338
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1339
store i32 %17, i32* %1
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 3954
}
int _mpyhuls(unsigned int src1, int src2) {
  return (unsigned short)(src1 >> 16) * (signed short)(src2);
}


x86 assembly (clang, -O0):
<_mpyhuls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyhuls>:
shr    $0x10,%edi
movswl %si,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @_mpyhuls(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 = lshr i32 %5, 16
%7 = trunc i32 %6 to i16
%8 = zext i16 %7 to i32
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = sext i16 %10 to i32
%12 = mul nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mpyhuls(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = shl i32 %1, 16
%5 = ashr exact i32 %4, 16
%6 = mul nsw i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct catmc_atomic_short {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_short *);
void catmc_atomic_short_destroy(struct catmc_atomic_short *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_short_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.catmc_atomic_short = type { i32 }
define void @catmc_atomic_short_destroy(%struct.catmc_atomic_short* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_short* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void job(void *jobstr) {
  long i, x;
  for (i = 0; i < 100000000; i++) {
    x = x + i;
  }
  printf("%s\n", (char *)jobstr);
}


x86 assembly (clang, -O0):
<job>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x5f5e100,-0x10(%rbp)
05
jge    114f <job+0x3f>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <job+0x14>
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @job(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %5
5: ; preds = %12, %1
%6 = load i64, i64* %3
%7 = icmp slt i64 %6, 100000000
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = add nsw i64 %9, %10
store i64 %11, i64* %4
br label %12
12: ; preds = %8
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %5
15: ; preds = %5
%16 = load i8*, i8** %2
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @job(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

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

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


x86 assembly (clang, -O0):
<get_XCirculateEvent_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_XCirculateEvent_serial>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XCirculateEvent_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_XCirculateEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) int32_t __checkint_is_mixed_sign32(int32_t x,
                                                            int32_t y) {
  return ((x ^ y) < 0);
}


x86 assembly (clang, -O0):
<__checkint_is_mixed_sign32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__checkint_is_mixed_sign32>:
mov    %edi,%eax
xor    %esi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @__checkint_is_mixed_sign32(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 = xor i32 %5, %6
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__checkint_is_mixed_sign32(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = lshr i32 %3, 31
ret i32 %4
}