xunge/DecIR huggingface dataset:
int get_dicenum(int *digits) {
  int i = 0;
  int pos = 0;
  for (i = 0; i < 5; i++)
    pos += digits[i];
  return pos;
}


x86 assembly (clang, -O0):
<get_dicenum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1146 <get_dicenum+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <get_dicenum+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dicenum>:
movdqu 0x4(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_dicenum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = bitcast i32* %3 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5)
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ UINT64_C(int);
void fiat_secp256k1_divstep_precomp(uint64_t out1[4]) {
  out1[0] = UINT64_C(0xf201a41831525e0a);
  out1[1] = UINT64_C(0x9953f9ddcd648d85);
  out1[2] = UINT64_C(0xe86029463db210a9);
  out1[3] = UINT64_C(0x24fb8a3104b03709);
}


x86 assembly (clang, -O0):
<fiat_secp256k1_divstep_precomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x31525e0a,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0xcd648d85,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x3db210a9,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    $0x4b03709,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_secp256k1_divstep_precomp>:
push   %rbx
mov    %rdi,%rbx
mov    $0x31525e0a,%edi
call   1030 <UINT64_C@plt>
mov    %eax,(%rbx)
mov    $0xcd648d85,%edi
call   1030 <UINT64_C@plt>
mov    %eax,0x4(%rbx)
mov    $0x3db210a9,%edi
call   1030 <UINT64_C@plt>
mov    %eax,0x8(%rbx)
mov    $0x4b03709,%edi
call   1030 <UINT64_C@plt>
mov    %eax,0xc(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @fiat_secp256k1_divstep_precomp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @UINT64_C(i32 827481610)
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 %3, i32* %5
%6 = call i32 @UINT64_C(i32 -849048187)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %6, i32* %8
%9 = call i32 @UINT64_C(i32 1035079849)
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 2
store i32 %9, i32* %11
%12 = call i32 @UINT64_C(i32 78657289)
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 3
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_divstep_precomp(i32* nocapture writeonly %0) {
%2 = tail call i32 @UINT64_C(i32 827481610)
store i32 %2, i32* %0
%3 = tail call i32 @UINT64_C(i32 -849048187)
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = tail call i32 @UINT64_C(i32 1035079849)
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = tail call i32 @UINT64_C(i32 78657289)
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
ret void
}
void GLUE_MOVE_STACK(void *b, int amt) {
  if (amt >= 0)
    *(unsigned int *)b = 0xe28dd000 | amt;
  else
    *(unsigned int *)b = 0xe24dd000 | (-amt);
}


x86 assembly (clang, -O0):
<GLUE_MOVE_STACK>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1129 <GLUE_MOVE_STACK+0x29>
mov    -0xc(%rbp),%ecx
or     $0xe28dd000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    113a <GLUE_MOVE_STACK+0x3a>
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
or     $0xe24dd000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_MOVE_STACK>:
mov    %esi,%eax
neg    %eax
or     $0xe24dd000,%eax
mov    %esi,%ecx
or     $0xe28dd000,%ecx
test   %esi,%esi
cmovs  %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @GLUE_MOVE_STACK(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = or i32 -494022656, %8
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
store i32 %9, i32* %11
br label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
%15 = or i32 -498216960, %14
%16 = load i8*, i8** %3
%17 = bitcast i8* %16 to i32*
store i32 %15, i32* %17
br label %18
18: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
define void @GLUE_MOVE_STACK(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
%4 = sub nsw i32 0, %1
%5 = or i32 %4, -498216960
%6 = or i32 %1, -494022656
%7 = select i1 %3, i32 %6, i32 %5
%8 = bitcast i8* %0 to i32*
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int str_compare(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

x86 assembly (clang, -O2):
<str_compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @str_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const);
void print_usage(char const *const program) {
  printf(" ** Usage:\n\t %s [heapfile] [number of random attractors] [number "
         "of random repelers] [relevance tradeoff] [dissimilarity tradeoff] "
         "[executions]\n\n",
         program);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [146 x i8] c" ** Usage:\0A\09 %s [heapfile] [number of random attractors] [number of random repelers] [relevance tradeoff] [dissimilarity tradeoff] [executions]\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c" ** Usage:\0A\09 %s [heapfile] [number of random attractors] [number of random repelers] [relevance tradeoff] [dissimilarity tradeoff] [executions]\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool uDMAChannelIsEnabled(uint32_t ui32Base, uint32_t ui32ChannelNum) {
  ;
  ;
  return (((*((volatile unsigned long *)(ui32Base + 0x00000028))) &
           (1 << ui32ChannelNum))
              ? true
              : false);
}


x86 assembly (clang, -O0):
<uDMAChannelIsEnabled>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%rdx
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
and    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelIsEnabled>:
mov    %esi,%ecx
movslq %edi,%rdx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
xor    %eax,%eax
and    0x28(%rdx),%rcx
setne  %al
ret

LLVM IR (-O0):
define i32 @uDMAChannelIsEnabled(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 = add nsw i32 %5, 40
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = sext i32 %11 to i64
%13 = and i64 %9, %12
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
ret i32 %16
}

LLVM IR (-O2):
define i32 @uDMAChannelIsEnabled(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 40
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = shl nuw i32 1, %1
%8 = sext i32 %7 to i64
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
void send_portal_null(struct PortalInternal *pint,
                      volatile unsigned int *buffer, unsigned int hdr,
                      int sendFd) {}


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

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

LLVM IR (-O0):
%struct.PortalInternal = type opaque
define void @send_portal_null(%struct.PortalInternal* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca %struct.PortalInternal*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store %struct.PortalInternal* %0, %struct.PortalInternal** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.PortalInternal = type opaque
define void @send_portal_null(%struct.PortalInternal* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
ret void
}
void SysExcIntDisable(unsigned long ulIntFlags) {
  (*((volatile unsigned long *)(0x400F9004))) &= ~(ulIntFlags);
}


x86 assembly (clang, -O0):
<SysExcIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400f9004,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400f9004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysExcIntDisable>:
not    %rdi
and    %rdi,0x400f9004
40
ret

LLVM IR (-O0):
define void @SysExcIntDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074761732 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074761732 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysExcIntDisable(i64 %0) {
%2 = xor i64 %0, -1
%3 = load volatile i64, i64* inttoptr (i64 1074761732 to i64*)
%4 = and i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 1074761732 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr,
          "usage: %s [-o <outputfile>] [-b] [-f | -2] [-g] [-n] <file> \n",
          name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"usage: %s [-o <outputfile>] [-b] [-f | -2] [-g] [-n] <file> \0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"usage: %s [-o <outputfile>] [-b] [-f | -2] [-g] [-n] <file> \0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_mpy_add(int /*<<< orphan*/);
int /*<<< orphan*/ arm_mpy_op();
void arm_mla() { arm_mpy_add(arm_mpy_op()); }


x86 assembly (clang, -O0):
<arm_mla>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_mpy_op@plt>
mov    %eax,%edi
call   1040 <arm_mpy_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_mla>:
push   %rax
xor    %eax,%eax
call   1030 <arm_mpy_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_mpy_add@plt>

LLVM IR (-O0):
define void @arm_mla() {
%1 = call i32 (...) @arm_mpy_op()
%2 = call i32 @arm_mpy_add(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_mla() {
%1 = tail call i32 (...) @arm_mpy_op()
%2 = tail call i32 @arm_mpy_add(i32 %1)
ret void
}
char *str_slash(char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @str_slash(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) { printf("Caught signal\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Caught signal\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Caught signal\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void vboot_verify_firmware(struct romstage_handoff *h) {}


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

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

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

LLVM IR (-O2):
%struct.romstage_handoff = type opaque
define void @vboot_verify_firmware(%struct.romstage_handoff* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _exit_usage(void) {
  fputs("Usage: exit [n]\n", stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_exit_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_exit_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Usage: exit [n]\0A\00"
@stderr = global i32 0
define i32 @_exit_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"Usage: exit [n]\0A\00"
@stderr = global i32 0
define i32 @_exit_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
int test2(int c, int d) { return (c ^ d) & d; }


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

x86 assembly (clang, -O2):
<test2>:
mov    %edi,%eax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test2(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 = load i32, i32* %4
%9 = and i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = and i32 %3, %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void SD_NULL_alOut(uint8_t reg, uint8_t val) {}


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

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

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

LLVM IR (-O2):
define void @SD_NULL_alOut(i32 %0, i32 %1) {
ret void
}
int my_strcmp(const char *l, const char *r) {
  for (; *l == *r && *l; l++, r++)
    ;
  return *(unsigned char *)l - *(unsigned char *)r;
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <my_strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <my_strcmp+0x47>
jmp    1169 <my_strcmp+0x69>
jmp    114c <my_strcmp+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <my_strcmp+0x34>
cmp    %cl,%al
jne    1134 <my_strcmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <my_strcmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <my_strcmp+0x20>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %21, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %5
%19 = phi i1 [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %26
20: ; preds = %18
br label %21
21: ; preds = %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %5
26: ; preds = %18
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = sub nsw i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = zext i8 %19 to i32
%22 = zext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int _mm_cvtsi128_si32(int /*<<< orphan*/);
void func(__m128i *foo, size_t a, size_t b, int *dst) {
  __m128i x = foo[a];
  __m128i y = foo[b];
  __m128i sum = _mm_add_epi32(x, y);
  *dst = _mm_cvtsi128_si32(sum);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1030 <_mm_add_epi32@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1040 <_mm_cvtsi128_si32@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi,%rsi,4),%eax
mov    (%rdi,%rdx,4),%esi
mov    %eax,%edi
call   1030 <_mm_add_epi32@plt>
mov    %eax,%edi
call   1040 <_mm_cvtsi128_si32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @func(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%12 = load i32*, i32** %5
%13 = load i64, i64* %6
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %9
%16 = load i32*, i32** %5
%17 = load i64, i64* %7
%18 = getelementptr inbounds i32, i32* %16, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %10
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = call i32 @_mm_add_epi32(i32 %20, i32 %21)
store i32 %22, i32* %11
%23 = load i32, i32* %11
%24 = call i32 @_mm_cvtsi128_si32(i32 %23)
%25 = load i32*, i32** %8
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @func(i32* nocapture %0, i64 %1, i64 %2, i32* nocapture writeonly %3) {
%5 = getelementptr inbounds i32, i32* %0, i64 %1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 %2
%8 = load i32, i32* %7
%9 = tail call i32 @_mm_add_epi32(i32 %6, i32 %8)
%10 = tail call i32 @_mm_cvtsi128_si32(i32 %9)
store i32 %10, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_setspecific(int /*<<< orphan*/, void const *);
void OsSetThreadData(long key, const void *tdata) {
  pthread_setspecific((pthread_key_t)key, tdata);
}


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

x86 assembly (clang, -O2):
<OsSetThreadData>:
jmp    1030 <pthread_setspecific@plt>

LLVM IR (-O0):
define void @OsSetThreadData(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i8*, i8** %4
%8 = call i32 @pthread_setspecific(i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @OsSetThreadData(i64 %0, i8* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @pthread_setspecific(i32 %3, i8* %1)
ret void
}
int curl_is_url(const char *url) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @curl_is_url(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ BigEndianWriteU64(int /*<<< orphan*/, int /*<<< orphan*/ *);
void BigEndianWriteS64(int64_t value, uint8_t *bytes) {
  BigEndianWriteU64((uint64_t)value, bytes);
}


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

x86 assembly (clang, -O2):
<BigEndianWriteS64>:
jmp    1030 <BigEndianWriteU64@plt>

LLVM IR (-O0):
define void @BigEndianWriteS64(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32*, i32** %4
%8 = call i32 @BigEndianWriteU64(i32 %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @BigEndianWriteS64(i64 %0, i32* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @BigEndianWriteU64(i32 %3, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *, void const *, int);
void inv_fifo_protocol_helper_decode_pressure_data(const void *in, uint16_t len,
                                                   uint32_t *pressure) {
  FifoProtocol_memcpy((pressure), (in), (sizeof(uint32_t)));
  *pressure = *pressure;
  (void)len;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_pressure_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_pressure_data>:
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    $0x4,%edx
jmp    1030 <FifoProtocol_memcpy@plt>

LLVM IR (-O0):
define void @inv_fifo_protocol_helper_decode_pressure_data(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 i32*, i32** %6
%8 = load i8*, i8** %4
%9 = call i32 @FifoProtocol_memcpy(i32* %7, i8* %8, i32 4)
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
ret void
}

LLVM IR (-O2):
define void @inv_fifo_protocol_helper_decode_pressure_data(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @FifoProtocol_memcpy(i32* %2, i8* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rul__ios_init();
int /*<<< orphan*/ rul__mol_init();
void rul__initialize(void) {
  rul__mol_init();
  rul__ios_init();
}


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

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

LLVM IR (-O0):
define void @rul__initialize() {
%1 = call i32 (...) @rul__mol_init()
%2 = call i32 (...) @rul__ios_init()
ret void
}

LLVM IR (-O2):
define void @rul__initialize() {
%1 = tail call i32 (...) @rul__mol_init()
%2 = tail call i32 (...) @rul__ios_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trace_file_close();
void trace_exit(void) { trace_file_close(); }


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

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

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

LLVM IR (-O2):
define void @trace_exit() {
%1 = tail call i32 (...) @trace_file_close()
ret void
}
void togle_led() {
  unsigned int gpio;
  gpio = (*(volatile unsigned int *)((
      __typeof__(0x18000000 + 0x00040000 +
                 0x8))(((unsigned long)(0x18000000 + 0x00040000 + 0x8) &
                        0x1fffffff) |
                       0xa0000000)));
  gpio ^= 1 << 26;
  do {
    ((*(volatile unsigned int *)((
         __typeof__(0x18000000 + 0x00040000 +
                    0x8))(((unsigned long)(0x18000000 + 0x00040000 + 0x8) &
                           0x1fffffff) |
                          0xa0000000))) = (gpio));
    (*(volatile unsigned int *)((
        __typeof__(0x18000000 + 0x00040000 +
                   0x8))(((unsigned long)(0x18000000 + 0x00040000 + 0x8) &
                          0x1fffffff) |
                         0xa0000000)));
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<togle_led>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffb8040008,%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x4000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffffb8040008,%rax
mov    %ecx,(%rax)
mov    $0xffffffffb8040008,%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<togle_led>:
xorl   $0x4000000,0xffffffffb8040008
mov    0xffffffffb8040008,%eax
ret

LLVM IR (-O0):
define void @togle_led() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = xor i32 %3, 67108864
store i32 %4, i32* %1
br label %5
5: ; preds = %0
%6 = load i32, i32* %1
store volatile i32 %6, i32* inttoptr (i64 -1207697400 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
br label %8
8: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @togle_led() {
%1 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
%2 = xor i32 %1, 67108864
store volatile i32 %2, i32* inttoptr (i64 -1207697400 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ isgraph(int);
int isprint(int c) { return isgraph(c) || c == ' '; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isgraph@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <isprint+0x2f>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
push   %rbx
mov    %edi,%ebx
call   1030 <isgraph@plt>
test   %rax,%rax
setne  %al
cmp    $0x20,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isgraph(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 32
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i64 @isgraph(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float shmAdd(float *, long, float);
float shmSub(float *addr, long i, float v) { return shmAdd(addr, i, -v); }


x86 assembly (clang, -O0):
<shmSub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <shmAdd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmSub>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <shmAdd@plt>

LLVM IR (-O0):
define float @shmSub(float* %0, i64 %1, float %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca float
store float* %0, float** %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load float*, float** %4
%8 = load i64, i64* %5
%9 = load float, float* %6
%10 = fneg float %9
%11 = call float @shmAdd(float* %7, i64 %8, float %10)
ret float %11
}

LLVM IR (-O2):
define float @shmSub(float* %0, i64 %1, float %2) {
%4 = fneg float %2
%5 = tail call float @shmAdd(float* %0, i64 %1, float %4)
ret float %5
}
OP(fd, e8) { op_e8(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_e8()
ret i32 undef
}
void video_null_free(void *data) {}


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

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

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

LLVM IR (-O2):
define void @video_null_free(i8* nocapture %0) {
ret void
}
int(ispunct)(int c) { return ispunct(c); }


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

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

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Lut_N(double *, double *, int);
void Lut_14(double *out, double *in) { Lut_N(out, in, 14); }


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

x86 assembly (clang, -O2):
<Lut_14>:
mov    $0xe,%edx
jmp    1030 <Lut_N@plt>

LLVM IR (-O0):
define void @Lut_14(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @Lut_N(double* %5, double* %6, i32 14)
ret void
}

LLVM IR (-O2):
define void @Lut_14(double* %0, double* %1) {
%3 = tail call i32 @Lut_N(double* %0, double* %1, i32 14)
ret void
}
/* Variables and functions */
int close(int);
int silc_file_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<silc_file_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @silc_file_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
__complex__ double f() {
  int a[40];
  __complex__ double c;
  a[9] = 0;
  c = a[9];
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x8c(%rbp)
cvtsi2sdl -0x8c(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movq   $0x0,-0xb8(%rbp)
movsd  -0xc0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
ret

LLVM IR (-O0):
define { double, double } @f() {
%1 = alloca { double, double }
%2 = alloca [40 x i32]
%3 = alloca { double, double }
%4 = getelementptr inbounds [40 x i32], [40 x i32]* %2, i64 0, i64 9
store i32 0, i32* %4
%5 = getelementptr inbounds [40 x i32], [40 x i32]* %2, i64 0, i64 9
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%9 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %7, double* %8
store double 0.000000e+00, double* %9
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%13 = load double, double* %12
%14 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 0
%15 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 1
store double %11, double* %14
store double %13, double* %15
%16 = load { double, double }, { double, double }* %1
ret { double, double } %16
}

LLVM IR (-O2):
define { double, double } @f() {
ret { double, double } zeroinitializer
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void sem_destroy(int semid) { semctl(semid, 0, IPC_RMID); }


x86 assembly (clang, -O0):
<sem_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <semctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_destroy>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define void @sem_destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @semctl(i32 %3, i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define void @sem_destroy(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_163() {
  Assert_real((isqrt(163) == 12),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              820, ("Integer square root of 163 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_163>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa3,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x334,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_163>:
push   %rax
mov    $0xa3,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x334,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 163 should be 12\00"
define void @t_sqrt_163() {
%1 = call i32 @isqrt(i32 163)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 163 should be 12\00"
define void @t_sqrt_163() {
%1 = tail call i32 @isqrt(i32 163)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  unsigned char arg = 0x55;
  unsigned char out = 0;
  __asm__("rolb $1, %%al;" : "=a"(out) : "a"(arg));
  return (out == 0xAA);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
mov    -0x5(%rbp),%al
rol    %al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0xaa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x55,%al
rol    %al
xor    %ecx,%ecx
cmp    $0xaa,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = call i8 asm "rolb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 170
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "rolb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 85)
%2 = icmp eq i8 %1, -86
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cellWinnerProbs();
int main(void) {
  cellWinnerProbs();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cellWinnerProbs()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ expression();
void body(void) {
  ;
  expression();
  ;
}


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

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

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

LLVM IR (-O2):
define void @body() {
%1 = tail call i32 (...) @expression()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char *);
void drawString(char *s, int x, int y) { printf("DS %i %i @%s\n", x, y, s); }


x86 assembly (clang, -O0):
<drawString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"DS %i %i @%s\0A\00"
define void @drawString(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 i32, i32* %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"DS %i %i @%s\0A\00"
define void @drawString(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i8* %0)
ret void
}
char *cut_string(const char *str, char *dst, int start_point) {
  str += start_point;
  while (*str++) {
    *dst = *str;
    dst++;
  }
  *dst = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<cut_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1155 <cut_string+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <cut_string+0x20>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cut_string>:
mov    %rsi,%rax
movslq %edx,%rcx
cmpb   $0x0,(%rdi,%rcx,1)
je     1132 <cut_string+0x32>
add    %rdi,%rcx
add    $0x1,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rcx),%edx
mov    %dl,(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1120 <cut_string+0x20>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @cut_string(i8* nocapture %0, i8* writeonly %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %5, %3 ]
%10 = phi i8* [ %13, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
store i8 %12, i8* %10
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %3
%17 = phi i8* [ %1, %3 ], [ %13, %8 ]
store i8 0, i8* %17
ret i8* %17
}
/* Variables and functions */
int external_caller();
int second_level_caller(void) { return external_caller(); }


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

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

LLVM IR (-O0):
define i32 @second_level_caller() {
%1 = call i32 (...) @external_caller()
ret i32 %1
}

LLVM IR (-O2):
define i32 @second_level_caller() {
%1 = tail call i32 (...) @external_caller()
ret i32 %1
}