xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ example1();
int /*<<< orphan*/ example2();
int /*<<< orphan*/ example3();
int /*<<< orphan*/ example4();
int /*<<< orphan*/ example4a();
int /*<<< orphan*/ example4b();
int /*<<< orphan*/ example4c();
int /*<<< orphan*/ example5();
int /*<<< orphan*/ example6();
int /*<<< orphan*/ example7();
int /*<<< orphan*/ example8();
int /*<<< orphan*/ mineEx1();
void main(void) {
  example1();
  example2();
  example3();
  example4();
  example4a();
  example4b();
  example4c();
  example5();
  example6();
  example7();
  example8();
  mineEx1();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10c0 <example1@plt>
mov    $0x0,%al
call   1070 <example2@plt>
mov    $0x0,%al
call   10d0 <example3@plt>
mov    $0x0,%al
call   1050 <example4@plt>
mov    $0x0,%al
call   10e0 <example4a@plt>
mov    $0x0,%al
call   1090 <example4b@plt>
mov    $0x0,%al
call   1030 <example4c@plt>
mov    $0x0,%al
call   10a0 <example5@plt>
mov    $0x0,%al
call   1060 <example6@plt>
mov    $0x0,%al
call   10b0 <example7@plt>
mov    $0x0,%al
call   1040 <example8@plt>
mov    $0x0,%al
call   1080 <mineEx1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10c0 <example1@plt>
xor    %eax,%eax
call   1070 <example2@plt>
xor    %eax,%eax
call   10d0 <example3@plt>
xor    %eax,%eax
call   1050 <example4@plt>
xor    %eax,%eax
call   10e0 <example4a@plt>
xor    %eax,%eax
call   1090 <example4b@plt>
xor    %eax,%eax
call   1030 <example4c@plt>
xor    %eax,%eax
call   10a0 <example5@plt>
xor    %eax,%eax
call   1060 <example6@plt>
xor    %eax,%eax
call   10b0 <example7@plt>
xor    %eax,%eax
call   1040 <example8@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <mineEx1@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @example1()
%2 = call i32 (...) @example2()
%3 = call i32 (...) @example3()
%4 = call i32 (...) @example4()
%5 = call i32 (...) @example4a()
%6 = call i32 (...) @example4b()
%7 = call i32 (...) @example4c()
%8 = call i32 (...) @example5()
%9 = call i32 (...) @example6()
%10 = call i32 (...) @example7()
%11 = call i32 (...) @example8()
%12 = call i32 (...) @mineEx1()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @example1()
%2 = tail call i32 (...) @example2()
%3 = tail call i32 (...) @example3()
%4 = tail call i32 (...) @example4()
%5 = tail call i32 (...) @example4a()
%6 = tail call i32 (...) @example4b()
%7 = tail call i32 (...) @example4c()
%8 = tail call i32 (...) @example5()
%9 = tail call i32 (...) @example6()
%10 = tail call i32 (...) @example7()
%11 = tail call i32 (...) @example8()
%12 = tail call i32 (...) @mineEx1()
ret void
}
int main() { return 0UL < 0UL; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ toy_library_hello();
int main() {
  toy_library_hello();
  int a = __VERIFIER_nondet_int();
  if (a == 0) {
    printf("a is zero\n");
  } else {
    printf("a is non-zero\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <toy_library_hello@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    116b <main+0x3b>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <main+0x47>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <toy_library_hello@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
lea    0xec6(%rip),%rax
lea    0xeb1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a is zero\0A\00"
@.str.1 = [15 x i8] c"a is non-zero\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @toy_library_hello()
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"a is non-zero\00"
@str.2 = [10 x i8] c"a is zero\00"
define i32 @main() {
%1 = tail call i32 (...) @toy_library_hello()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
unsigned int strlen(char *str) {
  unsigned int i;
  for (i = 0; (!(str[i] == 0)) || (i > 0x10000); i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    1135 <strlen+0x35>
cmpl   $0x10000,-0xc(%rbp)
seta   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1145 <strlen+0x45>
jmp    1158 <strlen+0x58>
jmp    114a <strlen+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %10, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ugt i32 %3, 65536
%9 = select i1 %7, i1 true, i1 %8
%10 = add i32 %3, 1
br i1 %9, label %2, label %11
11: ; preds = %2
ret i32 %3
}
/* Type definitions */
struct timespec {
  unsigned long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int EINTR;
int nanosleep(struct timespec *, struct timespec *);
void n_sleep(unsigned long t) {
  struct timespec sl;
  int ret;
  sl.tv_sec = 0;
  sl.tv_nsec = t;
  while (1) {
    ret = nanosleep(&sl, &sl);
    if (!ret)
      return;
    else if (ret == EINTR)
      continue;
  }
}


x86 assembly (clang, -O0):
<n_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <nanosleep@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    114b <n_sleep+0x3b>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x1c(%rbp),%eax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%eax
jne    1162 <n_sleep+0x52>
jmp    112c <n_sleep+0x1c>
jmp    1167 <n_sleep+0x57>
jmp    112c <n_sleep+0x1c>

x86 assembly (clang, -O2):
<n_sleep>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
mov    %rdi,(%rsp)
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <nanosleep@plt>
test   %eax,%eax
jne    1130 <n_sleep+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@EINTR = global i32 0
define void @n_sleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
%4 = alloca i32
store i64 %0, i64* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %5
%6 = load i64, i64* %2
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %6, i64* %7
br label %8
8: ; preds = %1, %17, %19
%9 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %3)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
ret void
13: ; preds = %8
%14 = load i32, i32* %4
%15 = load i32, i32* @EINTR
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
br label %8
18: ; preds = %13
br label %19
19: ; preds = %18
br label %8
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@EINTR = global i32 0
define void @n_sleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %0, i64* %5
br label %6
6: ; preds = %6, %1
%7 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %6
9: ; preds = %6
ret void
}
double PAWFeetToMeters(double feet) { return feet * 0.3048; }


x86 assembly (clang, -O0):
<PAWFeetToMeters>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @PAWFeetToMeters(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.048000e-01
ret double %4
}

LLVM IR (-O2):
define double @PAWFeetToMeters(double %0) {
%2 = fmul double %0, 3.048000e-01
ret double %2
}
int foo2() { return 10; }


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

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

LLVM IR (-O0):
define i32 @foo2() {
ret i32 10
}

LLVM IR (-O2):
define i32 @foo2() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x19() {
  Assert_real((isascii(25)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              130, ("isascii should be 1 for 0x19"));
}


x86 assembly (clang, -O0):
<t_isascii_0x19>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x82,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x19>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x82,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x19\00"
define void @t_isascii_0x19() {
%1 = call i32 @isascii(i32 25)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x19\00"
define void @t_isascii_0x19() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ drawScene();
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ selectObjects();
void display(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  drawScene();
  selectObjects();
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    0x2e73(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1070 <drawScene@plt>
mov    $0x0,%al
call   1040 <selectObjects@plt>
mov    $0x0,%al
call   1060 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e6f(%rip),%rax
mov    0x2e78(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1070 <drawScene@plt>
xor    %eax,%eax
call   1040 <selectObjects@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%4 = or i32 %2, %3
%5 = call i32 @glClear(i32 %4)
%6 = call i32 (...) @drawScene()
%7 = call i32 (...) @selectObjects()
%8 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%4 = or i32 %3, %2
%5 = tail call i32 @glClear(i32 %4)
%6 = tail call i32 (...) @drawScene()
%7 = tail call i32 (...) @selectObjects()
%8 = tail call i32 (...) @glFlush()
ret void
}
void test_Struct3(void) {}


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

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

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

LLVM IR (-O2):
define void @test_Struct3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_word(unsigned char, int, unsigned char);
void setCCWComplianceMargin(unsigned char id, unsigned char margin) {
  dxl_write_word(id, (27), margin);
}


x86 assembly (clang, -O0):
<setCCWComplianceMargin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x1b,%esi
movzbl %al,%edi
movzbl -0x2(%rbp),%edx
call   1030 <dxl_write_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCCWComplianceMargin>:
mov    %esi,%edx
mov    $0x1b,%esi
jmp    1030 <dxl_write_word@plt>

LLVM IR (-O0):
define void @setCCWComplianceMargin(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @dxl_write_word(i8 zeroext %5, i32 27, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @setCCWComplianceMargin(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @dxl_write_word(i8 zeroext %0, i32 27, i8 zeroext %1)
ret void
}
double get_cpu_time() { return -1.0; }


x86 assembly (clang, -O0):
<get_cpu_time>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @get_cpu_time() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @get_cpu_time() {
ret double -1.000000e+00
}
void bar() {
  static int funclocal = 4;
  static int funclocal_bss;
  funclocal_bss = 104;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x68,0x2f1a(%rip)
pop    %rbp
ret

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

LLVM IR (-O0):
@bar.funclocal = internal global i32 4
@bar.funclocal_bss = internal global i32 0
define void @bar() {
store i32 104, i32* @bar.funclocal_bss
ret void
}

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Type definitions */
struct jx {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
struct jx *jx_parse_stream(int /*<<< orphan*/ *);
struct jx *jx_parse_file(const char *name) {
  FILE *file = fopen(name, "r");
  if (!file)
    return 0;
  struct jx *j = jx_parse_stream(file);
  fclose(file);
  return j;
}


x86 assembly (clang, -O0):
<jx_parse_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <jx_parse_file+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1186 <jx_parse_file+0x56>
mov    -0x18(%rbp),%rdi
call   1050 <jx_parse_stream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jx_parse_file>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1160 <jx_parse_file+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <jx_parse_stream@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
jmp    1162 <jx_parse_file+0x32>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.jx = type { i32 }
@.str = [2 x i8] c"r\00"
define %struct.jx* @jx_parse_file(i8* %0) {
%2 = alloca %struct.jx*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.jx*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store %struct.jx* null, %struct.jx** %2
br label %17
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call %struct.jx* @jx_parse_stream(i32* %12)
store %struct.jx* %13, %struct.jx** %5
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load %struct.jx*, %struct.jx** %5
store %struct.jx* %16, %struct.jx** %2
br label %17
17: ; preds = %11, %10
%18 = load %struct.jx*, %struct.jx** %2
ret %struct.jx* %18
}

LLVM IR (-O2):
%struct.jx = type { i32 }
@.str = [2 x i8] c"r\00"
define %struct.jx* @jx_parse_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call %struct.jx* @jx_parse_stream(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi %struct.jx* [ %5, %4 ], [ null, %1 ]
ret %struct.jx* %8
}
void I444ToARGBRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I444ToARGBRow_SSSE3() {
ret void
}
int SubtractNumbers(int number_1, int number_2) {
  int result = 0;
  result = number_1 - number_2;
  return result;
}


x86 assembly (clang, -O0):
<SubtractNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubtractNumbers>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @SubtractNumbers(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *alloc(size_t size) {
  if (size == 0) {
    return NULL;
  }
  void *buf = malloc(size);
  if (buf == NULL) {
    fprintf(stderr, "Allocation failed: 0x%zx bytes\n", size);
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <alloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1197 <alloc+0x67>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118f <alloc+0x5f>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe80(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rbx
test   %rdi,%rdi
je     1145 <alloc+0x15>
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1149 <alloc+0x19>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Allocation failed: 0x%zx bytes\0A\00"
define i8* @alloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %20
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = load i64, i64* %3
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %8
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Allocation failed: 0x%zx bytes\0A\00"
define noalias i8* @alloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3, %1
%11 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %11
}
void kmap_flush_unused(void) {}


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

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

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

LLVM IR (-O2):
define void @kmap_flush_unused() {
ret void
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n) {
  size_t i;
  for (i = 0; i < n; ++i) {
    if (s[i] == c)
      return (wchar_t *)&s[i];
  }
  return NULL;
}


x86 assembly (clang, -O0):
<wmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    116a <wmemchr+0x6a>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x18(%rbp),%rax
jne    1154 <wmemchr+0x54>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <wmemchr+0x72>
jmp    1159 <wmemchr+0x59>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <wmemchr+0x18>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmemchr>:
test   %rdx,%rdx
je     111f <wmemchr+0x1f>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %rsi,(%rax)
je     1121 <wmemchr+0x21>
add    $0x8,%rax
add    $0xffffffffffffffff,%rdx
jne    1110 <wmemchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @wmemchr(i64* %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %10
%6 = phi i64 [ %11, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, %1
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %15, label %5
13: ; preds = %5
%14 = getelementptr inbounds i64, i64* %0, i64 %6
br label %15
15: ; preds = %10, %13, %3
%16 = phi i64* [ null, %3 ], [ %14, %13 ], [ null, %10 ]
ret i64* %16
}
void flip(int *array, int array_index) {
  int index_begin, temp;
  for (index_begin = 0; index_begin < array_index;
       array_index--, index_begin++) {
    temp = array[index_begin];
    array[index_begin] = array[array_index];
    array[array_index] = temp;
  }
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <flip+0x67>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <flip+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
test   %esi,%esi
jle    112e <flip+0x2e>
mov    %esi,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    (%rdi,%rcx,4),%edx
mov    0x4(%rdi,%rax,4),%esi
mov    %esi,(%rdi,%rcx,4)
mov    %edx,0x4(%rdi,%rax,4)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <flip+0x10>
ret

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

LLVM IR (-O2):
define void @flip(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %14, %6 ]
%8 = phi i64 [ %5, %4 ], [ %13, %6 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 %8
%12 = load i32, i32* %11
store i32 %12, i32* %9
store i32 %10, i32* %11
%13 = add nsw i64 %8, -1
%14 = add nuw nsw i64 %7, 1
%15 = icmp slt i64 %14, %13
br i1 %15, label %6, label %16
16: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void shrd_reg32_reg32_cl(unsigned long reg1, unsigned long reg2) {
  put8(0x0F);
  put8(0xAD);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<shrd_reg32_reg32_cl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xad,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
or     $0xc0,%rax
or     -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrd_reg32_reg32_cl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xad,%edi
call   1030 <put8@plt>
shl    $0x3,%r14d
or     %r14d,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shrd_reg32_reg32_cl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @put8(i32 15)
%6 = call i32 @put8(i32 173)
%7 = load i64, i64* %4
%8 = shl i64 %7, 3
%9 = or i64 192, %8
%10 = load i64, i64* %3
%11 = or i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @put8(i32 %12)
ret void
}

LLVM IR (-O2):
define void @shrd_reg32_reg32_cl(i64 %0, i64 %1) {
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 173)
%5 = shl i64 %1, 3
%6 = or i64 %5, %0
%7 = trunc i64 %6 to i32
%8 = or i32 %7, 192
%9 = tail call i32 @put8(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ charIn(char *, int);
char *malloc(int);
int /*<<< orphan*/ palindrome(char *);
int /*<<< orphan*/ printf(char *);
void ex4() {
  char *word = malloc(100);
  printf("Digite uma palavra: ");
  charIn(word, 100);
  palindrome(word);
}


x86 assembly (clang, -O0):
<ex4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x64,%esi
call   1030 <charIn@plt>
mov    -0x8(%rbp),%rdi
call   1050 <palindrome@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex4>:
push   %rbx
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <charIn@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <palindrome@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Digite uma palavra: \00"
define void @ex4() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @charIn(i8* %4, i32 100)
%6 = load i8*, i8** %1
%7 = call i32 @palindrome(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Digite uma palavra: \00"
define void @ex4() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @charIn(i8* %1, i32 100)
%4 = tail call i32 @palindrome(i8* %1)
ret void
}
int test_imm_1Bint64_highword_reg(long long val) {
  return ((val >> 32) & (0x1B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Bint64_highword_reg>:
movabs $0x1b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Bint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 27
%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_1Bint64_highword_reg(i64 %0) {
%2 = and i64 %0, 115964116992
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ redraw_map_sub(int);
void redraw_map_force(void) { redraw_map_sub(1); }


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

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

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

LLVM IR (-O2):
define void @redraw_map_force() {
%1 = tail call i32 @redraw_map_sub(i32 1)
ret void
}
int main(int argc, char **argv) { return argv[0][0]; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rax
movsbl (%rax),%eax
ret

LLVM IR (-O0):
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}
void omap_die_governor_register_pdata(
    struct omap_die_governor_pdata *omap_gov) {}


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

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

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

LLVM IR (-O2):
%struct.omap_die_governor_pdata = type opaque
define void @omap_die_governor_register_pdata(%struct.omap_die_governor_pdata* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *sdup(const char *str) {
  char *p;
  if ((p = (char *)malloc(strlen(str) + 1)) != NULL) {
    strcpy(p, str);
  }
  return p;
}


x86 assembly (clang, -O0):
<sdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116c <sdup+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <sdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @sdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void apic_info(void) {}


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

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

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

LLVM IR (-O2):
define void @apic_info() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  int t;
  assume(x != y && y == t);
  while (1) {
    if (x > 0)
      y = y + x;
    assert(y >= t);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
je     114c <main+0x2c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0x8(%rbp)
jle    116c <main+0x4c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1159 <main+0x39>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp eq i32 %9, %10
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assume(i32 %14)
br label %16
16: ; preds = %12, %23
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = add nsw i32 %20, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %19, %16
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = icmp sge i32 %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
br label %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @assert(i32 1)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_num(int n) { printf("%d", n); }


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

x86 assembly (clang, -O2):
<print_num>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_num(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int __darwintrace_strbeginswith(const char *str, const char *prefix) {
  char theCharS;
  char theCharP;
  do {
    theCharS = *str++;
    theCharP = *prefix++;
  } while (theCharP && (theCharP == theCharS));
  return (theCharP == 0);
}


x86 assembly (clang, -O0):
<__darwintrace_strbeginswith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x13(%rbp)
je     1156 <__darwintrace_strbeginswith+0x56>
movsbl -0x12(%rbp),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
test   $0x1,%al
jne    110c <__darwintrace_strbeginswith+0xc>
movsbl -0x12(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__darwintrace_strbeginswith>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1124 <__darwintrace_strbeginswith+0x24>
lea    0x1(%rax),%rdx
cmp    (%rdi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <__darwintrace_strbeginswith+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @__darwintrace_strbeginswith(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %8, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %4
%10 = icmp ne i8 %9, 0
%11 = icmp eq i8 %9, %7
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = icmp eq i8 %9, 0
%15 = zext i1 %14 to i32
ret i32 %15
}
__attribute__((section(".after_vectors"))) void SVC_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
void reset_reqs(short rlen, short *rb) {
  short count;
  for (count = 0; count < rlen; count++) {
    rb[count] = 0;
  }
}


x86 assembly (clang, -O0):
<reset_reqs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1145 <reset_reqs+0x45>
mov    -0x10(%rbp),%rax
movswq -0x12(%rbp),%rcx
movw   $0x0,(%rax,%rcx,2)
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1115 <reset_reqs+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_reqs>:
test   %di,%di
jle    112a <reset_reqs+0x1a>
push   %rax
movzwl %di,%edx
add    %rdx,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @reset_reqs(i16 signext %0, i16* nocapture writeonly %1) {
%3 = icmp sgt i16 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i16* %1 to i8*
%6 = zext i16 %0 to i64
%7 = shl nuw nsw i64 %6, 1
br label %8
8: ; preds = %4, %2
ret void
}
void atomic_thread_fence(memory_order_acquire_t) {
  __asm__ __volatile__("" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @atomic_thread_fence(i32 %0) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void internal4(void) {}


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

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

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

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