xunge/DecIR huggingface dataset:
/* Variables and functions */
double atan(double);
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Arctangente(double a) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &a);
  return (atan(a));
}


x86 assembly (clang, -O0):
<Arctangente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <atan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Arctangente>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <atan@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Arctangente(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @atan(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Arctangente(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @atan(double %6)
ret double %7
}
void g_io_channel_read_chars() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_read_chars() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_file_name();
int /*<<< orphan*/ test_file_noname();
int /*<<< orphan*/ test_no_init();
int /*<<< orphan*/ test_rsyslog();
int /*<<< orphan*/ test_thread_log();
int main(int argc, char **argv) {
  test_file_name();
  test_no_init();
  test_rsyslog();
  test_file_noname();
  test_thread_log();
  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    $0x0,%al
call   1030 <test_file_name@plt>
mov    $0x0,%al
call   1040 <test_no_init@plt>
mov    $0x0,%al
call   1060 <test_rsyslog@plt>
mov    $0x0,%al
call   1050 <test_file_noname@plt>
mov    $0x0,%al
call   1070 <test_thread_log@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_file_name@plt>
xor    %eax,%eax
call   1040 <test_no_init@plt>
xor    %eax,%eax
call   1060 <test_rsyslog@plt>
xor    %eax,%eax
call   1050 <test_file_noname@plt>
xor    %eax,%eax
call   1070 <test_thread_log@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 = call i32 (...) @test_file_name()
%7 = call i32 (...) @test_no_init()
%8 = call i32 (...) @test_rsyslog()
%9 = call i32 (...) @test_file_noname()
%10 = call i32 (...) @test_thread_log()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_file_name()
%4 = tail call i32 (...) @test_no_init()
%5 = tail call i32 (...) @test_rsyslog()
%6 = tail call i32 (...) @test_file_noname()
%7 = tail call i32 (...) @test_thread_log()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void hand(int sig) {
  printf("Siganl %d j'ai aucune autre info! et c'est souvent suffisant\n", sig);
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"Siganl %d j'ai aucune autre info! et c'est souvent suffisant\0A\00"
define void @hand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"Siganl %d j'ai aucune autre info! et c'est souvent suffisant\0A\00"
define void @hand(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
size_t updiv(size_t a, size_t b) { return a / b + ((a % b) ? 1 : 0); }


x86 assembly (clang, -O0):
<updiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rdx,%rsi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @updiv(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 = udiv i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = urem i64 %8, %9
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = sext i32 %13 to i64
%15 = add i64 %7, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @updiv(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
%4 = urem i64 %0, %1
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = add i64 %3, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strlen(char const *);
int strncmp(char *, char const *, int /*<<< orphan*/);
char *tpl_peek(int, char const *);
int Util_tplcmp(const char *filename, const char *fmt) {
  char *f = tpl_peek((1 << 0), filename);
  int cmp = -1;
  if (f) {
    cmp = strncmp(f, fmt, strlen(fmt));
    free(f);
  }
  return cmp;
}


x86 assembly (clang, -O0):
<Util_tplcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1060 <tpl_peek@plt>
mov    %rax,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11a8 <Util_tplcmp+0x68>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_tplcmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    $0x1,%edi
call   1060 <tpl_peek@plt>
test   %rax,%rax
je     117f <Util_tplcmp+0x3f>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    1184 <Util_tplcmp+0x44>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Util_tplcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @tpl_peek(i32 1, i8* %7)
store i8* %8, i8** %5
store i32 -1, i32* %6
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @strncmp(i8* %12, i8* %13, i32 %15)
store i32 %16, i32* %6
%17 = load i8*, i8** %5
%18 = call i32 @free(i8* %17)
br label %19
19: ; preds = %11, %2
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
define i32 @Util_tplcmp(i8* %0, i8* %1) {
%3 = tail call i8* @tpl_peek(i32 1, i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = tail call i32 @strncmp(i8* %3, i8* %1, i32 %6)
%8 = tail call i32 @free(i8* %3)
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ %7, %5 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ ft_strrchr(char const *, int);
int ft_strirchr(const char *s, int c) {
  return ((unsigned char *)ft_strrchr(s, c) - (unsigned char *)s);
}


x86 assembly (clang, -O0):
<ft_strirchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ft_strrchr@plt>
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strirchr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ft_strrchr@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_strirchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @ft_strrchr(i8* %5, i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %8 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_strirchr(i8* %0, i32 %1) {
%3 = tail call i64 @ft_strrchr(i8* %0, i32 %1)
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ENOBUFS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void http_fatal_error(char *message) {
  fprintf(stderr, "%s\n", message);
  exit(ENOBUFS);
}


x86 assembly (clang, -O0):
<http_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<http_fatal_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@ENOBUFS = global i32 0
define void @http_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @ENOBUFS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@ENOBUFS = global i32 0
define void @http_fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @ENOBUFS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int main() {
  int a = 3;
  int b = 2;
  while (a) {
    b += 5;
    a += b;
    a += 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1143 <main+0x43>
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
void destructFloat(void *f) { free((float *)f); }


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

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

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

LLVM IR (-O2):
define void @destructFloat(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = tail call i32 @free(float* %2)
ret void
}
unsigned int find_first_set_bit(unsigned long word) {
  asm("bsf %1,%0" : "=r"(word) : "r"(word));
  return (unsigned int)word;
}


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

x86 assembly (clang, -O2):
<find_first_set_bit>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @find_first_set_bit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @find_first_set_bit(i64 %0) {
%2 = tail call i64 asm "bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
double pow(double, int);
double f1(double x) { return pow(x, 2) - 2; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xecc(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, i32 2)
%5 = fsub double %4, 2.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @f1(double %0) {
%2 = tail call double @pow(double %0, i32 2)
%3 = fadd double %2, -2.000000e+00
ret double %3
}
/* Variables and functions */
int syscall(int, int);
int epoll_create(int size) { return syscall(254, size); }


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

x86 assembly (clang, -O2):
<epoll_create>:
mov    %edi,%esi
mov    $0xfe,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @epoll_create(i32 %0) {
%2 = tail call i32 @syscall(i32 254, i32 %0)
ret i32 %2
}
int main() {
  volatile char *a = "";
  if (__builtin_strlen((char *)a) != 0) {
    return 1;
  }
  volatile char *b = "asdf";
  if (__builtin_strlen((char *)b) != 4) {
    return 1;
  }
  volatile char *c = "asdf\0asdf";
  if (__builtin_strlen((char *)c) != 4) {
    return 1;
  }
  volatile char *d = "Hello World\n";
  if (__builtin_strlen((char *)d) != 12) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeeb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     1149 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    11ce <main+0xbe>
lea    0xeb0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%rax
je     1173 <main+0x63>
movl   $0x1,-0x4(%rbp)
jmp    11ce <main+0xbe>
lea    0xe98(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%rax
je     119d <main+0x8d>
movl   $0x1,-0x4(%rbp)
jmp    11ce <main+0xbe>
lea    0xe61(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xc,%rax
je     11c7 <main+0xb7>
movl   $0x1,-0x4(%rbp)
jmp    11ce <main+0xbe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"asdf\00"
@.str.2 = [10 x i8] c"asdf\00asdf\00"
@.str.3 = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %26
10: ; preds = %0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
%11 = load i8*, i8** %3
%12 = call i64 @strlen(i8* %11)
%13 = icmp ne i64 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %26
15: ; preds = %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %4
%16 = load i8*, i8** %4
%17 = call i64 @strlen(i8* %16)
%18 = icmp ne i64 %17, 4
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %1
br label %26
20: ; preds = %15
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8** %5
%21 = load i8*, i8** %5
%22 = call i64 @strlen(i8* %21)
%23 = icmp ne i64 %22, 12
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %1
br label %26
25: ; preds = %20
store i32 0, i32* %1
br label %26
26: ; preds = %25, %24, %19, %14, %9
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     1165 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
mov    -0x8(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1162 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi i32 [ %1, %0 ], [ %7, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int __builtin_ptx_read_clock();
long __builtin_ptx_read_clock64();
__attribute__((device)) long read_clocks() {
  int a = __builtin_ptx_read_clock();
  long b = __builtin_ptx_read_clock64();
  return (long)a + b;
}


x86 assembly (clang, -O0):
<read_clocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_ptx_read_clock@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_clock64@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_clocks>:
push   %rbx
xor    %eax,%eax
call   1030 <__builtin_ptx_read_clock@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__builtin_ptx_read_clock64@plt>
movslq %ebx,%rcx
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @read_clocks() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 (...) @__builtin_ptx_read_clock()
store i32 %3, i32* %1
%4 = call i64 (...) @__builtin_ptx_read_clock64()
store i64 %4, i64* %2
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = load i64, i64* %2
%8 = add nsw i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @read_clocks() {
%1 = tail call i32 (...) @__builtin_ptx_read_clock()
%2 = tail call i64 (...) @__builtin_ptx_read_clock64()
%3 = sext i32 %1 to i64
%4 = add nsw i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int /*<<< orphan*/);
int /*<<< orphan*/ raw_pkt_size(void const *);
void raw_pkt_copy(void *dst, const void *src) {
  memcpy(dst, src, raw_pkt_size(src));
}


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

x86 assembly (clang, -O2):
<raw_pkt_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <raw_pkt_size@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @raw_pkt_copy(i8* %0, i8* %1) {
%3 = tail call i32 @raw_pkt_size(i8* %1)
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ change_srv_plist_serial();
int /*<<< orphan*/ send_int_to_srv(int);
int /*<<< orphan*/ send_str_to_srv(char const *);
void play_from_url(const char *url) {
  send_int_to_srv(0x29);
  change_srv_plist_serial();
  send_int_to_srv(0x01);
  send_int_to_srv(0x02);
  send_str_to_srv(url);
  send_int_to_srv(0x00);
  send_str_to_srv("");
  send_int_to_srv(0x2a);
}


x86 assembly (clang, -O0):
<play_from_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x29,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1040 <change_srv_plist_serial@plt>
mov    $0x1,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x2,%edi
call   1030 <send_int_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1050 <send_str_to_srv@plt>
xor    %edi,%edi
call   1030 <send_int_to_srv@plt>
lea    0xe88(%rip),%rdi
call   1050 <send_str_to_srv@plt>
mov    $0x2a,%edi
call   1030 <send_int_to_srv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play_from_url>:
push   %rbx
mov    %rdi,%rbx
mov    $0x29,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
call   1040 <change_srv_plist_serial@plt>
mov    $0x1,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x2,%edi
call   1030 <send_int_to_srv@plt>
mov    %rbx,%rdi
call   1050 <send_str_to_srv@plt>
xor    %edi,%edi
call   1030 <send_int_to_srv@plt>
lea    0xe91(%rip),%rdi
call   1050 <send_str_to_srv@plt>
mov    $0x2a,%edi
pop    %rbx
jmp    1030 <send_int_to_srv@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @play_from_url(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @send_int_to_srv(i32 41)
%4 = call i32 (...) @change_srv_plist_serial()
%5 = call i32 @send_int_to_srv(i32 1)
%6 = call i32 @send_int_to_srv(i32 2)
%7 = load i8*, i8** %2
%8 = call i32 @send_str_to_srv(i8* %7)
%9 = call i32 @send_int_to_srv(i32 0)
%10 = call i32 @send_str_to_srv(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @send_int_to_srv(i32 42)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @play_from_url(i8* %0) {
%2 = tail call i32 @send_int_to_srv(i32 41)
%3 = tail call i32 (...) @change_srv_plist_serial()
%4 = tail call i32 @send_int_to_srv(i32 1)
%5 = tail call i32 @send_int_to_srv(i32 2)
%6 = tail call i32 @send_str_to_srv(i8* %0)
%7 = tail call i32 @send_int_to_srv(i32 0)
%8 = tail call i32 @send_str_to_srv(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @send_int_to_srv(i32 42)
ret void
}
int print(int type, void *arg, int arglen, struct ht_elem *ht) { return 1; }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ht_elem = type opaque
define i32 @print(i32 %0, i8* %1, i32 %2, %struct.ht_elem* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.ht_elem*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.ht_elem* %3, %struct.ht_elem** %8
ret i32 1
}

LLVM IR (-O2):
%struct.ht_elem = type opaque
define i32 @print(i32 %0, i8* nocapture readnone %1, i32 %2, %struct.ht_elem* nocapture readnone %3) {
ret i32 1
}
void rop3_52_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_52_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_52_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_52_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_52_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_suck_macroname_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_suck_macroname(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_suck_macroname_rec(lexbuf, 11); });
}


x86 assembly (clang, -O0):
<Cyc_suck_macroname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1030 <Cyc_suck_macroname_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_suck_macroname>:
mov    $0xb,%esi
jmp    1030 <Cyc_suck_macroname_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_suck_macroname(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_suck_macroname_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 11)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_suck_macroname(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_suck_macroname_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 11)
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
char *allocChar(int maxLen) {
  char *string = (char *)malloc(sizeof(char) * maxLen);
  return string;
}


x86 assembly (clang, -O0):
<allocChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocChar>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @allocChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @allocChar(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
unsigned xrop3_186_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = D | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_186_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_186_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
and    %esi,%eax
xor    $0xff,%esi
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_186_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_186_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = xor i32 %5, 255
%8 = or i32 %7, %3
%9 = and i32 %6, %5
%10 = or i32 %8, %9
ret i32 %10
}
int same_row(int room1, int room2) { return ((room1 / 3) == (room2 / 3)); }


x86 assembly (clang, -O0):
<same_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<same_row>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
add    %eax,%ecx
movslq %esi,%rax
imul   $0x55555556,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x20,%rdx
add    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @same_row(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 = sdiv i32 %5, 3
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 3
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @same_row(i32 %0, i32 %1) {
%3 = sdiv i32 %0, 3
%4 = sdiv i32 %1, 3
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ le16_to_cpu(int /*<<< orphan*/);
int16_t cpu_to_le16(int16_t x) { return (le16_to_cpu(x)); }


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

x86 assembly (clang, -O2):
<cpu_to_le16>:
jmp    1030 <le16_to_cpu@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_le16(i32 %0) {
%2 = tail call i32 @le16_to_cpu(i32 %0)
ret i32 %2
}
__int128 square(__int128 a) { return a * a; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    %rcx,%rax
imul   %rdx,%rax
mov    %rax,-0x38(%rbp)
mov    %rcx,%rax
mul    %rcx
mov    %rax,%rcx
mov    %rdx,%rax
mov    -0x38(%rbp),%rdx
add    %rdx,%rax
add    %rdx,%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mov    %rdi,%rax
imul   %rdi,%rsi
mul    %rax
add    %rsi,%rdx
add    %rsi,%rdx
ret

LLVM IR (-O0):
define { i64, i64 } @square(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = bitcast i128* %4 to { i64, i64 }*
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 0
store i64 %0, i64* %7
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 1
store i64 %1, i64* %8
%9 = load i128, i128* %4
store i128 %9, i128* %5
%10 = load i128, i128* %5
%11 = load i128, i128* %5
%12 = mul nsw i128 %10, %11
store i128 %12, i128* %3
%13 = bitcast i128* %3 to { i64, i64 }*
%14 = load { i64, i64 }, { i64, i64 }* %13
ret { i64, i64 } %14
}

LLVM IR (-O2):
define { i64, i64 } @square(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = mul nsw i128 %6, %6
%8 = trunc i128 %7 to i64
%9 = lshr i128 %7, 64
%10 = trunc i128 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Variables and functions */
int /*<<< orphan*/ linux_netlink_hotplug_poll();
void linux_hotplug_poll(void) { linux_netlink_hotplug_poll(); }


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

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

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

LLVM IR (-O2):
define void @linux_hotplug_poll() {
%1 = tail call i32 (...) @linux_netlink_hotplug_poll()
ret void
}
/* Variables and functions */
double xlgamma(double);
double lbeta(double a, double b) {
  return (xlgamma(a) + xlgamma(b) - xlgamma(a + b));
}


x86 assembly (clang, -O0):
<lbeta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <xlgamma@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <xlgamma@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <xlgamma@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbeta>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <xlgamma@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <xlgamma@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <xlgamma@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @lbeta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @xlgamma(double %5)
%7 = load double, double* %4
%8 = call double @xlgamma(double %7)
%9 = fadd double %6, %8
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fadd double %10, %11
%13 = call double @xlgamma(double %12)
%14 = fsub double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @lbeta(double %0, double %1) {
%3 = tail call double @xlgamma(double %0)
%4 = tail call double @xlgamma(double %1)
%5 = fadd double %3, %4
%6 = fadd double %0, %1
%7 = tail call double @xlgamma(double %6)
%8 = fsub double %5, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ f();
int main() { f(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
double simp(double, double, int, double);
double period(double tm) { return simp(0.0, 1.570796326795, 3000, tm); }


x86 assembly (clang, -O0):
<period>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm2
xorps  %xmm0,%xmm0
movsd  0xed3(%rip),%xmm1
mov    $0xbb8,%edi
call   1030 <simp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<period>:
movaps %xmm0,%xmm2
movsd  0xee5(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0xbb8,%edi
jmp    1030 <simp@plt>

LLVM IR (-O0):
define double @period(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @simp(double 0.000000e+00, double 0x3FF921FB54442EEA, i32 3000, double %3)
ret double %4
}

LLVM IR (-O2):
define double @period(double %0) {
%2 = tail call double @simp(double 0.000000e+00, double 0x3FF921FB54442EEA, i32 3000, double %0)
ret double %2
}
AR0RX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[10000000]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0RX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x4c4b400(%rax),%xmm1
04
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114b <AR0RX1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <AR0RX1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0RX1>:
movslq %esi,%rax
movsd  (%rcx,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x4c4b400(%rdx),%xmm0
04
setae  %al
ret

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

LLVM IR (-O2):
define i32 @AR0RX1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = getelementptr inbounds double, double* %4, i64 10000000
%8 = load double, double* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds double, double* %5, i64 %9
%11 = load double, double* %10
%12 = fcmp ole double %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int print_menu_hdr(char *header) {
  printf("\n\t\t\t*****************************************************\n");
  printf("\t\t\t\t EMPLOYEE %s MENU \n", header);
  printf("\t\t\t*****************************************************\n");
}


x86 assembly (clang, -O0):
<print_menu_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xf06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_menu_hdr>:
push   %rbx
mov    %rdi,%rbx
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"\0A\09\09\09*****************************************************\0A\00"
@.str.1 = [24 x i8] c"\09\09\09\09 EMPLOYEE %s MENU \0A\00"
@.str.2 = [58 x i8] c"\09\09\09*****************************************************\0A\00"
define i32 @print_menu_hdr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"\09\09\09\09 EMPLOYEE %s MENU \0A\00"
@str = [58 x i8] c"\0A\09\09\09*****************************************************\00"
@str.3 = [57 x i8] c"\09\09\09*****************************************************\00"
define i32 @print_menu_hdr(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.3, i64 0, i64 0))
ret i32 undef
}
main() {
  int *p = (int[2]){
      1,
      2,
  };
  return p[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x2,-0x14(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [2 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 1, i32* %4
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32 2, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void ip_selector_match_debug_log_fields(const struct IPSelectorFields *fields) {

  ;
}


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

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

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

LLVM IR (-O2):
%struct.IPSelectorFields = type opaque
define void @ip_selector_match_debug_log_fields(%struct.IPSelectorFields* nocapture %0) {
ret void
}