xunge/DecIR huggingface dataset:
int main() {
  int k = 0, i, s = 0;
#pragma omp parallel for simd linear(k : 3) reduction(+: s) schedule (static, 16)
  for (i = 0; i < 128; i++) {
    k = k + 3;
    s = s + k;
  }
  if (s != 128 * 129 / 2 * 3)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1161 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
cmpl   $0x60c0,-0x10(%rbp)
je     1173 <main+0x63>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int miniggsn_snd_npdu(struct sgsn_pdp_ctx *pctx, unsigned char *npdu,
                      unsigned len) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.sgsn_pdp_ctx = type opaque
define i32 @miniggsn_snd_npdu(%struct.sgsn_pdp_ctx* %0, i8* %1, i32 %2) {
%4 = alloca %struct.sgsn_pdp_ctx*
%5 = alloca i8*
%6 = alloca i32
store %struct.sgsn_pdp_ctx* %0, %struct.sgsn_pdp_ctx** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.sgsn_pdp_ctx = type opaque
define i32 @miniggsn_snd_npdu(%struct.sgsn_pdp_ctx* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void LZ4_compressResetNoStream(const struct compressionParameters *pThis) {
  (void)pThis;
}


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

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

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

LLVM IR (-O2):
%struct.compressionParameters = type opaque
define void @LZ4_compressResetNoStream(%struct.compressionParameters* nocapture %0) {
ret void
}
short top(x)
int x;
{ return 2 * middle(x); }


x86 assembly (clang, -O0):
<top>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <middle@plt>
shl    $0x1,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @top(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @middle to i32 (i32, ...)*)(i32 %3)
%5 = mul nsw i32 2, %4
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @top(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @middle to i32 (i32, ...)*)(i32 %0)
%3 = trunc i32 %2 to i16
%4 = shl i16 %3, 1
ret i16 %4
}
int _is_string_not_empty(char *string) { return *string == '\0' ? 0 : 1; }


x86 assembly (clang, -O0):
<_is_string_not_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_string_not_empty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @_is_string_not_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @_is_string_not_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, int);
int _has_id3v2tag(char *raw_header) {
  if (memcmp(raw_header, "ID3", 3) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_has_id3v2tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1147 <_has_id3v2tag+0x37>
movl   $0x1,-0x4(%rbp)
jmp    114e <_has_id3v2tag+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_has_id3v2tag>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ID3\00"
define i32 @_has_id3v2tag(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @memcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"ID3\00"
define i32 @_has_id3v2tag(i8* %0) {
%2 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(char);
char *upcase(char *t) {
  char *s = t;
  while (*s) {
    if (islower(*s))
      *s = toupper(*s);
    s++;
  }
  return t;
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117c <upcase+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     116b <upcase+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <upcase+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1165 <upcase+0x45>
mov    %r14,%rbx
jmp    114c <upcase+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <upcase+0x45>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1140 <upcase+0x20>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1140 <upcase+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @upcase(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @islower(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test(int M) {
  int i, j;
  i = 2 * M;
  {
    hash(1);
    hash(2 * M);
    hash(M);
  };
}


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

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <hash@plt>
lea    (%rbx,%rbx,1),%edi
call   1030 <hash@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <hash@plt>

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

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = tail call i32 @hash(i32 1)
%3 = shl nsw i32 %0, 1
%4 = tail call i32 @hash(i32 %3)
%5 = tail call i32 @hash(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal32array(void *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 32));
}


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

x86 assembly (clang, -O2):
<pushreal32array>:
shl    $0x5,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushreal32array(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 = mul nsw i32 %6, 32
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushreal32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
unsigned long
unsignedlong_ignoring_unsignedlonglongint(unsigned long x,
                                          unsigned long long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlong_ignoring_unsignedlonglongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_unsignedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ undefine(char *);
bool handle_possible_undefine(char *words[]) {
  if (strcmp(words[0], "#undef") == 0) {
    undefine(words[1]);
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<handle_possible_undefine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xec6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1162 <handle_possible_undefine+0x42>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <undefine@plt>
movl   $0x1,-0x4(%rbp)
jmp    1169 <handle_possible_undefine+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_possible_undefine>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0xed2(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     113f <handle_possible_undefine+0x1f>
pop    %rbx
ret
mov    0x8(%rbx),%rdi
call   1030 <undefine@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"#undef\00"
define i32 @handle_possible_undefine(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8**, i8*** %3
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @undefine(i8* %12)
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"#undef\00"
define i32 @handle_possible_undefine(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = getelementptr inbounds i8*, i8** %0, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @undefine(i8* %7)
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %10
}
int test_imm_E6int16_mem(short *val) {
  return ((*val) & (-0xE6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E6int16_mem>:
movzwl (%rdi),%eax
test   $0xff1a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E6int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -230
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E6int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -230
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float VectorSumOne(float *vX, float *vY, float *vZ) {
  float m;
  float d;
  m = *vX + *vY + *vZ;
  d = (float)1.0 / m;
  *vX *= d;
  *vY *= d;
  *vZ *= d;
  return m;
}


x86 assembly (clang, -O0):
<VectorSumOne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xecb(%rip),%xmm0
divss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<VectorSumOne>:
movss  (%rdi),%xmm1
movss  (%rsi),%xmm0
addss  %xmm1,%xmm0
addss  (%rdx),%xmm0
movss  0xee8(%rip),%xmm2
divss  %xmm0,%xmm2
mulss  %xmm2,%xmm1
movss  %xmm1,(%rdi)
movss  (%rsi),%xmm1
mulss  %xmm2,%xmm1
movss  %xmm1,(%rsi)
mulss  (%rdx),%xmm2
movss  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define float @VectorSumOne(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
%8 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = load float*, float** %5
%12 = load float, float* %11
%13 = fadd float %10, %12
%14 = load float*, float** %6
%15 = load float, float* %14
%16 = fadd float %13, %15
store float %16, float* %7
%17 = load float, float* %7
%18 = fdiv float 1.000000e+00, %17
store float %18, float* %8
%19 = load float, float* %8
%20 = load float*, float** %4
%21 = load float, float* %20
%22 = fmul float %21, %19
store float %22, float* %20
%23 = load float, float* %8
%24 = load float*, float** %5
%25 = load float, float* %24
%26 = fmul float %25, %23
store float %26, float* %24
%27 = load float, float* %8
%28 = load float*, float** %6
%29 = load float, float* %28
%30 = fmul float %29, %27
store float %30, float* %28
%31 = load float, float* %7
ret float %31
}

LLVM IR (-O2):
define float @VectorSumOne(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
%7 = load float, float* %2
%8 = fadd float %6, %7
%9 = fdiv float 1.000000e+00, %8
%10 = fmul float %4, %9
store float %10, float* %0
%11 = load float, float* %1
%12 = fmul float %11, %9
store float %12, float* %1
%13 = load float, float* %2
%14 = fmul float %9, %13
store float %14, float* %2
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
extern void yhttp_free(void *x) { free(x); }


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

LLVM IR (-O0):
define void @yhttp_free(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 @yhttp_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void exit(long exitCode) {
  asm("movq %0,%%rbx \n\t"
      "movq $1,%%rax \n\t"
      "int $0x80		\n\t"
      "hlt    \n\t" ::"m"(exitCode));
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rbx
mov    $0x1,%rax
int    $0x80
hlt

x86 assembly (clang, -O2):
<exit>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rbx
mov    $0x1,%rax
int    $0x80
hlt

LLVM IR (-O0):
define void @exit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
unreachable
}
int prviVeci(int n, int x[], int y, int p) {
  int i;
  for (i = p + 1; i < n; i++) {
    if (x[i] > y) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<prviVeci>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <prviVeci+0x58>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jle    1145 <prviVeci+0x45>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <prviVeci+0x5f>
jmp    114a <prviVeci+0x4a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <prviVeci+0x1a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prviVeci>:
mov    %ecx,%eax
movslq %ecx,%rcx
movslq %edi,%r8
add    $0x1,%rcx
nopl   0x0(%rax)
cmp    %r8,%rcx
jge    1125 <prviVeci+0x25>
add    $0x1,%eax
lea    0x1(%rcx),%rdi
cmp    %edx,(%rsi,%rcx,4)
mov    %rdi,%rcx
jle    1110 <prviVeci+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @prviVeci(i32 %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = sext i32 %0 to i64
br label %7
7: ; preds = %11, %4
%8 = phi i64 [ %9, %11 ], [ %5, %4 ]
%9 = add nsw i64 %8, 1
%10 = icmp slt i64 %9, %6
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = getelementptr inbounds i32, i32* %1, i64 %9
%13 = load i32, i32* %12
%14 = icmp sgt i32 %13, %2
br i1 %14, label %15, label %7
15: ; preds = %11
%16 = trunc i64 %9 to i32
br label %17
17: ; preds = %7, %15
%18 = phi i32 [ %16, %15 ], [ -1, %7 ]
ret i32 %18
}
int bytesToInt(char *bytes) {
  int value = 0;
  int i;
  for (i = 0; i < 4; i++) {
    int shift = (4 - 1 - i) * 8;
    value += (bytes[i] & 0x000000FF) << shift;
  }
  return value;
}


x86 assembly (clang, -O0):
<bytesToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1158 <bytesToInt+0x58>
mov    $0x3,%eax
sub    -0x10(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xff,%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <bytesToInt+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bytesToInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %24, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sub nsw i32 3, %10
%12 = mul nsw i32 %11, 8
store i32 %12, i32* %5
%13 = load i8*, i8** %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = and i32 %18, 255
%20 = load i32, i32* %5
%21 = shl i32 %19, %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
store i32 %23, i32* %3
br label %24
24: ; preds = %9
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @bytesToInt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %13, %9
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ ClearDictionary();
void Niall_Free(void) { ClearDictionary(); }


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

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

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

LLVM IR (-O2):
define void @Niall_Free() {
%1 = tail call i32 (...) @ClearDictionary()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ verify_file(char *);
int main(int argc, char *argv[]) { verify_file(argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <verify_file@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @verify_file(i8* %4)
ret i32 0
}
void MoveAddressSpace(void) {}


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

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

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

LLVM IR (-O2):
define void @MoveAddressSpace() {
ret void
}
void CSQC_WorldLoaded(void) {}


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

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

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

LLVM IR (-O2):
define void @CSQC_WorldLoaded() {
ret void
}
int f_bge_mr1(float *a1, float a2) {
  return (__builtin_isgreaterequal(*a1, a2));
}


x86 assembly (clang, -O0):
<f_bge_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bge_mr1>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @f_bge_mr1(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp oge float %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_bge_mr1(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp oge float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: sdb_client [-d] [-p] [-s separator] [-c command] url\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"usage: sdb_client [-d] [-p] [-s separator] [-c command] url\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"usage: sdb_client [-d] [-p] [-s separator] [-c command] url\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
double norma(int dim, double *x) { return -1; }


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

x86 assembly (clang, -O2):
<norma>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @norma(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @norma(i32 %0, double* nocapture readnone %1) {
ret double -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void announce(char *str) { printf("------ %s ------\n", str); }


x86 assembly (clang, -O0):
<announce>:
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):
<announce>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"------ %s ------\0A\00"
define void @announce(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

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


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

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

LLVM IR (-O0):
define i32 @cread_u64(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_u64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
void *faad_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<faad_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @faad_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int inner(int);
short middle(int x) { return 2 * inner(x); }


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

x86 assembly (clang, -O2):
<middle>:
push   %rax
call   1030 <inner@plt>
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @middle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @inner(i32 %3)
%5 = mul nsw i32 2, %4
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @middle(i32 %0) {
%2 = tail call i32 @inner(i32 %0)
%3 = trunc i32 %2 to i16
%4 = shl i16 %3, 1
ret i16 %4
}
int el_aes256_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @el_aes256_init() {
ret i32 0
}
/* Variables and functions */
void *memset(void *, int /*<<< orphan*/, size_t);
void *ZeroMemory(void *s, size_t n) { return memset(s, 0, n); }


x86 assembly (clang, -O0):
<ZeroMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZeroMemory>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @ZeroMemory(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @ZeroMemory(i8* returned writeonly %0, i64 %1) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %1, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world!!!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello world!!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello world!!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void *null_midi_init(const char *input, const char *output) {
  return (void *)-1;
}


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

x86 assembly (clang, -O2):
<null_midi_init>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @null_midi_init(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @null_midi_init(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* inttoptr (i64 -1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int q;
  q = 1;
  printf("%d is neat.\n", q);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"%d is neat.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d is neat.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int contains(char *str, char c) {
  while (*str)
    if (*(str++) == c)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <contains+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1145 <contains+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1151 <contains+0x51>
jmp    110e <contains+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
movzbl (%rdi),%eax
test   %al,%al
je     1116 <contains+0x16>
add    $0x1,%rdi
cmp    %sil,%al
jne    1100 <contains>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, %1
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int LOG_CONS;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
void openlog(char *, int, int /*<<< orphan*/);
void log_init() { return openlog("yasnd", LOG_PID | LOG_CONS, LOG_USER); }


x86 assembly (clang, -O0):
<log_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2eac(%rip),%rax
or     (%rax),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0xeca(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_init>:
mov    0x2ec1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0xece(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"yasnd\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
define void @log_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_USER
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"yasnd\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
define void @log_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_USER
tail call void @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
void mem_put_lte16(unsigned char *mem, unsigned int val) {
  mem[0] = ((val)&0xff);
  mem[1] = ((val >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<mem_put_lte16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mem_put_lte16(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 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @mem_put_lte16(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ route_update_links();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ topo__update_nodes();
void *topo__run(void *params) {
  while (1) {
    topo__update_nodes();
    route_update_links();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<topo__run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <topo__update_nodes@plt>
mov    $0x0,%al
call   1030 <route_update_links@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113c <topo__run+0xc>

x86 assembly (clang, -O2):
<topo__run>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <topo__update_nodes@plt>
xor    %eax,%eax
call   1030 <route_update_links@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <topo__run+0x10>

LLVM IR (-O0):
define i8* @topo__run(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @topo__update_nodes()
%5 = call i32 (...) @route_update_links()
%6 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @topo__run(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @topo__update_nodes()
%4 = tail call i32 (...) @route_update_links()
%5 = tail call i32 @sleep(i32 1)
br label %2
}
void sigint(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigint(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_bar(char mark, int width) {
  int i;
  for (i = 0; i < width; i++) {
    printf("%c", mark);
  }
}


x86 assembly (clang, -O0):
<print_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1152 <print_bar+0x42>
lea    0xec5(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <print_bar+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    113f <print_bar+0x2f>
mov    %esi,%ebx
movsbl %dil,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <print_bar+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_bar(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
void plugin_exit_string(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_string() {
ret void
}
int condition_numeric(char c) { return (('0' <= c) && (c <= '9')); }


x86 assembly (clang, -O0):
<condition_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <condition_numeric+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @condition_numeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @condition_numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_WriteQtable(unsigned char byData) {
  VIM_HIF_SetReg8((0x0000 + 0x01D), byData);
}


x86 assembly (clang, -O0):
<VIM_JPEG_WriteQtable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1d,%edi
movzbl -0x1(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_WriteQtable>:
mov    %edi,%esi
mov    $0x1d,%edi
jmp    1030 <VIM_HIF_SetReg8@plt>

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

LLVM IR (-O2):
define void @VIM_JPEG_WriteQtable(i8 zeroext %0) {
%2 = tail call i32 @VIM_HIF_SetReg8(i32 29, i8 zeroext %0)
ret void
}
int test_imm_96uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x96,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_96uint64_midword_reg>:
test   $0x960000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_96uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 150
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_96uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9830400
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t I2CFIFOStatus(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000F08))));
}


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

x86 assembly (clang, -O2):
<I2CFIFOStatus>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0xf08(%rax),%rax
ret

LLVM IR (-O0):
define i64 @I2CFIFOStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 3848
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2CFIFOStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 3848
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_get_event(void *bus) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_get_event(i8* nocapture readnone %0) {
ret i8* null
}