xunge/DecIR huggingface dataset:
void slow_work_begin_exec(int id, struct slow_work *work) {}


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

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

LLVM IR (-O0):
%struct.slow_work = type opaque
define void @slow_work_begin_exec(i32 %0, %struct.slow_work* %1) {
%3 = alloca i32
%4 = alloca %struct.slow_work*
store i32 %0, i32* %3
store %struct.slow_work* %1, %struct.slow_work** %4
ret void
}

LLVM IR (-O2):
%struct.slow_work = type opaque
define void @slow_work_begin_exec(i32 %0, %struct.slow_work* nocapture %1) {
ret void
}
void timeout() {}


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

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

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

LLVM IR (-O2):
define void @timeout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yyparse();
void callback_yyparse(int x) { yyparse(); }


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

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

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

LLVM IR (-O2):
define void @callback_yyparse(i32 %0) {
%2 = tail call i32 (...) @yyparse()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;
struct packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
int pdu_icmpv6(struct packet *, int, int /*<<< orphan*/, int,
               int /*<<< orphan*/);
int pdu_icmpv6_echo(struct packet *p, uint16_t checksum, uint16_t id,
                    uint16_t seq_num) {
  uint32_t body = htonl((id << 16) + seq_num);
  return pdu_icmpv6(p, 128, 0, checksum, body);
}


x86 assembly (clang, -O0):
<pdu_icmpv6_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%edi
shl    $0x10,%edi
add    -0x14(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x80,%esi
xor    %edx,%edx
call   1030 <pdu_icmpv6@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_icmpv6_echo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
shl    $0x10,%edx
lea    (%rdx,%rcx,1),%edi
call   1040 <htonl@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
xor    %edx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <pdu_icmpv6@plt>

LLVM IR (-O0):
%struct.packet = type { i32 }
define i32 @pdu_icmpv6_echo(%struct.packet* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.packet*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.packet* %0, %struct.packet** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = shl i32 %10, 16
%12 = load i32, i32* %8
%13 = add nsw i32 %11, %12
%14 = call i32 @htonl(i32 %13)
store i32 %14, i32* %9
%15 = load %struct.packet*, %struct.packet** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %9
%18 = call i32 @pdu_icmpv6(%struct.packet* %15, i32 128, i32 0, i32 %16, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.packet = type { i32 }
define i32 @pdu_icmpv6_echo(%struct.packet* %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 16
%6 = add nsw i32 %5, %3
%7 = tail call i32 @htonl(i32 %6)
%8 = tail call i32 @pdu_icmpv6(%struct.packet* %0, i32 128, i32 0, i32 %1, i32 %7)
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EPIConfigHB16TimingSet(uint32_t ui32Base, uint32_t ui32CS,
                            uint32_t ui32Config) {
  ASSERT(ui32Base == 0x400D0000);
  ASSERT(ui32CS < 4);
  (*((volatile uint32_t *)(ui32Base + (0x00000310 + (ui32CS << 2))))) =
      ui32Config;
}


x86 assembly (clang, -O0):
<EPIConfigHB16TimingSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x4,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    $0x310,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigHB16TimingSet>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400d0000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%ebx
setl   %dil
call   1030 <ASSERT@plt>
lea    0x310(%rbp,%rbx,4),%eax
cltq
mov    %r14d,(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @EPIConfigHB16TimingSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1074593792
%9 = zext i1 %8 to i32
%10 = call i32 @ASSERT(i32 %9)
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 4
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = shl i32 %17, 2
%19 = add nsw i32 784, %18
%20 = add nsw i32 %16, %19
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %15, i32* %22
ret void
}

LLVM IR (-O2):
define void @EPIConfigHB16TimingSet(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 1074593792
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp slt i32 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = shl i32 %1, 2
%11 = add i32 %0, 784
%12 = add i32 %11, %10
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %2, i32* %14
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ AA;

/* Variables and functions */
int maxSubArray(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int AA = {-2, 1, -3, 4, -1, 2, 1, -5, 4};
  int sum = maxSubArray(AA, sizeof(AA) / sizeof(int));
  printf("\n%d\n", sum);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @maxSubArray(i32 -2, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ test_abs();
scalar_t__ test_isqrt();
scalar_t__ test_isqrt2();
int main(int argc, char *argv[]) {
  int res = 0;
  res += test_abs();
  res += test_isqrt();
  res += test_isqrt2();
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <test_abs@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <test_isqrt@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <test_isqrt2@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <test_abs@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <test_isqrt@plt>
mov    %rax,%rbx
add    %r14d,%ebx
xor    %eax,%eax
call   1030 <test_isqrt2@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i64 (...) @test_abs()
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %6
%12 = call i64 (...) @test_isqrt()
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = add nsw i64 %14, %12
%16 = trunc i64 %15 to i32
store i32 %16, i32* %6
%17 = call i64 (...) @test_isqrt2()
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %6
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @test_abs()
%4 = tail call i64 (...) @test_isqrt()
%5 = add i64 %4, %3
%6 = tail call i64 (...) @test_isqrt2()
%7 = add i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
void case_lowers(char *s) {
  unsigned char x;
  for (;;) {
    if (!(x = *s))
      break;
    if ((x -= 'A') <= 'Z' - 'A')
      *s = x + 'a';
    ++s;
  }
}


x86 assembly (clang, -O0):
<case_lowers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
jne    111e <case_lowers+0x1e>
jmp    1154 <case_lowers+0x54>
movzbl -0x9(%rbp),%eax
sub    $0x41,%eax
mov    %al,-0x9(%rbp)
movzbl %al,%eax
cmp    $0x19,%eax
jg     1143 <case_lowers+0x43>
movzbl -0x9(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <case_lowers+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<case_lowers>:
mov    (%rdi),%al
test   %al,%al
je     112a <case_lowers+0x2a>
add    $0x1,%rdi
jmp    111b <case_lowers+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <case_lowers+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <case_lowers+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <case_lowers+0x10>
ret

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

LLVM IR (-O2):
define void @case_lowers(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
__attribute__((no)) int bar(int i) {
  asm("");
  if (i)
    bar(i - 1);
  else
    bt();
  return 1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <bar+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <bar@plt>
jmp    114c <bar+0x2c>
mov    $0x0,%al
call   1040 <bt@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
je     1125 <bar+0x15>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%edi
jne    1120 <bar+0x10>
push   %rax
xor    %eax,%eax
call   1030 <bt@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
%8 = tail call i32 (...) @bt()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_str_in_list_spaces() {
  printf("NOT IMPLEMENTED:"
         "pa_str_in_list_spaces"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_str_in_list_spaces\00"
define i32 @pa_str_in_list_spaces() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __RESETPRIMASK();
void NVIC_RESETPRIMASK(void) { __RESETPRIMASK(); }


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

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

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

LLVM IR (-O2):
define void @NVIC_RESETPRIMASK() {
%1 = tail call i32 (...) @__RESETPRIMASK()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  char buffer[128];
  sprintf(buffer, "%2$d %3$d %1$d", 1, 2, 3);
  if (strcmp("2 3 1", buffer) == 0)
    exit(0);
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1190 <main+0x60>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
call   1040 <sprintf@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1175 <main+0x45>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%2$d %3$d %1$d\00"
@.str.1 = [6 x i8] c"2 3 1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
%6 = call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c = EOF;
  printf("EOF = %c, %d\n", c, c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [14 x i8] c"EOF = %c, %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cwrapper_q_sortrev_double_with_indices(double *, int *,
                                                          int /*<<< orphan*/,
                                                          int);
void quicksortrev_double_with_indices_(double numbers[], int indices[],
                                       int *array_size) {
  cwrapper_q_sortrev_double_with_indices(numbers, indices, 0,
                                         (*array_size) - 1);
}


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

x86 assembly (clang, -O2):
<quicksortrev_double_with_indices_>:
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
xor    %edx,%edx
jmp    1030 <cwrapper_q_sortrev_double_with_indices@plt>

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

LLVM IR (-O2):
define void @quicksortrev_double_with_indices_(double* %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
%6 = tail call i32 @cwrapper_q_sortrev_double_with_indices(double* %0, i32* %1, i32 0, i32 %5)
ret void
}
void emit_nat64(struct processor_explicatory_state *process_state,
                struct modern_stream *stream, void *stream_state,
                struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_nat64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_nat64(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_nat64(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
void XkbResizeKeySyms() {}


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

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

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

LLVM IR (-O2):
define void @XkbResizeKeySyms() {
ret void
}
void eglCreatePixmapSurface(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglCreatePixmapSurface() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ un1getc(char);
void backrest(char *cp) {
  char *s;
  for (s = cp; *s; s++)
    ;
  un1getc('\n');
  while (s > cp)
    un1getc(*--s);
  return;
}


x86 assembly (clang, -O0):
<backrest>:
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     1147 <backrest+0x37>
jmp    1136 <backrest+0x26>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <backrest+0x14>
mov    $0xa,%edi
call   1030 <un1getc@plt>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    117c <backrest+0x6c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%edi
call   1030 <un1getc@plt>
jmp    1151 <backrest+0x41>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backrest>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    -0x1(%rdi),%rbx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <backrest+0x10>
mov    $0xa,%edi
nop
call   1030 <un1getc@plt>
cmp    %r14,%rbx
jbe    1144 <backrest+0x34>
movsbl -0x1(%rbx),%edi
add    $0xffffffffffffffff,%rbx
jmp    1130 <backrest+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @backrest(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 = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = call i32 @un1getc(i8 signext 10)
br label %15
15: ; preds = %19, %13
%16 = load i8*, i8** %3
%17 = load i8*, i8** %2
%18 = icmp ugt i8* %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 -1
store i8* %21, i8** %3
%22 = load i8, i8* %21
%23 = call i32 @un1getc(i8 signext %22)
br label %15
24: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @backrest(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @un1getc(i8 signext 10)
%9 = icmp ugt i8* %3, %0
br i1 %9, label %10, label %16
10: ; preds = %7, %10
%11 = phi i8* [ %12, %10 ], [ %3, %7 ]
%12 = getelementptr inbounds i8, i8* %11, i64 -1
%13 = load i8, i8* %12
%14 = tail call i32 @un1getc(i8 signext %13)
%15 = icmp ugt i8* %12, %0
br i1 %15, label %10, label %16
16: ; preds = %10, %7
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dvarmtk(int, double, int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dvarmtk(N, 4.5, 1, x, stride);
  printf("sample variance: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%ecx
movsd  0xe93(%rip),%xmm0
mov    $0x1,%esi
call   1030 <stdlib_strided_dvarmtk@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movsd  0xea5(%rip),%xmm0
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1030 <stdlib_strided_dvarmtk@plt>
lea    0xed7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dvarmtk(i32 %6, double 4.500000e+00, i32 1, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dvarmtk(i32 4, double 4.500000e+00, i32 1, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
const char *pathcon_nm10_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathcon_nm10_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathcon_nm10_name_out+0x2b>
jmp    111a <pathcon_nm10_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathcon_nm10_name_out+0x3b>
jmp    114b <pathcon_nm10_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm10_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm10_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm10_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathcon_nm10_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathcon_nm10_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void ios_delay(void) { udelay(500); }


x86 assembly (clang, -O0):
<ios_delay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f4,%edi
call   1030 <udelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ios_delay>:
mov    $0x1f4,%edi
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @ios_delay() {
%1 = call i32 @udelay(i32 500)
ret void
}

LLVM IR (-O2):
define void @ios_delay() {
%1 = tail call i32 @udelay(i32 500)
ret void
}
void ubi_dbg_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ubi_vtbl_record = type opaque
define void @ubi_dbg_dump_vtbl_record(%struct.ubi_vtbl_record* %0, i32 %1) {
%3 = alloca %struct.ubi_vtbl_record*
%4 = alloca i32
store %struct.ubi_vtbl_record* %0, %struct.ubi_vtbl_record** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ubi_vtbl_record = type opaque
define void @ubi_dbg_dump_vtbl_record(%struct.ubi_vtbl_record* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int tjoin(int n) { return syscall(56, n, 0); }


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

x86 assembly (clang, -O2):
<tjoin>:
mov    %edi,%esi
mov    $0x38,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @tjoin(i32 %0) {
%2 = tail call i32 @syscall(i32 56, i32 %0, i32 0)
ret i32 %2
}
void use_buf(char *buf) {
  while (*buf)
    buf++;
}


x86 assembly (clang, -O0):
<use_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1126 <use_buf+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <use_buf+0x8>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @use_buf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @use_buf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int endswith(char *, char *);
char *test1() {
  int res = endswith("endswith", "swith");
  char *message =
      "test1 failed: endswith(\"endswith\", \"swith\") should return 1";
  do {
    if (!(res == 1))
      return message;
  } while (0);
  return NULL;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <endswith@plt>
mov    %eax,-0xc(%rbp)
lea    0xed4(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1150 <test1+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <test1+0x4d>
jmp    1155 <test1+0x45>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <endswith@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
lea    0xed9(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"endswith\00"
@.str.1 = [6 x i8] c"swith\00"
@.str.2 = [60 x i8] c"test1 failed: endswith(\22endswith\22, \22swith\22) should return 1\00"
define i8* @test1() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i8*
%4 = call i32 @endswith(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %2
store i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %5
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = load i8*, i8** %3
store i8* %9, i8** %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10
store i8* null, i8** %1
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"endswith\00"
@.str.1 = [6 x i8] c"swith\00"
@.str.2 = [60 x i8] c"test1 failed: endswith(\22endswith\22, \22swith\22) should return 1\00"
define i8* @test1() {
%1 = tail call i32 @endswith(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ args_opts_put(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ args_opts_put_count(char const *, int /*<<< orphan*/);
void args_opts_new(const char *name) {
  args_opts_put(name, 0);
  args_opts_put_count(name, 0);
}


x86 assembly (clang, -O0):
<args_opts_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <args_opts_put@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <args_opts_put_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_opts_new>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <args_opts_put@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <args_opts_put_count@plt>

LLVM IR (-O0):
define void @args_opts_new(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @args_opts_put(i8* %3, i32 0)
%5 = load i8*, i8** %2
%6 = call i32 @args_opts_put_count(i8* %5, i32 0)
ret void
}

LLVM IR (-O2):
define void @args_opts_new(i8* %0) {
%2 = tail call i32 @args_opts_put(i8* %0, i32 0)
%3 = tail call i32 @args_opts_put_count(i8* %0, i32 0)
ret void
}
int aml_ebootkey_put(void *pefuse, int dlen) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @aml_ebootkey_put(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
unsigned char centerHT80(int channel) {
  switch (channel) {
  case 36:
  case 40:
  case 44:
  case 48:
    return 42;
  case 52:
  case 56:
  case 60:
  case 64:
    return 58;
  case 100:
  case 104:
  case 108:
  case 112:
    return 106;
  case 116:
  case 120:
  case 124:
  case 128:
    return 122;
  case 149:
  case 153:
  case 157:
  case 161:
    return 155;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<centerHT80>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffdc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7d,%eax
ja     115d <centerHT80+0x5d>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x2a,-0x1(%rbp)
jmp    1161 <centerHT80+0x61>
movb   $0x3a,-0x1(%rbp)
jmp    1161 <centerHT80+0x61>
movb   $0x6a,-0x1(%rbp)
jmp    1161 <centerHT80+0x61>
movb   $0x7a,-0x1(%rbp)
jmp    1161 <centerHT80+0x61>
movb   $0x9b,-0x1(%rbp)
jmp    1161 <centerHT80+0x61>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<centerHT80>:
add    $0xffffffdc,%edi
cmp    $0x7d,%edi
ja     1126 <centerHT80+0x26>
mov    $0x2a,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x3a,%al
ret
mov    $0x6a,%al
ret
mov    $0x9b,%al
ret
mov    $0x7a,%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @centerHT80(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 36, label %5
i32 40, label %5
i32 44, label %5
i32 48, label %5
i32 52, label %6
i32 56, label %6
i32 60, label %6
i32 64, label %6
i32 100, label %7
i32 104, label %7
i32 108, label %7
i32 112, label %7
i32 116, label %8
i32 120, label %8
i32 124, label %8
i32 128, label %8
i32 149, label %9
i32 153, label %9
i32 157, label %9
i32 161, label %9
]
5: ; preds = %1, %1, %1, %1
store i8 42, i8* %2
br label %11
6: ; preds = %1, %1, %1, %1
store i8 58, i8* %2
br label %11
7: ; preds = %1, %1, %1, %1
store i8 106, i8* %2
br label %11
8: ; preds = %1, %1, %1, %1
store i8 122, i8* %2
br label %11
9: ; preds = %1, %1, %1, %1
store i8 -101, i8* %2
br label %11
10: ; preds = %1
store i8 0, i8* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @centerHT80(i32 %0) {
switch i32 %0, label %6 [
i32 36, label %7
i32 40, label %7
i32 44, label %7
i32 48, label %7
i32 52, label %2
i32 56, label %2
i32 60, label %2
i32 64, label %2
i32 100, label %3
i32 104, label %3
i32 108, label %3
i32 112, label %3
i32 116, label %4
i32 120, label %4
i32 124, label %4
i32 128, label %4
i32 149, label %5
i32 153, label %5
i32 157, label %5
i32 161, label %5
]
2: ; preds = %1, %1, %1, %1
br label %7
3: ; preds = %1, %1, %1, %1
br label %7
4: ; preds = %1, %1, %1, %1
br label %7
5: ; preds = %1, %1, %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %1, %1, %6, %5, %4, %3, %2
%8 = phi i8 [ 0, %6 ], [ -101, %5 ], [ 122, %4 ], [ 106, %3 ], [ 58, %2 ], [ 42, %1 ], [ 42, %1 ], [ 42, %1 ], [ 42, %1 ]
ret i8 %8
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double getime(void) {
  double res = 0;
  struct timeval tv;
  if (!gettimeofday(&tv, 0))
    res = 1e-6 * tv.tv_usec, res += tv.tv_sec;
  return res;
}


x86 assembly (clang, -O0):
<getime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%eax
jne    115a <getime+0x4a>
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xorps  %xmm0,%xmm0
test   %eax,%eax
je     112c <getime+0x1c>
add    $0x18,%rsp
ret
cvtsi2sdl 0x8(%rsp),%xmm1
mulsd  0xec6(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @getime() {
%1 = alloca double
%2 = alloca %struct.timeval
store double 0.000000e+00, double* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = icmp ne i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double 0x3EB0C6F7A0B5ED8D, %8
store double %9, double* %1
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = load double, double* %1
%14 = fadd double %13, %12
store double %14, double* %1
br label %15
15: ; preds = %5, %0
%16 = load double, double* %1
ret double %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @getime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x3EB0C6F7A0B5ED8D
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fadd double %9, %12
br label %14
14: ; preds = %5, %0
%15 = phi double [ 0.000000e+00, %0 ], [ %13, %5 ]
ret double %15
}
int test_imm_B8int16_mem(short *val) {
  return ((*val) & (-0xB8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B8int16_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, -184
%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_B8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -184
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __DSB();
int /*<<< orphan*/ __ISB();
int /*<<< orphan*/ __set_ICIALLU(int /*<<< orphan*/);
void L1C_InvalidateICacheAll(void) {
  __set_ICIALLU(0);
  __DSB();
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_InvalidateICacheAll>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <__set_ICIALLU@plt>
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_InvalidateICacheAll>:
push   %rax
xor    %edi,%edi
call   1050 <__set_ICIALLU@plt>
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_InvalidateICacheAll() {
%1 = call i32 @__set_ICIALLU(i32 0)
%2 = call i32 (...) @__DSB()
%3 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_InvalidateICacheAll() {
%1 = tail call i32 @__set_ICIALLU(i32 0)
%2 = tail call i32 (...) @__DSB()
%3 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
main() {
  printf("%u\n", setbits(170, 4, 3, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xaa,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xaa,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1040 <setbits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 170, i32 4, i32 3, i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_7Bint8_mem(signed char *val) {
  return ((*val) & (0x7B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Bint8_mem>:
testb  $0x7b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Bint8_mem(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 = and i32 %5, 123
%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_7Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 123
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}