xunge/DecIR huggingface dataset:
int test_imm_6Fuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x6F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Fuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 111
%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_6Fuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7274496
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SA1AbsoluteLongIndexedX(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op9FM0(void) { STA16(SA1AbsoluteLongIndexedX(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op9FM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1AbsoluteLongIndexedX@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9FM0>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1AbsoluteLongIndexedX@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op9FM0() {
%1 = call i32 @SA1AbsoluteLongIndexedX(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op9FM0() {
%1 = tail call i32 @SA1AbsoluteLongIndexedX(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}
__attribute__((always_)) __attribute__((const)) _Bool
is_power_of_2(unsigned long n) {
  return (n != 0 && ((n & (n - 1)) == 0));
}


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1131 <is_power_of_2+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %rdi,%rdi
je     1110 <is_power_of_2+0x10>
lea    -0x1(%rdi),%rax
test   %rax,%rdi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i1 @is_power_of_2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
%10 = icmp eq i64 %9, 0
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
ret i1 %12
}

LLVM IR (-O2):
define zeroext i1 @is_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
br label %6
6: ; preds = %3, %1
%7 = phi i1 [ false, %1 ], [ %5, %3 ]
ret i1 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int _vprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vprintf(const char *fmt, va_list arp) {
  int i;
  i = _vprintf(INT_MAX, fmt, arp);
  return i;
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <_vprintf@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_vprintf@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* @INT_MAX
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @_vprintf(i32 %6, i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i32 @_vprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *s) {
  printf("Audioplay V1.0 - OSS pcm playback tool\n"
         "Usage: %s <pcmfile> <format> <speed> <channels>\n"
         "\tformat: u8,ube16,ule16,s8,sbe16,sle16\n"
         "\tspeed: 8000,11025,12000,16000,22050\n\t\t24000,32000,44100,48000\n"
         "\tchannels: 1 or 2\n\n",
         s);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [209 x i8] c"Audioplay V1.0 - OSS pcm playback tool\0AUsage: %s <pcmfile> <format> <speed> <channels>\0A\09format: u8,ube16,ule16,s8,sbe16,sle16\0A\09speed: 8000,11025,12000,16000,22050\0A\09\0924000,32000,44100,48000\0A\09channels: 1 or 2\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [209 x i8] c"Audioplay V1.0 - OSS pcm playback tool\0AUsage: %s <pcmfile> <format> <speed> <channels>\0A\09format: u8,ube16,ule16,s8,sbe16,sle16\0A\09speed: 8000,11025,12000,16000,22050\0A\09\0924000,32000,44100,48000\0A\09channels: 1 or 2\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int A;
  scanf("%d", &A);
  printf("%d", check_prime(A));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <check_prime@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <check_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @check_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int foo(register a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *allocateString(char *str) {
  char *k;
  k = malloc(strlen(str) + 1);
  strcpy(k, str);
  return k;
}


x86 assembly (clang, -O0):
<allocateString>:
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)
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):
<allocateString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @allocateString(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 i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @allocateString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int test_imm_8Eint64_lowword_reg(long long val) {
  return ((val) & (0x8E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Eint64_lowword_reg>:
test   $0x8e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 142
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void write_es(unsigned val) {
  asm volatile("mov %0, %%es" : : "rm"(val) : "memory");
}


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

x86 assembly (clang, -O2):
<write_es>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%es
ret

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

LLVM IR (-O2):
define void @write_es(i32 %0) {
tail call void asm sideeffect "mov $0, %es", "rm,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
int char_pathsep(unsigned char c) {
  if (c == '/' || c == '\\')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<char_pathsep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     1124 <char_pathsep+0x24>
movzbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    1130 <char_pathsep+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <char_pathsep+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_pathsep>:
cmp    $0x5c,%dil
sete   %al
cmp    $0x2f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @char_pathsep(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 47
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 92
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @char_pathsep(i8 zeroext %0) {
%2 = icmp eq i8 %0, 92
%3 = icmp eq i8 %0, 47
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void ws_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @ws_shutdown() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_sub_d(int /*<<< orphan*/, int /*<<< orphan*/, double,
                              int);
void mpfrsubd(mpfr_t r2, mpfr_t r1, double *d, mpfr_rnd_t *irnd) {
  double d1;
  int n1;
  d1 = *d;
  n1 = *irnd;
  mpfr_sub_d(r2, r1, d1, n1);
}


x86 assembly (clang, -O0):
<mpfrsubd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%edx
call   1030 <mpfr_sub_d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfrsubd>:
movsd  (%rdx),%xmm0
mov    (%rcx),%edx
jmp    1030 <mpfr_sub_d@plt>

LLVM IR (-O0):
define void @mpfrsubd(i32 %0, i32 %1, double* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32*
%9 = alloca double
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32* %3, i32** %8
%11 = load double*, double** %7
%12 = load double, double* %11
store double %12, double* %9
%13 = load i32*, i32** %8
%14 = load i32, i32* %13
store i32 %14, i32* %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load double, double* %9
%18 = load i32, i32* %10
%19 = call i32 @mpfr_sub_d(i32 %15, i32 %16, double %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @mpfrsubd(i32 %0, i32 %1, double* nocapture %2, i32* nocapture %3) {
%5 = load double, double* %2
%6 = load i32, i32* %3
%7 = tail call i32 @mpfr_sub_d(i32 %0, i32 %1, double %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clock0();
int /*<<< orphan*/ clock1();
int /*<<< orphan*/ dataA0();
int /*<<< orphan*/ dataA1();
int /*<<< orphan*/ dataB0();
int /*<<< orphan*/ dataB1();
int /*<<< orphan*/ dataToOutput();
int /*<<< orphan*/ delay();
int /*<<< orphan*/ waitBusy();
void end(void) {
  waitBusy();
  dataToOutput();
  clock0();
  delay();
  dataA0();
  dataB0();
  delay();
  clock1();
  delay();
  delay();
  dataA1();
  dataB1();
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <waitBusy@plt>
mov    $0x0,%al
call   10b0 <dataToOutput@plt>
mov    $0x0,%al
call   1050 <clock0@plt>
mov    $0x0,%al
call   1070 <delay@plt>
mov    $0x0,%al
call   1060 <dataA0@plt>
mov    $0x0,%al
call   1080 <dataB0@plt>
mov    $0x0,%al
call   1070 <delay@plt>
mov    $0x0,%al
call   1090 <clock1@plt>
mov    $0x0,%al
call   1070 <delay@plt>
mov    $0x0,%al
call   1070 <delay@plt>
mov    $0x0,%al
call   10a0 <dataA1@plt>
mov    $0x0,%al
call   1040 <dataB1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end>:
push   %rax
xor    %eax,%eax
call   1030 <waitBusy@plt>
xor    %eax,%eax
call   10b0 <dataToOutput@plt>
xor    %eax,%eax
call   1050 <clock0@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1060 <dataA0@plt>
xor    %eax,%eax
call   1080 <dataB0@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1090 <clock1@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   1070 <delay@plt>
xor    %eax,%eax
call   10a0 <dataA1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <dataB1@plt>

LLVM IR (-O0):
define void @end() {
%1 = call i32 (...) @waitBusy()
%2 = call i32 (...) @dataToOutput()
%3 = call i32 (...) @clock0()
%4 = call i32 (...) @delay()
%5 = call i32 (...) @dataA0()
%6 = call i32 (...) @dataB0()
%7 = call i32 (...) @delay()
%8 = call i32 (...) @clock1()
%9 = call i32 (...) @delay()
%10 = call i32 (...) @delay()
%11 = call i32 (...) @dataA1()
%12 = call i32 (...) @dataB1()
ret void
}

LLVM IR (-O2):
define void @end() {
%1 = tail call i32 (...) @waitBusy()
%2 = tail call i32 (...) @dataToOutput()
%3 = tail call i32 (...) @clock0()
%4 = tail call i32 (...) @delay()
%5 = tail call i32 (...) @dataA0()
%6 = tail call i32 (...) @dataB0()
%7 = tail call i32 (...) @delay()
%8 = tail call i32 (...) @clock1()
%9 = tail call i32 (...) @delay()
%10 = tail call i32 (...) @delay()
%11 = tail call i32 (...) @dataA1()
%12 = tail call i32 (...) @dataB1()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint16_t load16(const void *ptr) {
  uint16_t v;
  memcpy(&v, ptr, sizeof v);
  return v;
}


x86 assembly (clang, -O0):
<load16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @load16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void gtk_widget_get_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_screen() {
ret void
}
float green(float value) {
  if (value < 0.25f)
    return value * 4.f;
  else if (value > 0.75f)
    return 1 - ((value - 0.75f) * 4.f);
  return 1.f;
}


x86 assembly (clang, -O0):
<green>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <green+0x32>
movss  0xee9(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119a <green+0x9a>
movss  -0x8(%rbp),%xmm0
movss  0xec5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1188 <green+0x88>
movss  -0x8(%rbp),%xmm0
movss  0xeaf(%rip),%xmm1
subss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe9e(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe8e(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119a <green+0x9a>
jmp    118d <green+0x8d>
movss  0xe73(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<green>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1116 <green+0x16>
mulss  0xeff(%rip),%xmm0
ret
ucomiss 0xeeb(%rip),%xmm0
jbe    1138 <green+0x38>
addss  0xee5(%rip),%xmm0
mulss  0xee1(%rip),%xmm0
addss  0xecd(%rip),%xmm0
ret
movss  0xec4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @green(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 2.500000e-01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fmul float %7, 4.000000e+00
store float %8, float* %2
br label %19
9: ; preds = %1
%10 = load float, float* %3
%11 = fcmp ogt float %10, 7.500000e-01
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load float, float* %3
%14 = fsub float %13, 7.500000e-01
%15 = fneg float %14
%16 = call float @llvm.fmuladd.f32(float %15, float 4.000000e+00, float 1.000000e+00)
store float %16, float* %2
br label %19
17: ; preds = %9
br label %18
18: ; preds = %17
store float 1.000000e+00, float* %2
br label %19
19: ; preds = %18, %12, %6
%20 = load float, float* %2
ret float %20
}

LLVM IR (-O2):
define float @green(float %0) {
%2 = fcmp olt float %0, 2.500000e-01
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fmul float %0, 4.000000e+00
br label %11
5: ; preds = %1
%6 = fcmp ogt float %0, 7.500000e-01
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = fadd float %0, -7.500000e-01
%9 = fneg float %8
%10 = tail call float @llvm.fmuladd.f32(float %9, float 4.000000e+00, float 1.000000e+00)
br label %11
11: ; preds = %5, %7, %3
%12 = phi float [ %4, %3 ], [ %10, %7 ], [ 1.000000e+00, %5 ]
ret float %12
}
int streq(char str1[], char str2[]) {
  int k;
  k = 0;
  while (str2[k]) {
    if ((str1[k] != str2[k]))
      return (0);
    k++;
  }
  return (k);
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115f <streq+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1151 <streq+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1165 <streq+0x65>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <streq+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <streq+0x24>
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    %cl,(%rdi,%rdx,1)
jne    1124 <streq+0x24>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <streq+0x10>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @streq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %11
%6 = phi i64 [ %12, %11 ], [ 0, %2 ]
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %7
br i1 %10, label %11, label %18
11: ; preds = %5
%12 = add nuw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11
%17 = trunc i64 %12 to i32
br label %18
18: ; preds = %5, %16, %2
%19 = phi i32 [ 0, %2 ], [ %17, %16 ], [ 0, %5 ]
ret i32 %19
}
int event_init_platform(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @event_init_platform() {
ret i32 0
}
void exit(int status) { asm("int %2" : : "a"(0), "b"(status), "i"(0x80)); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
xor    %eax,%eax
int    $0x80

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
int    $0x80

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

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void asm sideeffect "int $2", "{ax},{bx},i,~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %0, i32 128)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(size_t);
void *_cmsMalloc(size_t size) {
  if (size > ((size_t)1024 * 1024 * 500))
    return NULL;
  if (size < 0)
    return NULL;
  return (void *)malloc(size);
}


x86 assembly (clang, -O0):
<_cmsMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1f400000,-0x10(%rbp)
1f
jbe    1137 <_cmsMalloc+0x27>
movq   $0x0,-0x8(%rbp)
jmp    115c <_cmsMalloc+0x4c>
cmpq   $0x0,-0x10(%rbp)
jae    114f <_cmsMalloc+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    115c <_cmsMalloc+0x4c>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cmsMalloc>:
cmp    $0x1f400000,%rdi
jbe    111c <_cmsMalloc+0xc>
xor    %eax,%eax
ret
push   %rax
call   1030 <malloc@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i8* @_cmsMalloc(i64 %0) {
%2 = icmp ugt i64 %0, 524288000
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @malloc(i64 %0)
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
char *memchr(char *, char, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void nullpointerMemchr1(char *p, char *s) {
  p = memchr(s, 'p', strlen(s));
  (void)p;
}


x86 assembly (clang, -O0):
<nullpointerMemchr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    $0x70,%esi
call   1040 <memchr@plt>
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpointerMemchr1>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x70,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <memchr@plt>

LLVM IR (-O0):
define void @nullpointerMemchr1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = call i8* @memchr(i8* %5, i8 signext 112, i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @nullpointerMemchr1(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @memchr(i8* %1, i8 signext 112, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isNumber(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int i;
  char entered[100];
  do {
    scanf("%s", entered);
  } while (!isNumber(entered));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <isNumber@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xed2(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <isNumber@plt>
test   %eax,%eax
je     1140 <main+0x20>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %4
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @isNumber(i8* %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %4, label %12
12: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @isNumber(i8* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret i32 0
}
void fn402E() { return; }


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

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

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

LLVM IR (-O2):
define void @fn402E() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void join_threads(pthread_t *threads, int threads_amount) {
  int counter = 0;
  while (counter < threads_amount) {
    pthread_join(threads[counter], NULL);
    counter++;
  }
}


x86 assembly (clang, -O0):
<join_threads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <join_threads+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_join@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <join_threads+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_threads>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <join_threads+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
xor    %esi,%esi
call   1030 <pthread_join@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <join_threads+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @join_threads(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
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @pthread_join(i32 %15, i32* null)
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @join_threads(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @pthread_join(i32 %9, i32* null)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int digit_multiple(int i) {
  for (int n = i; i % 10 && n % (i % 10) < 1; i /= 10)
    ;
  return !i;
}


x86 assembly (clang, -O0):
<digit_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x9(%rbp)
je     1148 <digit_multiple+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <digit_multiple+0x58>
jmp    1170 <digit_multiple+0x70>
jmp    115d <digit_multiple+0x5d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110d <digit_multiple+0xd>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_multiple>:
movslq %edi,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
je     1172 <digit_multiple+0x72>
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
jg     1174 <digit_multiple+0x74>
movslq %ecx,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
movslq %ecx,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
jne    1130 <digit_multiple+0x30>
jmp    1174 <digit_multiple+0x74>
mov    %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @digit_multiple(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = srem i32 %10, %12
%14 = icmp slt i32 %13, 1
br label %15
15: ; preds = %9, %5
%16 = phi i1 [ false, %5 ], [ %14, %9 ]
br i1 %16, label %17, label %21
17: ; preds = %15
br label %18
18: ; preds = %17
%19 = load i32, i32* %2
%20 = sdiv i32 %19, 10
store i32 %20, i32* %2
br label %5
21: ; preds = %15
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @digit_multiple(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %13
%5 = phi i32 [ %15, %13 ], [ %2, %1 ]
%6 = phi i32 [ %14, %13 ], [ %0, %1 ]
%7 = srem i32 %0, %5
%8 = icmp slt i32 %7, 1
br i1 %8, label %13, label %9
9: ; preds = %4, %13, %1
%10 = phi i32 [ %0, %1 ], [ %14, %13 ], [ %6, %4 ]
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
13: ; preds = %4
%14 = sdiv i32 %6, 10
%15 = srem i32 %14, 10
%16 = icmp eq i32 %15, 0
br i1 %16, label %9, label %4
}
void *bump_up(void *mtemp, int i_size) {
  unsigned char *bmptr;
  bmptr = (unsigned char *)mtemp;
  bmptr += i_size;
  return ((void *)bmptr);
}


x86 assembly (clang, -O0):
<bump_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bump_up>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @bump_up(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %5
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @bump_up(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Type definitions */
typedef int uint_fast16_t;
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t LittleEndianReadU16(const uint8_t *bytes) {
  return (uint16_t)((uint_fast16_t)bytes[0] | (uint_fast16_t)bytes[1] << 8);
}


x86 assembly (clang, -O0):
<LittleEndianReadU16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LittleEndianReadU16>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @LittleEndianReadU16(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @LittleEndianReadU16(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
long double logl(scalar_t__);
scalar_t__ sqrtl(long double);
long double asinhl(long double x) { return logl(x + sqrtl(x * x + 1)); }


x86 assembly (clang, -O0):
<asinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fstpt  -0x30(%rbp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <sqrtl@plt>
fldt   -0x30(%rbp)
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
faddp  %st,%st(1)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpll -0x18(%rbp)
fldcw  -0x22(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <logl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
fstpt  (%rsp)
call   1040 <sqrtl@plt>
mov    %rax,0x18(%rsp)
fildll 0x18(%rsp)
fldt   0x2c(%rsp)
faddp  %st,%st(1)
fnstcw 0x14(%rsp)
movzwl 0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x16(%rsp)
fldcw  0x16(%rsp)
fistpll 0x20(%rsp)
fldcw  0x14(%rsp)
mov    0x20(%rsp),%rdi
add    $0x38,%rsp
jmp    1030 <logl@plt>

LLVM IR (-O0):
define x86_fp80 @asinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %4, x86_fp80 %5, x86_fp80 0xK3FFF8000000000000000)
%7 = call i64 @sqrtl(x86_fp80 %6)
%8 = sitofp i64 %7 to x86_fp80
%9 = fadd x86_fp80 %3, %8
%10 = fptosi x86_fp80 %9 to i64
%11 = call x86_fp80 @logl(i64 %10)
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @asinhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %0, x86_fp80 0xK3FFF8000000000000000)
%3 = tail call i64 @sqrtl(x86_fp80 %2)
%4 = sitofp i64 %3 to x86_fp80
%5 = fadd x86_fp80 %4, %0
%6 = fptosi x86_fp80 %5 to i64
%7 = tail call x86_fp80 @logl(i64 %6)
ret x86_fp80 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxmsks(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x24));
}


x86 assembly (clang, -O0):
<write_pxmsks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
add    $0x24,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxmsks>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010024,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxmsks(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 36
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxmsks(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = getelementptr i8, i8* %5, i64 36
%7 = tail call i32 @writel(i32 %1, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_hello() { printf("hello from C!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello from C!\00"
define void @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_font_keyed(char *);
int /*<<< orphan*/ set_font_named(char *);
void set_font(char *opt) {
  if (opt[1] == ':')
    set_font_keyed(opt);
  else
    set_font_named(opt);
}


x86 assembly (clang, -O0):
<set_font>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
jne    114b <set_font+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <set_font_keyed@plt>
jmp    1154 <set_font+0x34>
mov    -0x8(%rbp),%rdi
call   1040 <set_font_named@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_font>:
cmpb   $0x3a,0x1(%rdi)
jne    112b <set_font+0xb>
jmp    1030 <set_font_keyed@plt>
jmp    1040 <set_font_named@plt>

LLVM IR (-O0):
define void @set_font(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 58
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @set_font_keyed(i8* %9)
br label %14
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @set_font_named(i8* %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @set_font(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 58
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @set_font_keyed(i8* %0)
br label %9
7: ; preds = %1
%8 = tail call i32 @set_font_named(i8* %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutInit(int *, char **);
int /*<<< orphan*/ init();
int main(int argc, char **argv) {
  glutInit(&argc, argv);
  init();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1040 <glutInit@plt>
mov    $0x0,%al
call   1030 <init@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <glutInit@plt>
xor    %eax,%eax
call   1030 <init@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 @glutInit(i32* %4, i8** %6)
%8 = call i32 (...) @init()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @glutInit(i32* %3, i8** %1)
%5 = call i32 (...) @init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *xmalloc(int);
extern char *xstrdup(const char *s) {
  char *dummy;
  size_t length;
  length = strlen(s) + 1;
  dummy = xmalloc(sizeof(char) * length);
  memcpy(dummy, s, length);
  return dummy;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15d,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @xmalloc(i32 %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = load i64, i64* %4
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @xmalloc(i32 %3)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
int Gsync(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Gsync() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test2_positive();
void __attribute__((noreturn)) test4() { test2_positive(); }


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

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

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

LLVM IR (-O2):
define void @test4() {
%1 = tail call i32 (...) @test2_positive()
unreachable
}