xunge/DecIR huggingface dataset:
int doubleAdd(int x, int y) { return 7 * (x + y); }


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

x86 assembly (clang, -O2):
<doubleAdd>:
add    %esi,%edi
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @doubleAdd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = mul nsw i32 %3, 7
ret i32 %4
}
/* Variables and functions */
int interrupt(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
              int /*<<< orphan*/);
int readKey() { return interrupt(0x16, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<readKey>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <interrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<readKey>:
mov    $0x16,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <interrupt@plt>

LLVM IR (-O0):
define i32 @readKey() {
%1 = call i32 @interrupt(i32 22, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @readKey() {
%1 = tail call i32 @interrupt(i32 22, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: fsaconcat [-ip d/s[dr]] [-op d/s] [-silent] [-v]\n");
  fprintf(stderr, "       filename1 filename2 outfilename\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: fsaconcat [-ip d/s[dr]] [-op d/s] [-silent] [-v]\0A\00"
@.str.1 = [40 x i8] c" filename1 filename2 outfilename\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: fsaconcat [-ip d/s[dr]] [-op d/s] [-silent] [-v]\0A\00"
@.str.1 = [40 x i8] c" filename1 filename2 outfilename\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ps(const int loglevel, const int verbosity, const int n) {
  int i;
  if (verbosity >= loglevel) {
    for (i = 0; i < n; i++) {
      printf("  ");
    }
  }
}


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     115f <ps+0x4f>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <ps+0x4a>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <ps+0x24>
jmp    115f <ps+0x4f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
push   %r14
push   %rbx
push   %rax
cmp    %edi,%esi
jl     113d <ps+0x2d>
mov    %edx,%ebx
test   %edx,%edx
jle    113d <ps+0x2d>
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <ps+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @ps(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %1, %0
%5 = icmp sgt i32 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %7
12: ; preds = %7, %3
ret void
}
int RECOIL_GetMigMode(int reg0, int reg1, int reg19, int length) {
  return (reg0 & 14) | (reg1 & 24) << 1 | (reg19 & 24) << 3 | length << 8;
}


x86 assembly (clang, -O0):
<RECOIL_GetMigMode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe,%eax
mov    -0x8(%rbp),%ecx
and    $0x18,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0x18,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RECOIL_GetMigMode>:
and    $0xe,%edi
and    $0x18,%esi
lea    (%rdi,%rsi,2),%eax
and    $0x18,%edx
lea    (%rax,%rdx,8),%eax
shl    $0x8,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @RECOIL_GetMigMode(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = and i32 %9, 14
%11 = load i32, i32* %6
%12 = and i32 %11, 24
%13 = shl i32 %12, 1
%14 = or i32 %10, %13
%15 = load i32, i32* %7
%16 = and i32 %15, 24
%17 = shl i32 %16, 3
%18 = or i32 %14, %17
%19 = load i32, i32* %8
%20 = shl i32 %19, 8
%21 = or i32 %18, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @RECOIL_GetMigMode(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %0, 14
%6 = shl i32 %1, 1
%7 = and i32 %6, 48
%8 = or i32 %7, %5
%9 = shl i32 %2, 3
%10 = and i32 %9, 192
%11 = or i32 %8, %10
%12 = shl i32 %3, 8
%13 = or i32 %11, %12
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int nvme_pcicfg_unmap_bar(void *devhandle, uint32_t bar, void *addr) {
  return 0;
}


x86 assembly (clang, -O0):
<nvme_pcicfg_unmap_bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nvme_pcicfg_unmap_bar(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @nvme_pcicfg_unmap_bar(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
void *realloc(void *, int);
void *PRRealloc(void *ptr, int size) {
  ;
  return realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<PRRealloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @PRRealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @realloc(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @PRRealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
ret i8* %3
}
void _Jv_MonitorExit() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_MonitorExit() {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int __socketcall(int, unsigned long *);
int getsockname(int sockfd, struct sockaddr *addr, socklen_t *paddrlen) {
  unsigned long args[3];
  args[0] = sockfd;
  args[1] = (unsigned long)addr;
  args[2] = (unsigned long)paddrlen;
  return __socketcall(6, args);
}


x86 assembly (clang, -O0):
<getsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x6,%edi
call   1030 <__socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockname>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
call   1030 <__socketcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca [3 x i64]
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
store i64 %9, i64* %10
%11 = load %struct.sockaddr*, %struct.sockaddr** %5
%12 = ptrtoint %struct.sockaddr* %11 to i64
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 1
store i64 %12, i64* %13
%14 = load i32*, i32** %6
%15 = ptrtoint i32* %14 to i64
%16 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 2
store i64 %15, i64* %16
%17 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%18 = call i32 @__socketcall(i32 6, i64* %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca [3 x i64]
%5 = bitcast [3 x i64]* %4 to i8*
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
store i64 %6, i64* %7
%8 = ptrtoint %struct.sockaddr* %1 to i64
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
store i64 %8, i64* %9
%10 = ptrtoint i32* %2 to i64
%11 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
store i64 %10, i64* %11
%12 = call i32 @__socketcall(i32 6, i64* %7)
ret i32 %12
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRDF_set(void) { return U_WMRCORENONE_set("U_WMRDF"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDF\00"
define i8* @U_WMRDF_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t cread_u8(const void *const ptr) { return *(uint8_t *)ptr; }


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

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

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

LLVM IR (-O2):
define i32 @cread_u8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void virtual_mcu_GlobalInterrupts_disable__E() {}


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

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

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

LLVM IR (-O2):
define void @virtual_mcu_GlobalInterrupts_disable__E() {
ret void
}
int lsquigle(char c) { return c == '{'; }


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

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

LLVM IR (-O0):
define i32 @lsquigle(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, 123
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @lsquigle(i8 signext %0) {
%2 = icmp eq i8 %0, 123
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ts_encode_pts_dts(int *, int, int /*<<< orphan*/);
int ts_packet_get_payload_offset(int *);
void ts_packet_change_pts(uint8_t *ts_packet, uint64_t pts) {
  uint8_t payload_offset = ts_packet_get_payload_offset(ts_packet);
  if (!payload_offset)
    return;
  uint8_t *data = ts_packet + payload_offset;
  ts_encode_pts_dts(&data[9], 2, pts);
}


x86 assembly (clang, -O0):
<ts_packet_change_pts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ts_packet_get_payload_offset@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    114a <ts_packet_change_pts+0x2a>
jmp    1172 <ts_packet_change_pts+0x52>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x24,%rdi
mov    -0xc(%rbp),%edx
mov    $0x2,%esi
call   1040 <ts_encode_pts_dts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_packet_change_pts>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <ts_packet_get_payload_offset@plt>
test   %eax,%eax
je     114d <ts_packet_change_pts+0x2d>
cltq
lea    (%rbx,%rax,4),%rdi
add    $0x24,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ts_encode_pts_dts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ts_packet_change_pts(i32* %0, i32 %1) {
%3 = tail call i32 @ts_packet_get_payload_offset(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = getelementptr inbounds i32, i32* %7, i64 9
%9 = tail call i32 @ts_encode_pts_dts(i32* %8, i32 2, i32 %1)
br label %10
10: ; preds = %2, %5
ret void
}
int push_paren(char cur_char) {
  extern int paren_stack_top;
  extern char paren_stack[];
  if (paren_stack_top >= 200) {
    return 0;
  } else {
    paren_stack[paren_stack_top++] = cur_char;
    return 1;
  }
}


x86 assembly (clang, -O0):
<push_paren>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0x2ec7(%rip),%rax
cmpl   $0xc8,(%rax)
jl     1129 <push_paren+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1157 <push_paren+0x57>
mov    -0x5(%rbp),%dl
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,%esi
add    $0x1,%esi
mov    0x2e97(%rip),%rcx
mov    %esi,(%rcx)
movslq %eax,%rcx
mov    0x2ea3(%rip),%rax
mov    %dl,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_paren>:
mov    0x2ed1(%rip),%rdx
movslq (%rdx),%rcx
xor    %eax,%eax
cmp    $0xc7,%rcx
jg     112a <push_paren+0x2a>
lea    0x1(%rcx),%eax
mov    %eax,(%rdx)
mov    0x2ecf(%rip),%rax
mov    %dil,(%rax,%rcx,1)
mov    $0x1,%eax
ret

LLVM IR (-O0):
@paren_stack_top = external global i32
@paren_stack = external global [0 x i8]
define i32 @push_paren(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i32, i32* @paren_stack_top
%5 = icmp sge i32 %4, 200
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = load i32, i32* @paren_stack_top
%10 = add nsw i32 %9, 1
store i32 %10, i32* @paren_stack_top
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds [0 x i8], [0 x i8]* @paren_stack, i64 0, i64 %11
store i8 %8, i8* %12
store i32 1, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@paren_stack_top = external global i32
@paren_stack = external global [0 x i8]
define i32 @push_paren(i8 signext %0) {
%2 = load i32, i32* @paren_stack_top
%3 = icmp sgt i32 %2, 199
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = add nsw i32 %2, 1
store i32 %5, i32* @paren_stack_top
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds [0 x i8], [0 x i8]* @paren_stack, i64 0, i64 %6
store i8 %0, i8* %7
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int GET32(int);
int wait_i2c_done() {
  int timeout = 2000000;
  while ((!(GET32((0x20804000 + 0x04)) & (1 << 1))) && --timeout) {
  }
  if (timeout == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<wait_i2c_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1e8480,-0x8(%rbp)
mov    $0x20804004,%edi
call   1030 <GET32@plt>
mov    %eax,%ecx
and    $0x2,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    114e <wait_i2c_done+0x3e>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115e <wait_i2c_done+0x4e>
jmp    1163 <wait_i2c_done+0x53>
jmp    111f <wait_i2c_done+0xf>
cmpl   $0x0,-0x8(%rbp)
jne    1179 <wait_i2c_done+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1180 <wait_i2c_done+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_i2c_done>:
push   %rbx
mov    $0xffe17b80,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x20804004,%edi
call   1030 <GET32@plt>
test   $0x2,%al
jne    1134 <wait_i2c_done+0x24>
inc    %ebx
jne    1120 <wait_i2c_done+0x10>
jmp    113c <wait_i2c_done+0x2c>
xor    %eax,%eax
test   %ebx,%ebx
je     113c <wait_i2c_done+0x2c>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wait_i2c_done() {
%1 = alloca i32
%2 = alloca i32
store i32 2000000, i32* %2
br label %3
3: ; preds = %13, %0
%4 = call i32 @GET32(i32 545275908)
%5 = and i32 %4, 2
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ false, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %3
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %1
br label %19
18: ; preds = %14
store i32 0, i32* %1
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @wait_i2c_done() {
br label %1
1: ; preds = %6, %0
%2 = phi i32 [ 2000000, %0 ], [ %7, %6 ]
%3 = tail call i32 @GET32(i32 545275908)
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = add nsw i32 %2, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %1
9: ; preds = %1
%10 = icmp eq i32 %2, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %9
br label %12
12: ; preds = %9, %11
%13 = phi i32 [ 1, %11 ], [ 0, %9 ]
ret i32 %13
}
/* Variables and functions */
char *headN(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[] = "Hola mundo";
  char *head;
  head = headN(s, 2);
  printf("%s\n", head);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xb(%rbp),%rdi
mov    $0x2,%esi
call   1030 <headN@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6e756d20616c6f48,%rax
6d 75 6e
mov    %rax,0x8(%rsp)
movl   $0x6f646e,0xf(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1030 <headN@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.s = [11 x i8] c"Hola mundo\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i8* @headN(i8* %2, i32 2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void HSMMCSDIntrStatusDisable(unsigned int baseAddr, unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x234)))) &= ~flag;
}


x86 assembly (clang, -O0):
<HSMMCSDIntrStatusDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x234,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDIntrStatusDisable>:
not    %esi
add    $0x234,%edi
and    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @HSMMCSDIntrStatusDisable(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 = xor i32 %5, -1
%7 = load i32, i32* %3
%8 = add i32 %7, 564
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, %6
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @HSMMCSDIntrStatusDisable(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = add i32 %0, 564
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, %3
store volatile i32 %8, i32* %6
ret void
}
/* Variables and functions */
scalar_t__ INLINE_SYSCALL_CALL(void *(*)(int, void const *, int), int,
                               void const *, int);
void *shmat(int shmid, const void *shmaddr, int shmflg) {
  return (void *)INLINE_SYSCALL_CALL(shmat, shmid, shmaddr, shmflg);
}


x86 assembly (clang, -O0):
<shmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    0x2ebd(%rip),%rdi
call   1030 <INLINE_SYSCALL_CALL@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmat>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ed2(%rip),%rdi
jmp    1030 <INLINE_SYSCALL_CALL@plt>

LLVM IR (-O0):
define i8* @shmat(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 i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i64 @INLINE_SYSCALL_CALL(i8* (i32, i8*, i32)* @shmat, i32 %7, i8* %8, i32 %9)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @shmat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @INLINE_SYSCALL_CALL(i8* (i32, i8*, i32)* @shmat, i32 %0, i8* %1, i32 %2)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void foo630() {}


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

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

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

LLVM IR (-O2):
define void @foo630() {
ret void
}
void swapInts(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


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

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

LLVM IR (-O0):
define void @swapInts(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swapInts(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putstr_fd(const char *str, int fd) {
  if (!str)
    return;
  write(fd, str, ft_strlen(str));
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113f <ft_putstr_fd+0x1f>
jmp    1164 <ft_putstr_fd+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
test   %rdi,%rdi
je     1144 <ft_putstr_fd+0x24>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @ft_strlen(i8* %0)
%6 = tail call i32 @write(i32 %1, i8* %0, i32 %5)
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
unsigned int strlen(char const *);
int sevenzipped_filename_p(const char *name) {
  unsigned len = strlen(name);
  return (sizeof("") > 1) && (len > sizeof("") - 1) &&
         (strcmp(name + len - (sizeof("") - 1), "") == 0);
}


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

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

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

LLVM IR (-O2):
define i32 @sevenzipped_filename_p(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 0
}
void encode_artnet_uint16_hilo(unsigned short n, unsigned char *data) {
  data[0] = (n >> 8) & 0xFF;
  data[1] = n & 0xFF;
}


x86 assembly (clang, -O0):
<encode_artnet_uint16_hilo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_artnet_uint16_hilo>:
rol    $0x8,%di
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @encode_artnet_uint16_hilo(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @encode_artnet_uint16_hilo(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %1
%5 = trunc i16 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ sqrti(int);
int32_t isqrt(int32_t val) { return sqrti((uint64_t)val << 12); }


x86 assembly (clang, -O0):
<isqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
shl    $0xc,%edi
call   1030 <sqrti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isqrt>:
shl    $0xc,%edi
jmp    1030 <sqrti@plt>

LLVM IR (-O0):
define i64 @isqrt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 12
%6 = call i64 @sqrti(i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @isqrt(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 12
%4 = tail call i64 @sqrti(i32 %3)
ret i64 %4
}
void lseek64() {}


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

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

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

LLVM IR (-O2):
define void @lseek64() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vprintf(char const *, int /*<<< orphan*/);
int debug_vprintf(const char *format, va_list args) {
  return vprintf(format, args);
}


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

x86 assembly (clang, -O2):
<debug_vprintf>:
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define i32 @debug_vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @vprintf(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @debug_vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _cpuid(int /*<<< orphan*/ *);
extern void cpuid(uint32_t registers[4], uint32_t function_id) {
  registers[0] = function_id;
  _cpuid(registers);
}


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

x86 assembly (clang, -O2):
<cpuid>:
mov    %esi,(%rdi)
jmp    1030 <_cpuid@plt>

LLVM IR (-O0):
define void @cpuid(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 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
%8 = load i32*, i32** %3
%9 = call i32 @_cpuid(i32* %8)
ret void
}

LLVM IR (-O2):
define void @cpuid(i32* %0, i32 %1) {
store i32 %1, i32* %0
%3 = tail call i32 @_cpuid(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DeleteAreaData(void *areaattr) { free(areaattr); }


x86 assembly (clang, -O0):
<DeleteAreaData>:
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):
<DeleteAreaData>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DeleteAreaData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ logLidar(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  if (argc == 2) {
  } else if (argc != 2) {
    usage("Invalid arguments");
  }
  logLidar(argv[1]);
  exit(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   $0x2,-0x8(%rbp)
jne    1155 <main+0x25>
jmp    1170 <main+0x40>
cmpl   $0x2,-0x8(%rbp)
je     116b <main+0x3b>
lea    0xe9a(%rip),%rdi
call   1040 <usage@plt>
jmp    1170 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <logLidar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1145 <main+0x15>
lea    0xec0(%rip),%rdi
call   1040 <usage@plt>
mov    0x8(%rbx),%rdi
call   1030 <logLidar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Invalid arguments\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 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @usage(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
br label %15
15: ; preds = %14, %8
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @logLidar(i8* %18)
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Invalid arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @usage(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @logLidar(i8* %8)
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void hexprint(unsigned char *b, int len) {
  int i;
  for (i = 0; i < len; i++)
    printf(" %02X", b[i]);
}


x86 assembly (clang, -O0):
<hexprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <hexprint+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <hexprint+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <hexprint+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <hexprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c" %02X\00"
define void @hexprint(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  freopen("dictionary.in", "r", stdin);
  freopen("dictionary.out", "w+", stdout);
  printf("3");
  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)
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0xeba(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
lea    0xeae(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <freopen@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
lea    0xec3(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <freopen@plt>
mov    $0x33,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"dictionary.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [15 x i8] c"dictionary.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
@.str.4 = [2 x i8] c"3\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 = load i32, i32* @stdin
%7 = call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @freopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"dictionary.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [15 x i8] c"dictionary.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = tail call i32 @putchar(i32 51)
ret i32 0
}
void lex_placeholder(void) {}


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

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

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

LLVM IR (-O2):
define void @lex_placeholder() {
ret void
}
int fib() {
  int a = 1, b = 2, cntr;
  for (cntr = 0; cntr < 20000; cntr++) {
    int c = a + b;
    a = b;
    b = c;
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4e20,-0x10(%rbp)
jge    1149 <fib+0x49>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <fib+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fib() {
ret i32 undef
}
/* Type definitions */
struct log {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct log *);
int /*<<< orphan*/ log_destroy(struct log *);
void log_delete(struct log *__restrict l) {
  log_destroy(l);
  free(l);
}


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

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

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

LLVM IR (-O2):
%struct.log = type { i32 }
define void @log_delete(%struct.log* noalias %0) {
%2 = tail call i32 @log_destroy(%struct.log* %0)
%3 = tail call i32 @free(%struct.log* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_sched_setaffinity;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, size_t,
            int /*<<< orphan*/ *);
int sched_setaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask) {
  return syscall(__NR_sched_setaffinity, pid, cpusetsize, mask);
}


x86 assembly (clang, -O0):
<sched_setaffinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_setaffinity>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_sched_setaffinity = global i32 0
define i32 @sched_setaffinity(i32 %0, i64 %1, i32* %2) {
%4 = load i32, i32* @__NR_sched_setaffinity
%5 = tail call i32 @syscall(i32 %4, i32 %0, i64 %1, i32* %2)
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void set_XMotionEvent_y(void *_p, int _v) { ((XMotionEvent *)_p)->y = (int)_v; }


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

x86 assembly (clang, -O2):
<set_XMotionEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XMotionEvent_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %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 i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XMotionEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}