xunge/DecIR huggingface dataset:
int compare_ints_min(const void *a, const void *b) {
  const int *da = (const int *)a;
  const int *db = (const int *)b;
  return (*da > *db) - (*da < *db);
}


x86 assembly (clang, -O0):
<compare_ints_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints_min>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_ints_min(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
%16 = zext i1 %15 to i32
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = icmp slt i32 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @compare_ints_min(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__12__IO__makeInput();
void Msp430GpioC__11__HplGeneralIO__makeInput(void) {
  HplMsp430GeneralIOP__12__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__11__HplGeneralIO__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__12__IO__makeInput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setString(char **, char const *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void setInt(char **buf, const char *section, const char *key, int value) {
  char svalue[21];
  sprintf(svalue, "%d", value);
  setString(buf, section, key, svalue);
}


x86 assembly (clang, -O0):
<setInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1030 <setString@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setInt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %ecx,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1030 <setString@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @setInt(i8** %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [21 x i8]
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %8
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%17 = call i32 @setString(i8** %13, i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @setInt(i8** %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [21 x i8]
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = call i32 @setString(i8** %0, i8* %1, i8* %2, i8* %6)
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ nrerror(char *, int);
int *ivector(int nl, int nh) {
  int *v;
  v = (int *)malloc((unsigned)(nh - nl + 1) * sizeof(int));
  if (!v)
    nrerror("allocation failure in ivector()", 1);
  return v - nl;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <ivector+0x44>
lea    0xea6(%rip),%rdi
mov    $0x1,%esi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x4(,%rsi,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <ivector+0x2c>
lea    0xebe(%rip),%rdi
mov    $0x1,%esi
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %5
%15 = load i32*, i32** %5
%16 = icmp ne i32* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 1)
br label %19
19: ; preds = %17, %2
%20 = load i32*, i32** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds i32, i32* %20, i64 %23
ret i32* %24
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 1)
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i32*
%12 = sext i32 %0 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds i32, i32* %11, i64 %13
ret i32* %14
}
__attribute__((__no__)) void
do_nothing_big_hole_dynamic_all(struct test_big_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_big_hole_dynamic_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_big_hole_dynamic_all+0x1b>
jmp    1120 <do_nothing_big_hole_dynamic_all+0x20>
jmp    1120 <do_nothing_big_hole_dynamic_all+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_dynamic_all(%struct.test_big_hole* %0) {
%2 = alloca %struct.test_big_hole*
store %struct.test_big_hole* %0, %struct.test_big_hole** %2
%3 = load %struct.test_big_hole*, %struct.test_big_hole** %2
%4 = ptrtoint %struct.test_big_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_dynamic_all(%struct.test_big_hole* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
__attribute__((visibility("default"))) int
inet6_opt_set_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy((u_int8_t *)databuf + offset, val, vallen);
  return (offset + vallen);
}


x86 assembly (clang, -O0):
<inet6_opt_set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_set_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i32* %13, i8* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i32* %7, i8* %2, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Hell\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Hello Hell\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void TestLongDouble() {}


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

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

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

LLVM IR (-O2):
define void @TestLongDouble() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void unsafe_input() {
  char buf[16];
  printf("Enter the password: ");
  scanf("%s", buf);
}


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

x86 assembly (clang, -O2):
<unsafe_input>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter the password: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @unsafe_input() {
%1 = alloca [16 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter the password: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @unsafe_input() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ pow(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, scalar_t__);
int /*<<< orphan*/ summation(int);
scalar_t__ summation_pow(int, int);
void main() {
  printf("%lld", (long long)pow(summation(100), 2) - summation_pow(100, 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1060 <summation@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1050 <pow@plt>
mov    %rax,-0x8(%rbp)
mov    $0x64,%edi
mov    $0x2,%esi
call   1030 <summation_pow@plt>
mov    -0x8(%rbp),%rsi
sub    %rax,%rsi
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1060 <summation@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1050 <pow@plt>
mov    %rax,%rbx
mov    $0x64,%edi
mov    $0x2,%esi
call   1030 <summation_pow@plt>
sub    %rax,%rbx
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define void @main() {
%1 = call i32 @summation(i32 100)
%2 = call i64 @pow(i32 %1, i32 2)
%3 = call i64 @summation_pow(i32 100, i32 2)
%4 = sub nsw i64 %2, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define void @main() {
%1 = tail call i32 @summation(i32 100)
%2 = tail call i64 @pow(i32 %1, i32 2)
%3 = tail call i64 @summation_pow(i32 100, i32 2)
%4 = sub nsw i64 %2, %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}
int test_imm_F0int16_mem(short *val) {
  return ((*val) & (0xF0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F0int16_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, 240
%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_F0int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 240
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lkmc_print_newline() { printf("\n"); }


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

x86 assembly (clang, -O2):
<lkmc_print_newline>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @lkmc_print_newline() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int test_rr(int, int, int);
int test_rr_1_2_3(int argc, const char **argv) { return test_rr(1, 2, 3); }


x86 assembly (clang, -O0):
<test_rr_1_2_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <test_rr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rr_1_2_3>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <test_rr@plt>

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

LLVM IR (-O2):
define i32 @test_rr_1_2_3(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_rr(i32 1, i32 2, i32 3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f9(unsigned long long int s) {
  if ((unsigned short int)s == 0)
    return;
  if (s == 0)
    link_error();
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl %ax,%eax
cmp    $0x0,%eax
jne    1131 <f9+0x21>
jmp    1143 <f9+0x33>
cmpq   $0x0,-0x8(%rbp)
jne    1143 <f9+0x33>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f9(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
%5 = zext i16 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %7, %11, %8
ret void
}

LLVM IR (-O2):
define void @f9(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcstol(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                          int);
int /*<<< orphan*/ wcstoll(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                           int);
int /*<<< orphan*/ wcstoul(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                           int);
int /*<<< orphan*/ wcstoull(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                            int);
void uninitvar_wcstol(void) {
  const wchar_t *s;
  wchar_t **endp;
  int base;
  (void)wcstol(s, endp, base);
  (void)wcstoll(s, endp, base);
  (void)wcstoul(s, endp, base);
  (void)wcstoull(s, endp, base);
}


x86 assembly (clang, -O0):
<uninitvar_wcstol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <wcstol@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <wcstoll@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <wcstoul@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1060 <wcstoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wcstol>:
push   %rax
call   1030 <wcstol@plt>
call   1040 <wcstoll@plt>
call   1050 <wcstoul@plt>
pop    %rax
jmp    1060 <wcstoull@plt>

LLVM IR (-O0):
define void @uninitvar_wcstol() {
%1 = alloca i32*
%2 = alloca i32**
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i32**, i32*** %2
%6 = load i32, i32* %3
%7 = call i32 @wcstol(i32* %4, i32** %5, i32 %6)
%8 = load i32*, i32** %1
%9 = load i32**, i32*** %2
%10 = load i32, i32* %3
%11 = call i32 @wcstoll(i32* %8, i32** %9, i32 %10)
%12 = load i32*, i32** %1
%13 = load i32**, i32*** %2
%14 = load i32, i32* %3
%15 = call i32 @wcstoul(i32* %12, i32** %13, i32 %14)
%16 = load i32*, i32** %1
%17 = load i32**, i32*** %2
%18 = load i32, i32* %3
%19 = call i32 @wcstoull(i32* %16, i32** %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcstol() {
%1 = tail call i32 @wcstol(i32* undef, i32** undef, i32 undef)
%2 = tail call i32 @wcstoll(i32* undef, i32** undef, i32 undef)
%3 = tail call i32 @wcstoul(i32* undef, i32** undef, i32 undef)
%4 = tail call i32 @wcstoull(i32* undef, i32** undef, i32 undef)
ret void
}
void copy4(unsigned char *out, unsigned x) {
  out[0] = (unsigned char)(x & 0xFF);
  out[1] = (unsigned char)((x >> 8) & 0xFF);
  out[2] = (unsigned char)((x >> 16) & 0xFF);
  out[3] = (unsigned char)((x >> 24) & 0xFF);
}


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

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

LLVM IR (-O0):
define void @copy4(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = lshr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = lshr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @copy4(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
void MemManage_Handler() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<MemManage_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <MemManage_Handler+0x9>
jmp    1109 <MemManage_Handler+0x9>

x86 assembly (clang, -O2):
<MemManage_Handler>:
jmp    1100 <MemManage_Handler>

LLVM IR (-O0):
define void @MemManage_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @MemManage_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_destroy(pthread_mutex_t *mutex) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_destroy(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ConfigureBridge();
int /*<<< orphan*/ ConfigureCANInterface(int /*<<< orphan*/);
int /*<<< orphan*/ UpdaterCAN();
void AppUpdaterCAN(void) {
  ConfigureBridge();
  ConfigureCANInterface(0);
  UpdaterCAN();
}


x86 assembly (clang, -O0):
<AppUpdaterCAN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ConfigureBridge@plt>
xor    %edi,%edi
call   1050 <ConfigureCANInterface@plt>
mov    $0x0,%al
call   1040 <UpdaterCAN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AppUpdaterCAN>:
push   %rax
xor    %eax,%eax
call   1030 <ConfigureBridge@plt>
xor    %edi,%edi
call   1050 <ConfigureCANInterface@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <UpdaterCAN@plt>

LLVM IR (-O0):
define void @AppUpdaterCAN() {
%1 = call i32 (...) @ConfigureBridge()
%2 = call i32 @ConfigureCANInterface(i32 0)
%3 = call i32 (...) @UpdaterCAN()
ret void
}

LLVM IR (-O2):
define void @AppUpdaterCAN() {
%1 = tail call i32 (...) @ConfigureBridge()
%2 = tail call i32 @ConfigureCANInterface(i32 0)
%3 = tail call i32 (...) @UpdaterCAN()
ret void
}
int signum(int value) { return ((value >> 31) - (-value >> 31)); }


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
mov    %edi,%ecx
sar    $0x1f,%ecx
xor    %eax,%eax
test   %edi,%edi
setg   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @signum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = load i32, i32* %2
%6 = sub nsw i32 0, %5
%7 = ashr i32 %6, 31
%8 = sub nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @signum(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp sgt i32 %0, 0
%4 = zext i1 %3 to i32
%5 = add nsw i32 %2, %4
ret i32 %5
}
/* Variables and functions */
int strlen(char const *);
void strlen_constant1() {
  const char *a = "123";
  if (strlen(a) != 3)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strlen_constant1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
je     1135 <strlen_constant1+0x25>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strlen_constant1() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @strlen(i8* %2)
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8, i8* null
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strlen_constant1() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_2x2_soln(int, int, unsigned short, unsigned short,
                                 unsigned short, unsigned short,
                                 unsigned short *);
void find_2bit_err_pats(unsigned short s0, unsigned short s1, unsigned short r0,
                        unsigned short r1, unsigned short *pats) {
  find_2x2_soln(0x1, 0x1, r0, r1, s0, s1, pats);
}


x86 assembly (clang, -O0):
<find_2bit_err_pats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %r8,-0x10(%rbp)
mov    -0x6(%rbp),%dx
mov    -0x8(%rbp),%cx
mov    -0x2(%rbp),%r8w
mov    -0x4(%rbp),%r9w
mov    -0x10(%rbp),%rax
mov    $0x1,%esi
mov    %esi,%edi
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl %r8w,%r8d
movzwl %r9w,%r9d
mov    %rax,(%rsp)
call   1030 <find_2x2_soln@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_2bit_err_pats>:
push   %rax
mov    %esi,%r9d
mov    %edi,%eax
mov    %r8,(%rsp)
mov    $0x1,%edi
mov    $0x1,%esi
mov    %eax,%r8d
call   1030 <find_2x2_soln@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @find_2bit_err_pats(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3, i16* %4) {
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16*
store i16 %0, i16* %6
store i16 %1, i16* %7
store i16 %2, i16* %8
store i16 %3, i16* %9
store i16* %4, i16** %10
%11 = load i16, i16* %8
%12 = load i16, i16* %9
%13 = load i16, i16* %6
%14 = load i16, i16* %7
%15 = load i16*, i16** %10
%16 = call i32 @find_2x2_soln(i32 1, i32 1, i16 zeroext %11, i16 zeroext %12, i16 zeroext %13, i16 zeroext %14, i16* %15)
ret void
}

LLVM IR (-O2):
define void @find_2bit_err_pats(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3, i16* %4) {
%6 = tail call i32 @find_2x2_soln(i32 1, i32 1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %0, i16 zeroext %1, i16* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void nc_term() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @nc_term() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int open_read(char *);
int open_cwd(void) { return open_read("."); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @open_cwd() {
%1 = tail call i32 @open_read(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int f91(int N) {
  if (N <= 100)
    return (f91(f91(N + 11)));
  else
    return (N - 10);
}


x86 assembly (clang, -O0):
<f91>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     113f <f91+0x2f>
mov    -0x8(%rbp),%edi
add    $0xb,%edi
call   1030 <f91@plt>
mov    %eax,%edi
call   1030 <f91@plt>
mov    %eax,-0x4(%rbp)
jmp    1148 <f91+0x38>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f91>:
push   %rax
mov    %edi,%eax
cmp    $0x64,%edi
jg     112f <f91+0x1f>
nopl   0x0(%rax,%rax,1)
add    $0xb,%eax
mov    %eax,%edi
call   1030 <f91@plt>
cmp    $0x65,%eax
jb     1120 <f91+0x10>
add    $0xfffffff6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f91(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 11
%9 = call i32 @f91(i32 %8)
%10 = call i32 @f91(i32 %9)
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 10
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @f91(i32 %0) {
%2 = icmp slt i32 %0, 101
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, 11
%6 = tail call i32 @f91(i32 %5)
%7 = icmp ult i32 %6, 101
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = phi i32 [ %0, %1 ], [ %6, %3 ]
%10 = add nsw i32 %9, -10
ret i32 %10
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ irqtime_account_irq(struct task_struct *);
int /*<<< orphan*/ vtime_account_irq_enter(struct task_struct *);
void account_irq_enter_time(struct task_struct *tsk) {
  vtime_account_irq_enter(tsk);
  irqtime_account_irq(tsk);
}


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

x86 assembly (clang, -O2):
<account_irq_enter_time>:
push   %rbx
mov    %rdi,%rbx
call   1040 <vtime_account_irq_enter@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <irqtime_account_irq@plt>

LLVM IR (-O0):
%struct.task_struct = type { i32 }
define void @account_irq_enter_time(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
%3 = load %struct.task_struct*, %struct.task_struct** %2
%4 = call i32 @vtime_account_irq_enter(%struct.task_struct* %3)
%5 = load %struct.task_struct*, %struct.task_struct** %2
%6 = call i32 @irqtime_account_irq(%struct.task_struct* %5)
ret void
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define void @account_irq_enter_time(%struct.task_struct* %0) {
%2 = tail call i32 @vtime_account_irq_enter(%struct.task_struct* %0)
%3 = tail call i32 @irqtime_account_irq(%struct.task_struct* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  for (;;)
    ;
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void foo386(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo386(i32 %0) {
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_ins_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_ins_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_ins_wch+0x2a>
jmp    1170 <cmd_ins_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_ins_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_ins_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_ins_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
scalar_t__ iswordpart(char);
char *word_end(char *s) {
  for (; iswordpart(*s); s++)
    ;
  return s;
}


x86 assembly (clang, -O0):
<word_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <iswordpart@plt>
cmp    $0x0,%rax
je     1148 <word_end+0x38>
jmp    1137 <word_end+0x27>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <word_end+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<word_end>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <iswordpart@plt>
test   %rax,%rax
jne    1120 <word_end+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @word_end(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @iswordpart(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
main() {
  char k;
  do {
    k = getchar();
    if (k == 'q')
      printf("%c\n", k);
  } while (k != 'q');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    1156 <main+0x36>
lea    0xeb3(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    115b <main+0x3b>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x71,%al
jne    1130 <main+0x10>
lea    0xebe(%rip),%rdi
mov    $0x71,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 113
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 113)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lo_immu_en();
void immu_enable(void) { lo_immu_en(); }


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

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

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

LLVM IR (-O2):
define void @immu_enable() {
%1 = tail call i32 (...) @lo_immu_en()
ret void
}
int do_719() { return 719; }


x86 assembly (clang, -O0):
<do_719>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2cf,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_719() {
ret i32 719
}

LLVM IR (-O2):
define i32 @do_719() {
ret i32 719
}
/* Type definitions */
struct test116_C1 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ test116_C1_C1_get__E(struct test116_C1 *);
void test116_ArrayInitBug_test__I(struct test116_C1 *c) {
  test116_C1_C1_get__E(c);
}


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

x86 assembly (clang, -O2):
<test116_ArrayInitBug_test__I>:
jmp    1030 <test116_C1_C1_get__E@plt>

LLVM IR (-O0):
%struct.test116_C1 = type { i32 }
define void @test116_ArrayInitBug_test__I(%struct.test116_C1* %0) {
%2 = alloca %struct.test116_C1*
store %struct.test116_C1* %0, %struct.test116_C1** %2
%3 = load %struct.test116_C1*, %struct.test116_C1** %2
%4 = call i32 @test116_C1_C1_get__E(%struct.test116_C1* %3)
ret void
}

LLVM IR (-O2):
%struct.test116_C1 = type { i32 }
define void @test116_ArrayInitBug_test__I(%struct.test116_C1* %0) {
%2 = tail call i32 @test116_C1_C1_get__E(%struct.test116_C1* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void example_hello(void) { printf("An example hello!\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"An example hello!\00"
define void @example_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_9Aint64_midword_reg(long long val) {
  return ((val >> 16) & (0x9A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Aint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10092544
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int findMissing(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {1, 2, 3, 4, 6, 7, 5, 8, 10};
  int n = findMissing(a, sizeof(a) / sizeof(int));
  printf("Number missing array : %d \n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <findMissing@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <findMissing@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 6, i32 7, i32 5, i32 8, i32 10]
@.str = [28 x i8] c"Number missing array : %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x i32]* %2 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%6 = call i32 @findMissing(i32* %5, i32 9)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 6, i32 7, i32 5, i32 8, i32 10]
@.str = [28 x i8] c"Number missing array : %d \0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @findMissing(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *pad(char *string, int length) {
  int l;
  l = strlen(string);
  while (l < length) {
    string[l] = ' ';
    l++;
  }
  string[l] = '\0';
  return string;
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <pad+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <pad+0x1b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rdx
cmp    %ebp,%eax
jge    114d <pad+0x2d>
lea    (%rbx,%rdx,1),%rdi
not    %edx
add    %ebp,%edx
add    $0x1,%rdx
mov    $0x20,%esi
call   1040 <memset@plt>
movslq %ebp,%rdx
movb   $0x0,(%rbx,%rdx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @pad(i8* returned %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, %1
%5 = sext i32 %3 to i64
br i1 %4, label %6, label %13
6: ; preds = %2
%7 = getelementptr i8, i8* %0, i64 %5
%8 = xor i32 %3, -1
%9 = add i32 %8, %1
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
%12 = sext i32 %1 to i64
br label %13
13: ; preds = %6, %2
%14 = phi i64 [ %5, %2 ], [ %12, %6 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}