xunge/DecIR huggingface dataset:
/* Type definitions */
struct cphy {
  int dummy;
};

/* Variables and functions */
int t3_phy_reset(struct cphy *, int /*<<< orphan*/, int /*<<< orphan*/);
int vsc8211_reset(struct cphy *cphy, int wait) {
  return t3_phy_reset(cphy, 0, 0);
}


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

x86 assembly (clang, -O2):
<vsc8211_reset>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <t3_phy_reset@plt>

LLVM IR (-O0):
%struct.cphy = type { i32 }
define i32 @vsc8211_reset(%struct.cphy* %0, i32 %1) {
%3 = alloca %struct.cphy*
%4 = alloca i32
store %struct.cphy* %0, %struct.cphy** %3
store i32 %1, i32* %4
%5 = load %struct.cphy*, %struct.cphy** %3
%6 = call i32 @t3_phy_reset(%struct.cphy* %5, i32 0, i32 0)
ret i32 %6
}

LLVM IR (-O2):
%struct.cphy = type { i32 }
define i32 @vsc8211_reset(%struct.cphy* %0, i32 %1) {
%3 = tail call i32 @t3_phy_reset(%struct.cphy* %0, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CP15_DisableDcache();
int /*<<< orphan*/ CP15_DrainWriteBuffer();
int /*<<< orphan*/ CP15_InvalidateTLB();
int /*<<< orphan*/ CP15_TestCleanInvalidateDcache();
void CP15_ShutdownDcache(void) {
  CP15_TestCleanInvalidateDcache();
  CP15_DrainWriteBuffer();
  CP15_DisableDcache();
  CP15_InvalidateTLB();
}


x86 assembly (clang, -O0):
<CP15_ShutdownDcache>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <CP15_TestCleanInvalidateDcache@plt>
mov    $0x0,%al
call   1050 <CP15_DrainWriteBuffer@plt>
mov    $0x0,%al
call   1040 <CP15_DisableDcache@plt>
mov    $0x0,%al
call   1030 <CP15_InvalidateTLB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CP15_ShutdownDcache>:
push   %rax
xor    %eax,%eax
call   1060 <CP15_TestCleanInvalidateDcache@plt>
xor    %eax,%eax
call   1050 <CP15_DrainWriteBuffer@plt>
xor    %eax,%eax
call   1040 <CP15_DisableDcache@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CP15_InvalidateTLB@plt>

LLVM IR (-O0):
define void @CP15_ShutdownDcache() {
%1 = call i32 (...) @CP15_TestCleanInvalidateDcache()
%2 = call i32 (...) @CP15_DrainWriteBuffer()
%3 = call i32 (...) @CP15_DisableDcache()
%4 = call i32 (...) @CP15_InvalidateTLB()
ret void
}

LLVM IR (-O2):
define void @CP15_ShutdownDcache() {
%1 = tail call i32 (...) @CP15_TestCleanInvalidateDcache()
%2 = tail call i32 (...) @CP15_DrainWriteBuffer()
%3 = tail call i32 (...) @CP15_DisableDcache()
%4 = tail call i32 (...) @CP15_InvalidateTLB()
ret void
}
void osTaskSwitchFromIrq(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ strbuf_ltrim(struct strbuf *);
int /*<<< orphan*/ strbuf_rtrim(struct strbuf *);
void strbuf_trim(struct strbuf *sb) {
  strbuf_rtrim(sb);
  strbuf_ltrim(sb);
}


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

x86 assembly (clang, -O2):
<strbuf_trim>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strbuf_rtrim@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strbuf_ltrim@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define void @strbuf_trim(%struct.strbuf* %0) {
%2 = alloca %struct.strbuf*
store %struct.strbuf* %0, %struct.strbuf** %2
%3 = load %struct.strbuf*, %struct.strbuf** %2
%4 = call i32 @strbuf_rtrim(%struct.strbuf* %3)
%5 = load %struct.strbuf*, %struct.strbuf** %2
%6 = call i32 @strbuf_ltrim(%struct.strbuf* %5)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @strbuf_trim(%struct.strbuf* %0) {
%2 = tail call i32 @strbuf_rtrim(%struct.strbuf* %0)
%3 = tail call i32 @strbuf_ltrim(%struct.strbuf* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int main(void) { return !!kill(1, SIGINT); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   1030 <kill@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   1030 <kill@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGINT
%3 = call i32 @kill(i32 1, i32 %2)
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@SIGINT = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @kill(i32 1, i32 %1)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void sql_freeresult() {}


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

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

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

LLVM IR (-O2):
define void @sql_freeresult() {
ret void
}
/* Variables and functions */
size_t divide_round_up(size_t n, size_t q) {
  return n % q == 0 ? n / q : n / q + 1;
}


x86 assembly (clang, -O0):
<divide_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    $0x0,%rdx
jne    1137 <divide_round_up+0x37>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x18(%rbp)
jmp    114b <divide_round_up+0x4b>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_round_up>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <divide_round_up+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <divide_round_up+0x1a>
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @divide_round_up(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
%6 = load i64, i64* %4
%7 = urem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = udiv i64 %10, %11
br label %18
13: ; preds = %2
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = udiv i64 %14, %15
%17 = add i64 %16, 1
br label %18
18: ; preds = %13, %9
%19 = phi i64 [ %12, %9 ], [ %17, %13 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @divide_round_up(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp ne i64 %3, 0
%5 = udiv i64 %0, %1
%6 = zext i1 %4 to i64
%7 = add i64 %5, %6
ret i64 %7
}
char test_49_0(char *mem) { return __atomic_fetch_and(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_49_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_49_0+0x4a>
jmp    111f <test_49_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_49_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0x1,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_49_0+0x10>
ret

LLVM IR (-O0):
define signext i8 @test_49_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw and i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_49_0(i8* nocapture %0) {
%2 = atomicrmw and i8* %0, i8 1 acq_rel
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, unsigned long long const);
void print_main_function_epilogue(const char *test_source_file_name,
                                  const size_t test_cnt) {
  const unsigned long long int test_cnt_llu = test_cnt;
  printf("  return cutest_shutdown(\"%s\", junit_report, %llu);\n\n"
         "}\n",
         test_source_file_name, test_cnt_llu);
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c" return cutest_shutdown(\22%s\22, junit_report, %llu);\0A\0A}\0A\00"
define void @print_main_function_epilogue(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
store i64 %6, i64* %5
%7 = load i8*, i8** %3
%8 = load i64, i64* %5
%9 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c" return cutest_shutdown(\22%s\22, junit_report, %llu);\0A\0A}\0A\00"
define void @print_main_function_epilogue(i8* %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret void
}
void busy_wait(int wait_count) {
  volatile unsigned int i;
  for (i = 0; i < 3000000; i++)
    ;
}


x86 assembly (clang, -O0):
<busy_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x2dc6c0,%eax
jae    112f <busy_wait+0x2f>
jmp    1121 <busy_wait+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <busy_wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy_wait>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x2dc6bf,%eax
ja     1130 <busy_wait+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x2dc6c0,%eax
jb     1120 <busy_wait+0x20>
ret

LLVM IR (-O0):
define void @busy_wait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load volatile i32, i32* %3
%6 = icmp ult i32 %5, 3000000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load volatile i32, i32* %3
%10 = add i32 %9, 1
store volatile i32 %10, i32* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @busy_wait(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp ult i32 %4, 3000000
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp ult i32 %9, 3000000
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printNumber(int, int, int, char, int);
void printN(int number) { printNumber(3, 6, 1, ' ', number); }


x86 assembly (clang, -O0):
<printN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%r8d
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x1,%edx
mov    $0x20,%ecx
call   1030 <printNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printN>:
mov    %edi,%r8d
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x1,%edx
mov    $0x20,%ecx
jmp    1030 <printNumber@plt>

LLVM IR (-O0):
define void @printN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printNumber(i32 3, i32 6, i32 1, i8 signext 32, i32 %3)
ret void
}

LLVM IR (-O2):
define void @printN(i32 %0) {
%2 = tail call i32 @printNumber(i32 3, i32 6, i32 1, i8 signext 32, i32 %0)
ret void
}
unsigned int TWMX(unsigned int a) {
  a = (a ^ 61) ^ (a >> 16);
  a = a + (a << 3);
  a = a ^ (a >> 4);
  a = a * 0x27d4eb2d;
  a = a ^ (a >> 15);
  return a;
}


x86 assembly (clang, -O0):
<TWMX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3d,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x27d4eb2d,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TWMX>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
xor    $0x3d,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%ecx
shr    $0x4,%ecx
xor    %eax,%ecx
imul   $0x27d4eb2d,%ecx,%ecx
mov    %ecx,%eax
shr    $0xf,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @TWMX(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 61
%5 = load i32, i32* %2
%6 = lshr i32 %5, 16
%7 = xor i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = shl i32 %9, 3
%11 = add i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = xor i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = mul i32 %16, 668265261
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 15
%21 = xor i32 %18, %20
store i32 %21, i32* %2
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @TWMX(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = xor i32 %3, 61
%5 = mul i32 %4, 9
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = mul i32 %7, 668265261
%9 = lshr i32 %8, 15
%10 = xor i32 %9, %8
ret i32 %10
}
/* Variables and functions */
int abs(int);
int min_time(int *p1, int *p2) {
  int a = abs(p1[0] - p2[0]);
  int b = abs(p1[1] - p2[1]);
  return (a > b ? a : b);
}


x86 assembly (clang, -O0):
<min_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
sub    (%rax),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x10(%rbp),%rax
sub    0x4(%rax),%edi
call   1030 <abs@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1161 <min_time+0x51>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <min_time+0x57>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_time>:
movq   (%rdi),%xmm0
movq   (%rsi),%xmm1
psubd  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrad  $0x1f,%xmm1
paddd  %xmm1,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%ecx
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,%eax
cmp    %eax,%ecx
cmova  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @min_time(i32* nocapture %0, i32* nocapture %1) {
%3 = bitcast i32* %0 to <2 x i32>*
%4 = load <2 x i32>, <2 x i32>* %3
%5 = bitcast i32* %1 to <2 x i32>*
%6 = load <2 x i32>, <2 x i32>* %5
%7 = sub nsw <2 x i32> %4, %6
%8 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %7, i1 true)
%9 = extractelement <2 x i32> %8, i64 0
%10 = extractelement <2 x i32> %8, i64 1
%11 = icmp ugt i32 %9, %10
%12 = select i1 %11, i32 %9, i32 %10
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32l15(uint32_t x) { return (x << 15) | (x >> 17); }


x86 assembly (clang, -O0):
<rot32l15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
mov    -0x4(%rbp),%ecx
sar    $0x11,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32l15>:
mov    %edi,%eax
shl    $0xf,%eax
sar    $0x11,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32l15(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 15
%5 = load i32, i32* %2
%6 = ashr i32 %5, 17
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32l15(i32 %0) {
%2 = shl i32 %0, 15
%3 = ashr i32 %0, 17
%4 = or i32 %2, %3
ret i32 %4
}
void ASN1_template_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_template_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIA1_SetInterruptFlag(int);
void VIA1_iCA1_Sixtieth_PulseNtfy(void) { VIA1_SetInterruptFlag(1); }


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

x86 assembly (clang, -O2):
<VIA1_iCA1_Sixtieth_PulseNtfy>:
mov    $0x1,%edi
jmp    1030 <VIA1_SetInterruptFlag@plt>

LLVM IR (-O0):
define void @VIA1_iCA1_Sixtieth_PulseNtfy() {
%1 = call i32 @VIA1_SetInterruptFlag(i32 1)
ret void
}

LLVM IR (-O2):
define void @VIA1_iCA1_Sixtieth_PulseNtfy() {
%1 = tail call i32 @VIA1_SetInterruptFlag(i32 1)
ret void
}
void foo_2_1_1_2_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_2_1_1_1() {
ret void
}
/* Type definitions */
struct stat {
  unsigned int st_size;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
unsigned int get_filesize(int fd) {
  struct stat s;
  if (fstat(fd, &s) == 0) {
    return (s.st_size);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<get_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
cmp    $0x0,%rax
jne    113c <get_filesize+0x2c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <get_filesize+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <get_filesize+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_filesize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_filesize(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
void setval(unsigned *p) { *p = 3347663060u; }


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

x86 assembly (clang, -O2):
<setval>:
movl   $0xc78948d4,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval(i32* nocapture writeonly %0) {
store i32 -947304236, i32* %0
ret void
}
int next(int cur, int size) { return ((cur + 1) % size); }


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
lea    0x1(%rdi),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @next(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @next(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = srem i32 %3, %1
ret i32 %4
}
long switchv(long idx) {
  long result = 8;
  switch (idx) {
  case 0:
    result = 0xaaa;
    break;
  case 2:
  case 5:
    result = 0xbbb;
    break;
  case 3:
    result = 0xccc;
    break;
  default:
    result = 0xddd;
  }
  return result;
}


x86 assembly (clang, -O0):
<switchv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     115d <switchv+0x5d>
mov    -0x18(%rbp),%rax
lea    0xed3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0xaaa,-0x10(%rbp)
jmp    1165 <switchv+0x65>
movq   $0xbbb,-0x10(%rbp)
jmp    1165 <switchv+0x65>
movq   $0xccc,-0x10(%rbp)
jmp    1165 <switchv+0x65>
movq   $0xddd,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switchv>:
mov    $0xddd,%eax
cmp    $0x5,%rdi
ja     1116 <switchv+0x16>
lea    0xeee(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
define i64 @switchv(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 8, i64* %3
%4 = load i64, i64* %2
switch i64 %4, label %8 [
i64 0, label %5
i64 2, label %6
i64 5, label %6
i64 3, label %7
]
5: ; preds = %1
store i64 2730, i64* %3
br label %9
6: ; preds = %1, %1
store i64 3003, i64* %3
br label %9
7: ; preds = %1
store i64 3276, i64* %3
br label %9
8: ; preds = %1
store i64 3549, i64* %3
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
@switch.table.switchv = [6 x i64] [i64 2730, i64 3549, i64 3003, i64 3276, i64 3549, i64 3003]
define i64 @switchv(i64 %0) {
%2 = icmp ult i64 %0, 6
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = getelementptr inbounds [6 x i64], [6 x i64]* @switch.table.switchv, i64 0, i64 %0
%5 = load i64, i64* %4
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 3549, %1 ]
ret i64 %7
}
float MatDet2by2(const float *matA) {
  return ((*(matA)) * (*((matA + 2) + 1)) - (*((matA) + 1)) * (*(matA + 2)));
}


x86 assembly (clang, -O0):
<MatDet2by2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatDet2by2>:
movss  0x8(%rdi),%xmm1
mulss  0x4(%rdi),%xmm1
movss  (%rdi),%xmm0
mulss  0xc(%rdi),%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @MatDet2by2(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 2
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = fneg float %15
%17 = call float @llvm.fmuladd.f32(float %4, float %8, float %16)
ret float %17
}

LLVM IR (-O2):
define float @MatDet2by2(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 2
%4 = getelementptr inbounds float, float* %0, i64 3
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = load float, float* %3
%9 = fneg float %7
%10 = fmul float %8, %9
%11 = tail call float @llvm.fmuladd.f32(float %2, float %5, float %10)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *const);
extern void eFree(void *const ptr) {
  do {
  } while (0);
  free(ptr);
}


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

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

LLVM IR (-O0):
define void @eFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @eFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ehci_suspend();
void ehci_shutdown(void) { ehci_suspend(); }


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

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

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

LLVM IR (-O2):
define void @ehci_shutdown() {
%1 = tail call i32 (...) @ehci_suspend()
ret void
}
void ls_cost_nm6_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_cost_nm6_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void fn3() { abort(); }


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

x86 assembly (clang, -O2):
<fn3>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fn3() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @fn3() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int is_palindrome(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Nombre de parametres insuffisants\n");
    return 1;
  }
  printf("%d", is_palindrome(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115a <main+0x3a>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <is_palindrome@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     1149 <main+0x19>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    1164 <main+0x34>
mov    0x8(%rsi),%rdi
call   1040 <is_palindrome@plt>
lea    0xea7(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [34 x i8] c"Nombre de parametres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @is_palindrome(i8* %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ nop();
void condition_always_true_bad() {
  if (1) {
    nop();
  }
}


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

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

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

LLVM IR (-O2):
define void @condition_always_true_bad() {
%1 = tail call i32 (...) @nop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  struct {
    int a, b;
  } s, q;
  s = q;
  assert(s.a == q.a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
define i32 @main() {
%1 = alloca %struct.anon
%2 = alloca %struct.anon
%3 = bitcast %struct.anon* %1 to i8*
%4 = bitcast %struct.anon* %2 to i8*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

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

/* Variables and functions */
size_t regerror(int, int /*<<< orphan*/ const *, char *, size_t);
__attribute__((__weak__, __always___)) size_t
softboundcets_regerror(int errcode, const regex_t *preg, char *errbuf,
                       size_t errbuf_size) {
  return regerror(errcode, preg, errbuf, errbuf_size);
}


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

x86 assembly (clang, -O2):
<softboundcets_regerror>:
jmp    1030 <regerror@plt>

LLVM IR (-O0):
define weak i64 @softboundcets_regerror(i32 %0, i32* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i64 @regerror(i32 %9, i32* %10, i8* %11, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define weak i64 @softboundcets_regerror(i32 %0, i32* %1, i8* %2, i64 %3) {
%5 = tail call i64 @regerror(i32 %0, i32* %1, i8* %2, i64 %3)
ret i64 %5
}
struct group *getgrent() {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<getgrent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getgrent = [9 x i8] c"getgrent\00"
define %struct.group* @getgrent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.getgrent, i64 0, i64 0))
ret %struct.group* null
}

LLVM IR (-O2):
%struct.group = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getgrent = [9 x i8] c"getgrent\00"
define %struct.group* @getgrent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.getgrent, i64 0, i64 0))
ret %struct.group* null
}
int slen(char *s) {
  int c = 0;
  while (*(s + c)) {
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<slen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <slen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <slen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <slen+0x10>
ret

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

LLVM IR (-O2):
define i32 @slen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: %s [-fLnrv] [directories ...]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s [-fLnrv] [directories ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s [-fLnrv] [directories ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1000000))) void hp2(void) { printf("hello, world!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @hp2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
char ws_simple_hex(char c) {
  if (c < 10)
    return c + '0';
  return c - 10 + 'a';
}


x86 assembly (clang, -O0):
<ws_simple_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <ws_simple_hex+0x26>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1133 <ws_simple_hex+0x33>
movsbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws_simple_hex>:
cmp    $0xa,%dil
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

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

LLVM IR (-O2):
define signext i8 @ws_simple_hex(i8 signext %0) {
%2 = icmp slt i8 %0, 10
%3 = select i1 %2, i8 48, i8 87
%4 = add i8 %3, %0
ret i8 %4
}
/* Type definitions */
struct usb_bus {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct usb_bus *);
int /*<<< orphan*/ printf(char *);
void usb_free_bus(struct usb_bus *bus) {
  printf("usb_free_bus\n");
  free(bus);
}


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

x86 assembly (clang, -O2):
<usb_free_bus>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.usb_bus = type { i32 }
@str = [13 x i8] c"usb_free_bus\00"
define void @usb_free_bus(%struct.usb_bus* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @free(%struct.usb_bus* %0)
ret void
}
long long int longlongint_ignoring_unsignedlongint(long long int x,
                                                   unsigned long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_unsignedlongint(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 @longlongint_ignoring_unsignedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
int domath(int (*mathop)(int, int), int x, int y) { return (*mathop)(x, y); }


x86 assembly (clang, -O0):
<domath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<domath>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @domath(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_div_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_div_ss(__m128 A, __m128 B) { return _mm_div_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_div_ss>:
jmp    1030 <_mm_div_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_div_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_div_ss(i32 %0, i32 %1)
ret i32 %3
}
void RSA_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_flags() {
ret void
}
/* Type definitions */
typedef int useconds_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int select(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int usleep(useconds_t useconds) {
  int r;
  struct timeval tv;
  tv.tv_sec = useconds / 1000000;
  tv.tv_usec = useconds % 1000000;
  r = select(0, NULL, NULL, NULL, &tv);
  return r;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rax
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = srem i32 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %4)
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @usleep(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i32 %0, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret i32 %8
}
long __syscall5(long n, long a1, long a2, long a3, long a4, long a5) {
  unsigned long __ret;
  __asm__ __volatile__("call *%%gs:16"
                       : "=a"(__ret)
                       : "a"(n), "b"(a1), "c"(a2), "d"(a3), "S"(a4), "D"(a5)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall5>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdi
call   *%gs:0x10
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall5>:
push   %rbx
mov    %rcx,%r10
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %r9,%rdi
mov    %r8,%rsi
mov    %r10,%rdx
call   *%gs:0x10
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load i64, i64* %12
%20 = call i64 asm sideeffect "call *%gs:16", "={ax},{ax},{bx},{cx},{dx},{si},{di},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %14, i64 %15, i64 %16, i64 %17, i64 %18, i64 %19)
store i64 %20, i64* %13
%21 = load i64, i64* %13
ret i64 %21
}

LLVM IR (-O2):
define i64 @__syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i64 asm sideeffect "call *%gs:16", "={ax},{ax},{bx},{cx},{dx},{si},{di},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret i64 %7
}