xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void LCDRasterConfigSet(uint32_t ui32Base, uint32_t ui32Config,
                        uint8_t ui8PalLoadDelay) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000028))) =
      (ui32Config | ((uint32_t)ui8PalLoadDelay << 12));
}


x86 assembly (clang, -O0):
<LCDRasterConfigSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
shl    $0xc,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterConfigSet>:
shl    $0xc,%edx
or     %esi,%edx
movslq %edi,%rax
mov    %edx,0x28(%rax)
ret

LLVM IR (-O0):
define void @LCDRasterConfigSet(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32, i32* %5
%8 = load i64, i64* %6
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 12
%11 = or i32 %7, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 40
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %11, i32* %15
ret void
}

LLVM IR (-O2):
define void @LCDRasterConfigSet(i32 %0, i32 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = shl i32 %4, 12
%6 = or i32 %5, %1
%7 = add nsw i32 %0, 40
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %6, i32* %9
ret void
}
void RTAvlroGCPhysGetLeft(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPhysGetLeft() {
ret void
}
void outbyte(byte) unsigned char byte;
{
  while ((*((volatile unsigned char *)(0xf0000000 + (0x3f8 + 5))) & 0x20) ==
         0x0)
    ;
  *((volatile unsigned char *)(0xf0000000 + (0x3f8 + 0))) = byte;
  return;
}


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xf00003fd,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1125 <outbyte+0x25>
jmp    110a <outbyte+0xa>
mov    -0x1(%rbp),%cl
mov    $0xf00003f8,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
mov    $0xf00003f8,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testb  $0x20,0x5(%rax)
je     1110 <outbyte+0x10>
mov    %dil,(%rax)
ret

LLVM IR (-O0):
define void @outbyte(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
br label %4
4: ; preds = %9, %1
%5 = load volatile i8, i8* inttoptr (i64 4026532861 to i8*)
%6 = zext i8 %5 to i32
%7 = and i32 %6, 32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i8, i8* %2
store volatile i8 %11, i8* inttoptr (i64 4026532856 to i8*)
ret void
}

LLVM IR (-O2):
define void @outbyte(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 4026532861 to i8*)
%4 = and i8 %3, 32
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = trunc i32 %0 to i8
store volatile i8 %7, i8* inttoptr (i64 4026532856 to i8*)
ret void
}
/* Variables and functions */
int AreRoomsConnected(int, int);
int IsConnected(int roomIndex1, int roomIndex2) {
  if (roomIndex1 == roomIndex2) {
    return 1;
  }
  if (AreRoomsConnected(roomIndex1, roomIndex2) == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<IsConnected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1136 <IsConnected+0x26>
movl   $0x1,-0x4(%rbp)
jmp    115d <IsConnected+0x4d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <AreRoomsConnected@plt>
cmp    $0x1,%eax
jne    1156 <IsConnected+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115d <IsConnected+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsConnected>:
mov    $0x1,%eax
cmp    %esi,%edi
je     112d <IsConnected+0x1d>
push   %rax
call   1030 <AreRoomsConnected@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @IsConnected(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @AreRoomsConnected(i32 %11, i32 %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %3
br label %17
16: ; preds = %10
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @IsConnected(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @AreRoomsConnected(i32 %0, i32 %1)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 1, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ itimeofday_default(long *, long *);
void itimeofday_clock(long *sec, long *usec) { itimeofday_default(sec, usec); }


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

x86 assembly (clang, -O2):
<itimeofday_clock>:
jmp    1030 <itimeofday_default@plt>

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

LLVM IR (-O2):
define void @itimeofday_clock(i64* %0, i64* %1) {
%3 = tail call i32 @itimeofday_default(i64* %0, i64* %1)
ret void
}
/* Type definitions */
typedef uintptr_t uint32_t;

/* Variables and functions */
uint32_t ptr_tag(void *p) { return ((uintptr_t)p) & ((uintptr_t)0x3); }


x86 assembly (clang, -O0):
<ptr_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_tag>:
mov    %rdi,%rax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i64 @ptr_tag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 3
ret i64 %5
}

LLVM IR (-O2):
define i64 @ptr_tag(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 3
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (((3000 % 4 == 0) && (3000 % 100 != 0)) || (3000 % 400 == 0))
    printf("The Year is a Leap Year");
  else
    printf("The Year is Not a Leap Year");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"The Year is Not a Leap Year\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"The Year is Not a Leap Year\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void putchar_repeat(char c, int count) {
  while (count > 0) {
    putchar(c);
    count--;
  }
}


x86 assembly (clang, -O0):
<putchar_repeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1142 <putchar_repeat+0x32>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <putchar_repeat+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar_repeat>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112f <putchar_repeat+0x1f>
mov    %esi,%ebx
add    $0x1,%ebx
movsbl %dil,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <putchar_repeat+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @putchar_repeat(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8, i8* %3
%10 = call i32 @putchar(i8 signext %9)
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @putchar_repeat(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void setup_motors() { printf("Setup GPIO\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Setup GPIO\00"
define void @setup_motors() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int add(int, int /*<<< orphan*/);
int /*<<< orphan*/ get5();
int test_add() { return add(10, get5()); }


x86 assembly (clang, -O0):
<test_add>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get5@plt>
mov    %eax,%esi
mov    $0xa,%edi
call   1030 <add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_add>:
push   %rax
xor    %eax,%eax
call   1040 <get5@plt>
mov    $0xa,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <add@plt>

LLVM IR (-O0):
define i32 @test_add() {
%1 = call i32 (...) @get5()
%2 = call i32 @add(i32 10, i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_add() {
%1 = tail call i32 (...) @get5()
%2 = tail call i32 @add(i32 10, i32 %1)
ret i32 %2
}
/* Variables and functions */
int f112(int *);
int f113(int *p) { return f112(p); }


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

x86 assembly (clang, -O2):
<f113>:
jmp    1030 <f112@plt>

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

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

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


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

x86 assembly (clang, -O2):
<test_mm_cvtsi32_ss>:
jmp    1030 <_mm_cvtsi32_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtsi32_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cvtsi32_ss(i32 %0, i32 %1)
ret i32 %3
}
void I444ToARGBRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I444ToARGBRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *safe_malloc(size_t size) {
  void *ret = malloc(size);
  if (!ret) {
    fprintf(stderr, "autoupdater: error: failed to allocate memory\n");
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <safe_malloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     113d <safe_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"autoupdater: error: failed to allocate memory\0A\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"autoupdater: error: failed to allocate memory\0A\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("ddgbd");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"ddgbd\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int xorshift1024star_uint64();
double xorshift1024star_float64oo() {
  return ((double)(xorshift1024star_uint64() >> 12) + 0.5) /
         ((double)(((uint64_t)1) << 52));
}


x86 assembly (clang, -O0):
<xorshift1024star_float64oo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <xorshift1024star_uint64@plt>
sar    $0xc,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @xorshift1024star_float64oo() {
%1 = call i32 (...) @xorshift1024star_uint64()
%2 = ashr i32 %1, 12
%3 = sitofp i32 %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fdiv double %4, poison
ret double %5
}

LLVM IR (-O2):
define double @xorshift1024star_float64oo() {
%1 = tail call i32 (...) @xorshift1024star_uint64()
ret double poison
}
/* Variables and functions */
char *strchr(const char *cs, int c) {
  if (!cs) {
    return (NULL);
  }
  while ((char)c != *cs) {
    if (*cs++ == '\0') {
      return (NULL);
    }
  }
  return ((char *)cs);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <strchr+0x23>
movq   $0x0,-0x8(%rbp)
jmp    1172 <strchr+0x72>
jmp    1128 <strchr+0x28>
mov    -0x14(%rbp),%eax
movsbl %al,%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116a <strchr+0x6a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1165 <strchr+0x65>
movq   $0x0,-0x8(%rbp)
jmp    1172 <strchr+0x72>
jmp    1128 <strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
test   %rdi,%rdi
je     111f <strchr+0x1f>
mov    %rdi,%rax
movsbl %sil,%ecx
nopl   0x0(%rax)
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %dl,%dl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = shl i32 %1, 24
%6 = ashr exact i32 %5, 24
br label %7
7: ; preds = %4, %12
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %6, %10
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i8 %9, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %12, %2
%16 = phi i8* [ null, %2 ], [ %8, %7 ], [ null, %12 ]
ret i8* %16
}
void f_swap_v2(char *p, char *q) {
  char tmp = *p;
  tmp = *p;
  *p = *q;
  *q = tmp;
}


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

x86 assembly (clang, -O2):
<f_swap_v2>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @f_swap_v2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
store i8 %9, i8* %5
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
store i8 %11, i8* %12
%13 = load i8, i8* %5
%14 = load i8*, i8** %4
store i8 %13, i8* %14
ret void
}

LLVM IR (-O2):
define void @f_swap_v2(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createFloorExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x000A);
}


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

x86 assembly (clang, -O2):
<createFloorExpression>:
mov    $0xa,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createFloorExpression(%struct.memorycontainer* %0) {
%2 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %2
%3 = load %struct.memorycontainer*, %struct.memorycontainer** %2
%4 = call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %3, i32 10)
ret %struct.memorycontainer* %4
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createFloorExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 10)
ret %struct.memorycontainer* %2
}
int execute_openat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_openat() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char array[1024 * 1024 * 7] = {0};
  array[0] = 'a';
  printf("%s\n", array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x700010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x700010(%rbp),%rdi
xor    %esi,%esi
mov    $0x700000,%edx
call   1040 <memset@plt>
movb   $0x61,-0x700010(%rbp)
lea    -0x700010(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x700010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x700000,%rsp
mov    %rsp,%rbx
mov    $0x700000,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movb   $0x61,(%rsp)
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x700000,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7340032 x i8]
%2 = getelementptr inbounds [7340032 x i8], [7340032 x i8]* %1, i64 0, i64 0
store i8 97, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ gmtime(int *);
int /*<<< orphan*/ printf(char *, char *);
void right_solution() {
  time_t biggest = 0x7FFFFFFF;
  printf("biggest = %s \n", asctime(gmtime(&biggest)));
}


x86 assembly (clang, -O0):
<right_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7fffffff,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %eax,%edi
call   1030 <asctime@plt>
mov    %rax,%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_solution>:
push   %rax
movl   $0x7fffffff,0x4(%rsp)
7f
lea    0x4(%rsp),%rdi
call   1050 <gmtime@plt>
mov    %eax,%edi
call   1030 <asctime@plt>
lea    0xeaf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"biggest = %s \0A\00"
define void @right_solution() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2147483647, i32* %1
%3 = call i32 @gmtime(i32* %1)
%4 = call i8* @asctime(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ BLOCO();
int INICIO() {
  if (BLOCO()) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<INICIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <BLOCO@plt>
cmp    $0x0,%rax
je     1135 <INICIO+0x25>
movl   $0x1,-0x4(%rbp)
jmp    113c <INICIO+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INICIO>:
push   %rax
xor    %eax,%eax
call   1030 <BLOCO@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @INICIO() {
%1 = alloca i32
%2 = call i64 (...) @BLOCO()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @INICIO() {
%1 = tail call i64 (...) @BLOCO()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void label(char *s) {
  putchar('t');
  puts(s);
}


x86 assembly (clang, -O0):
<label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<label>:
push   %rbx
mov    %rdi,%rbx
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
define void @label(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @putchar(i8 signext 116)
%4 = load i8*, i8** %2
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
define void @label(i8* nocapture %0) {
%2 = tail call i32 @putchar(i8 signext 116)
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ skip_whitespace(char const **);
int read_char(const char **cursor, char character) {
  skip_whitespace(cursor);
  int success = **cursor == character;
  if (success)
    ++(*cursor);
  return success;
}


x86 assembly (clang, -O0):
<read_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <skip_whitespace@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115e <read_char+0x4e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_char>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <skip_whitespace@plt>
mov    (%rbx),%rax
mov    (%rax),%cl
cmp    %bpl,%cl
jne    112e <read_char+0x1e>
add    $0x1,%rax
mov    %rax,(%rbx)
xor    %eax,%eax
cmp    %bpl,%cl
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_char(i8** %0, i8 signext %1) {
%3 = tail call i32 @skip_whitespace(i8** %0)
%4 = load i8*, i8** %0
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %7, %2
%10 = zext i1 %6 to i32
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ child_process(scalar_t__);
scalar_t__ fork();
int /*<<< orphan*/ parent_process(scalar_t__);
int /*<<< orphan*/ printf(char *);
main() {
  pid_t fpid;
  fpid = fork();
  if (fpid < 0)
    printf("fail in fork!");
  else if (fpid == 0) {
    child_process(fpid);
  } else {
    parent_process(fpid);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1176 <main+0x36>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    119d <main+0x5d>
cmpq   $0x0,-0x10(%rbp)
jne    118f <main+0x4f>
mov    -0x10(%rbp),%rdi
call   1050 <child_process@plt>
jmp    1198 <main+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <parent_process@plt>
jmp    119d <main+0x5d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
js     1159 <main+0x19>
je     1167 <main+0x27>
mov    %rax,%rdi
call   1030 <parent_process@plt>
jmp    116e <main+0x2e>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
jmp    116e <main+0x2e>
xor    %edi,%edi
call   1050 <child_process@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"fail in fork!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %18
8: ; preds = %0
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %2
%13 = call i32 @child_process(i64 %12)
br label %17
14: ; preds = %8
%15 = load i64, i64* %2
%16 = call i32 @parent_process(i64 %15)
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %17, %6
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [14 x i8] c"fail in fork!\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
5: ; preds = %0
%6 = icmp eq i64 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @child_process(i64 0)
br label %11
9: ; preds = %5
%10 = tail call i32 @parent_process(i64 %1)
br label %11
11: ; preds = %7, %9, %3
ret i32 0
}
float BackMiniEaseOut(float p) {
  float d = 1.0;
  float b = 1;
  float c = 1;
  float s = 0.5175;
  p = p / d - 1;
  return c * (p * p * ((s + 1) * p + s)) + b;
}


x86 assembly (clang, -O0):
<BackMiniEaseOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  0xeb1(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
mulss  -0x4(%rbp),%xmm2
movss  0xe91(%rip),%xmm1
addss  -0x14(%rbp),%xmm1
movss  -0x4(%rbp),%xmm4
movss  -0x14(%rbp),%xmm3
mulss  %xmm4,%xmm1
addss  %xmm3,%xmm1
mulss  %xmm1,%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackMiniEaseOut>:
addss  0xef8(%rip),%xmm0
movaps %xmm0,%xmm1
mulss  0xef1(%rip),%xmm0
addss  0xeed(%rip),%xmm0
mulss  %xmm1,%xmm1
mulss  %xmm1,%xmm0
addss  0xee1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @BackMiniEaseOut(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.000000e+00, float* %3
store float 1.000000e+00, float* %4
store float 1.000000e+00, float* %5
store float 0x3FE08F5C20000000, float* %6
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fdiv float %7, %8
%10 = fsub float %9, 1.000000e+00
store float %10, float* %2
%11 = load float, float* %5
%12 = load float, float* %2
%13 = load float, float* %2
%14 = fmul float %12, %13
%15 = load float, float* %6
%16 = fadd float %15, 1.000000e+00
%17 = load float, float* %2
%18 = load float, float* %6
%19 = call float @llvm.fmuladd.f32(float %16, float %17, float %18)
%20 = fmul float %14, %19
%21 = load float, float* %4
%22 = call float @llvm.fmuladd.f32(float %11, float %20, float %21)
ret float %22
}

LLVM IR (-O2):
define float @BackMiniEaseOut(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, %2
%4 = tail call float @llvm.fmuladd.f32(float %2, float 0x3FF847AE00000000, float 0x3FE08F5C20000000)
%5 = fmul float %3, %4
%6 = fadd float %5, 1.000000e+00
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
#define V4L2_PIX_FMT_YUYV 128
int check_pixelformat();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_pixelformat(FILE *fd) {
  switch (check_pixelformat()) {
  case V4L2_PIX_FMT_YUYV:
    fprintf(fd, "YUYV");
    break;
  default:
    fprintf(fd,
            "Unsupported pixelformat! Please do write to the mailing list!");
    break;
  }
}


x86 assembly (clang, -O0):
<print_pixelformat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1040 <check_pixelformat@plt>
sub    $0x80,%eax
jne    1158 <print_pixelformat+0x38>
jmp    1143 <print_pixelformat+0x23>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1168 <print_pixelformat+0x48>
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pixelformat>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <check_pixelformat@plt>
cmp    $0x80,%eax
jne    1140 <print_pixelformat+0x20>
lea    0xec7(%rip),%rdi
mov    $0x4,%esi
jmp    114c <print_pixelformat+0x2c>
lea    0xebe(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"YUYV\00"
@.str.1 = [62 x i8] c"Unsupported pixelformat! Please do write to the mailing list!\00"
define void @print_pixelformat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @check_pixelformat()
switch i32 %3, label %7 [
i32 128, label %4
]
4: ; preds = %1
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"YUYV\00"
@.str.1 = [62 x i8] c"Unsupported pixelformat! Please do write to the mailing list!\00"
define void @print_pixelformat(i32* nocapture %0) {
%2 = tail call i32 (...) @check_pixelformat()
%3 = icmp eq i32 %2, 128
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
br label %8
6: ; preds = %1
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i64 61, i64 1, i32* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int i2c_read_reg(int);
int i2c_read_status() { return i2c_read_reg(4); }


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

x86 assembly (clang, -O2):
<i2c_read_status>:
mov    $0x4,%edi
jmp    1030 <i2c_read_reg@plt>

LLVM IR (-O0):
define i32 @i2c_read_status() {
%1 = call i32 @i2c_read_reg(i32 4)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c_read_status() {
%1 = tail call i32 @i2c_read_reg(i32 4)
ret i32 %1
}
int multiple_of_one_hundred(int t) { return (t % 100) == 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<multiple_of_one_hundred>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiple_of_one_hundred>:
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @multiple_of_one_hundred(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void Cyc_Absyndump_dumprgn(void *t) {
  ({ Cyc_Absyndump_dumpntyp(t); });
}


x86 assembly (clang, -O0):
<Cyc_Absyndump_dumprgn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <Cyc_Absyndump_dumpntyp@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Cyc_Absyndump_dumprgn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Absyndump_dumpntyp to i32 (i8*, ...)*)(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @Cyc_Absyndump_dumprgn(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Absyndump_dumpntyp to i32 (i8*, ...)*)(i8* %0)
ret void
}
XSetArcMode() {}


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

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

LLVM IR (-O0):
define i32 @XSetArcMode() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetArcMode() {
ret i32 undef
}
void picolcd_suspend_backlight(struct picolcd_data *data) {}


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

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

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

LLVM IR (-O2):
%struct.picolcd_data = type opaque
define void @picolcd_suspend_backlight(%struct.picolcd_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello world.\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int compare_pointers(const void *a, const void *b) {
  const char *x = *(const char *const *)a;
  const char *y = *(const char *const *)b;
  if (x > y)
    return 1;
  if (x < y)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_pointers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    113c <compare_pointers+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <compare_pointers+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1156 <compare_pointers+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <compare_pointers+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_pointers>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
cmp    %rcx,%rax
sbb    %edx,%edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_pointers(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i8**
%13 = load i8*, i8** %12
store i8* %13, i8** %7
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = icmp ugt i8* %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load i8*, i8** %6
%20 = load i8*, i8** %7
%21 = icmp ult i8* %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_pointers(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = icmp ugt i8* %4, %6
%8 = icmp ult i8* %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int omp_get_max_threads() { return 1; }


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

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

LLVM IR (-O0):
define i32 @omp_get_max_threads() {
ret i32 1
}

LLVM IR (-O2):
define i32 @omp_get_max_threads() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_path(char *);
void test_util_path_is_xxx(void) {
  test_path("util_path_example.c");
  test_path("/tmp");
  test_path("i_do_not_exist");
}


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

x86 assembly (clang, -O2):
<test_util_path_is_xxx>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <test_path@plt>
lea    0xef0(%rip),%rdi
call   1030 <test_path@plt>
lea    0xee9(%rip),%rdi
pop    %rax
jmp    1030 <test_path@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"util_path_example.c\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [15 x i8] c"i_do_not_exist\00"
define void @test_util_path_is_xxx() {
%1 = call i32 @test_path(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test_path(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @test_path(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"util_path_example.c\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [15 x i8] c"i_do_not_exist\00"
define void @test_util_path_is_xxx() {
%1 = tail call i32 @test_path(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test_path(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test_path(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StopMusic();
int /*<<< orphan*/ StopSoundExt(int, int);
void StopSounds() {
  StopMusic();
  StopSoundExt(-1, ((1 << 3) | (1 << 4)));
}


x86 assembly (clang, -O0):
<StopSounds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <StopMusic@plt>
mov    $0xffffffff,%edi
mov    $0x18,%esi
call   1040 <StopSoundExt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StopSounds>:
push   %rax
xor    %eax,%eax
call   1030 <StopMusic@plt>
mov    $0xffffffff,%edi
mov    $0x18,%esi
pop    %rax
jmp    1040 <StopSoundExt@plt>

LLVM IR (-O0):
define void @StopSounds() {
%1 = call i32 (...) @StopMusic()
%2 = call i32 @StopSoundExt(i32 -1, i32 24)
ret void
}

LLVM IR (-O2):
define void @StopSounds() {
%1 = tail call i32 (...) @StopMusic()
%2 = tail call i32 @StopSoundExt(i32 -1, i32 24)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void unlock(pthread_mutex_t *m) { pthread_mutex_unlock(m); }


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

x86 assembly (clang, -O2):
<unlock>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define void @unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret void
}
AX0I1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((((signed char *)10000000)[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movsbl (%rax,%rcx,1),%eax
cmp    $0x21,%eax
jg     1140 <AX0I1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <AX0I1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpb   $0x22,0x989680(%rcx)
setl   %al
ret

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

LLVM IR (-O2):
define i32 @AX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = icmp slt i8 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}