xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ install_next_timer();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ time(int *);
void custom_signal_handler() {
  time_t the_time;
  time(&the_time);
  fprintf(stdout, "alarm ticked at %d (epoch time)\n", the_time);
  install_next_timer();
}


x86 assembly (clang, -O0):
<custom_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <install_next_timer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_signal_handler>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <time@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    0x4(%rsp),%edx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <install_next_timer@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [33 x i8] c"alarm ticked at %d (epoch time)\0A\00"
define void @custom_signal_handler() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = load i32, i32* @stdout
%4 = load i32, i32* %1
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @install_next_timer()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [33 x i8] c"alarm ticked at %d (epoch time)\0A\00"
define void @custom_signal_handler() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = load i32, i32* @stdout
%5 = load i32, i32* %1
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @install_next_timer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ yyparse();
main() {
  yyparse();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <yyparse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <yyparse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @yyparse()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
void clntraw_destroy(CLIENT *x) {}


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

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

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

LLVM IR (-O2):
define void @clntraw_destroy(i32* nocapture %0) {
ret void
}
double ml_mul(double n1, double n2) { return n1 * n2; }


x86 assembly (clang, -O0):
<ml_mul>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_mul>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ml_mul(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 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @ml_mul(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int cmp_num(char *, char *);
int cmp_str(char *, char *);
scalar_t__ is_num(char *);
int cmp_desc(char *a, char *b) {
  return is_num(a) ? cmp_num(b, a) : cmp_str(b, a);
}


x86 assembly (clang, -O0):
<cmp_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_num@plt>
cmp    $0x0,%rax
je     1168 <cmp_desc+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <cmp_num@plt>
mov    %eax,-0x14(%rbp)
jmp    1178 <cmp_desc+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <cmp_str@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_desc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <is_num@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1156 <cmp_desc+0x26>
pop    %rbx
pop    %r14
jmp    1030 <cmp_num@plt>
pop    %rbx
pop    %r14
jmp    1050 <cmp_str@plt>

LLVM IR (-O0):
define i32 @cmp_desc(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 = call i64 @is_num(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @cmp_num(i8* %9, i8* %10)
br label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @cmp_str(i8* %13, i8* %14)
br label %16
16: ; preds = %12, %8
%17 = phi i32 [ %11, %8 ], [ %15, %12 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @cmp_desc(i8* %0, i8* %1) {
%3 = tail call i64 @is_num(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @cmp_num(i8* %1, i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @cmp_str(i8* %1, i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, double *, int);
uint64_t geopm_signal_to_field(double signal) {
  uint64_t result;
  memcpy(&result, &signal, sizeof(result));
  return result;
}


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

x86 assembly (clang, -O2):
<geopm_signal_to_field>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @geopm_signal_to_field(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, double* %2, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
unsigned int f25(unsigned int);
unsigned int f26(unsigned int a) { return f25(f25(a)); }


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

x86 assembly (clang, -O2):
<f26>:
push   %rax
call   1030 <f25@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f25@plt>

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

LLVM IR (-O2):
define i32 @f26(i32 %0) {
%2 = tail call i32 @f25(i32 %0)
%3 = tail call i32 @f25(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello, C");
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Hello, C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drawtitle();
int /*<<< orphan*/ initscreens();
int /*<<< orphan*/ main_loop();
int /*<<< orphan*/ setup();
void restart() {
  initscreens();
  drawtitle();
  initscreens();
  setup();
  main_loop();
}


x86 assembly (clang, -O0):
<restart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscreens@plt>
mov    $0x0,%al
call   1040 <drawtitle@plt>
mov    $0x0,%al
call   1030 <initscreens@plt>
mov    $0x0,%al
call   1060 <setup@plt>
mov    $0x0,%al
call   1050 <main_loop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<restart>:
push   %rax
xor    %eax,%eax
call   1030 <initscreens@plt>
xor    %eax,%eax
call   1040 <drawtitle@plt>
xor    %eax,%eax
call   1030 <initscreens@plt>
xor    %eax,%eax
call   1060 <setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <main_loop@plt>

LLVM IR (-O0):
define void @restart() {
%1 = call i32 (...) @initscreens()
%2 = call i32 (...) @drawtitle()
%3 = call i32 (...) @initscreens()
%4 = call i32 (...) @setup()
%5 = call i32 (...) @main_loop()
ret void
}

LLVM IR (-O2):
define void @restart() {
%1 = tail call i32 (...) @initscreens()
%2 = tail call i32 (...) @drawtitle()
%3 = tail call i32 (...) @initscreens()
%4 = tail call i32 (...) @setup()
%5 = tail call i32 (...) @main_loop()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ LCDClockReset(int, int);
void LCDRasterEnable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x44050000);
  LCDClockReset(ui32Base, 0x00000008);
  (*((volatile uint32_t *)(ui32Base + 0x00000028))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<LCDRasterEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <LCDClockReset@plt>
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterEnable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x44050000,%ebx
sete   %dil
call   1040 <ASSERT@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <LCDClockReset@plt>
movslq %ebx,%rax
orl    $0x1,0x28(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @LCDRasterEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1141178368
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @LCDClockReset(i32 %7, i32 8)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 40
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = or i32 %13, 1
store volatile i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @LCDRasterEnable(i32 %0) {
%2 = icmp eq i32 %0, 1141178368
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = tail call i32 @LCDClockReset(i32 %0, i32 8)
%6 = add nsw i32 %0, 40
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = or i32 %9, 1
store volatile i32 %10, i32* %8
ret void
}
f() {
  typedef short size_t;
  size_t x;
  _Static_assert(sizeof(x) == 2, "short typedef missed");
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int open(char *, int);
int _open_file() {
  int fd = open("./ez.tmp", O_WRONLY | O_CREAT | O_TRUNC);
  if (-1 == fd)
    _exit(0);
  return fd;
}


x86 assembly (clang, -O0):
<_open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
mov    $0xffffffff,%eax
cmp    -0x4(%rbp),%eax
jne    1167 <_open_file+0x47>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open_file>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eb6(%rip),%rax
or     (%rax),%esi
lea    0xebd(%rip),%rdi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     114f <_open_file+0x2f>
pop    %rcx
ret
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"./ez.tmp\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @_open_file() {
%1 = alloca i32
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %2, %3
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @_exit(i32 0)
unreachable
12: ; preds = %0
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"./ez.tmp\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @_open_file() {
%1 = load i32, i32* @O_WRONLY
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = load i32, i32* @O_TRUNC
%5 = or i32 %3, %4
%6 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = tail call i32 @_exit(i32 0)
unreachable
10: ; preds = %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
char *int2bin(int i) {
  char *result;
  memset(result, '\0', 32);
  return result;
}


x86 assembly (clang, -O0):
<int2bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2bin>:
xor    %esi,%esi
mov    $0x20,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define noalias i8* @int2bin(i32 %0) {
%2 = tail call i32 @memset(i8* undef, i8 signext 0, i32 32)
ret i8* undef
}
void gtk_file_filter_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_filter_get_type() {
ret void
}
int w_islower(char c) {
  if (c >= 'a' && c <= 'z') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<w_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <w_islower+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <w_islower+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <w_islower+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_islower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @w_islower(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
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 @w_islower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ first(int /*<<< orphan*/);
int /*<<< orphan*/ lambda(int /*<<< orphan*/);
int map(int, int /*<<< orphan*/);
int /*<<< orphan*/ var(int /*<<< orphan*/);
int keys(int alist) { return map(alist, lambda(first(var(0)))); }


x86 assembly (clang, -O0):
<keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1040 <var@plt>
mov    %eax,%edi
call   1060 <first@plt>
mov    %eax,%edi
call   1050 <lambda@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <map@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keys>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <var@plt>
mov    %eax,%edi
call   1060 <first@plt>
mov    %eax,%edi
call   1050 <lambda@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <map@plt>

LLVM IR (-O0):
define i32 @keys(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @var(i32 0)
%5 = call i32 @first(i32 %4)
%6 = call i32 @lambda(i32 %5)
%7 = call i32 @map(i32 %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @keys(i32 %0) {
%2 = tail call i32 @var(i32 0)
%3 = tail call i32 @first(i32 %2)
%4 = tail call i32 @lambda(i32 %3)
%5 = tail call i32 @map(i32 %0, i32 %4)
ret i32 %5
}
void if_assign(void) {
  int i;
  if (i = 4) {
  }
  if ((i = 4)) {
  }
}


x86 assembly (clang, -O0):
<if_assign>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    111a <if_assign+0x1a>
jmp    111f <if_assign+0x1f>
jmp    111f <if_assign+0x1f>
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1135 <if_assign+0x35>
jmp    113a <if_assign+0x3a>
jmp    113a <if_assign+0x3a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @if_assign() {
%1 = alloca i32
store i32 4, i32* %1
br i1 true, label %2, label %3
2: ; preds = %0
br label %3
3: ; preds = %2, %0
store i32 4, i32* %1
br i1 true, label %4, label %5
4: ; preds = %3
br label %5
5: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @if_assign() {
ret void
}
unsigned bit_div3(unsigned num) {
  register unsigned x, y;
  x = (num >> 2) + (num >> 4);
  x += x >> 4;
  x += x >> 8;
  x += x >> 16;
  y = num - ((x << 2) - x);
  return x + ((((y + 1) << 2) + (y + 1)) >> 4);
}


x86 assembly (clang, -O0):
<bit_div3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
sub    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x2,%ecx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_div3>:
mov    %edi,%eax
shr    $0x2,%eax
mov    %edi,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x10,%edx
add    %ecx,%edx
lea    (%rdx,%rdx,2),%eax
sub    %eax,%edi
lea    (%rdi,%rdi,4),%eax
add    $0x5,%eax
shr    $0x4,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @bit_div3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 4
%9 = add i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 4
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 8
%16 = load i32, i32* %3
%17 = add i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = lshr i32 %18, 16
%20 = load i32, i32* %3
%21 = add i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = shl i32 %23, 2
%25 = load i32, i32* %3
%26 = sub i32 %24, %25
%27 = sub i32 %22, %26
store i32 %27, i32* %4
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = add i32 %29, 1
%31 = shl i32 %30, 2
%32 = load i32, i32* %4
%33 = add i32 %32, 1
%34 = add i32 %31, %33
%35 = lshr i32 %34, 4
%36 = add i32 %28, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @bit_div3(i32 %0) {
%2 = lshr i32 %0, 2
%3 = lshr i32 %0, 4
%4 = add nuw nsw i32 %2, %3
%5 = lshr i32 %4, 4
%6 = add nuw nsw i32 %5, %4
%7 = lshr i32 %6, 8
%8 = add nuw nsw i32 %7, %6
%9 = lshr i32 %8, 16
%10 = add nuw nsw i32 %9, %8
%11 = mul i32 %10, -3
%12 = add i32 %11, %0
%13 = mul i32 %12, 5
%14 = add i32 %13, 5
%15 = lshr i32 %14, 4
%16 = add nuw nsw i32 %15, %10
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ deviceFinal();
int /*<<< orphan*/ platformFinal();
void machineFinal() {
  deviceFinal();
  platformFinal();
}


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

x86 assembly (clang, -O2):
<machineFinal>:
push   %rax
xor    %eax,%eax
call   1030 <deviceFinal@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <platformFinal@plt>

LLVM IR (-O0):
define void @machineFinal() {
%1 = call i32 (...) @deviceFinal()
%2 = call i32 (...) @platformFinal()
ret void
}

LLVM IR (-O2):
define void @machineFinal() {
%1 = tail call i32 (...) @deviceFinal()
%2 = tail call i32 (...) @platformFinal()
ret void
}
void main() {
  long a;
  long b[100];
  long c;
  b[7] = 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
movq   $0xa,-0x2f8(%rbp)
add    $0x2c0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i64
%2 = alloca [100 x i64]
%3 = alloca i64
%4 = getelementptr inbounds [100 x i64], [100 x i64]* %2, i64 0, i64 7
store i64 10, i64* %4
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int main(int argc, char *argv[]) {
  int *yay = NULL;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int cardCount(int count, int val) {
  if ((val > 2) && (val < 7)) {
    count++;
  } else if (val == 10) {
    count--;
  }
  return count;
}


x86 assembly (clang, -O0):
<cardCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    112c <cardCount+0x2c>
cmpl   $0x7,-0x8(%rbp)
jge    112c <cardCount+0x2c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <cardCount+0x44>
cmpl   $0xa,-0x8(%rbp)
jne    113f <cardCount+0x3f>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <cardCount+0x44>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cardCount>:
lea    -0x3(%rsi),%eax
xor    %ecx,%ecx
cmp    $0xa,%esi
sete   %cl
neg    %ecx
cmp    $0x4,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @cardCount(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 = icmp sgt i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %20
13: ; preds = %7, %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @cardCount(i32 %0, i32 %1) {
%3 = add i32 %1, -3
%4 = icmp ult i32 %3, 4
%5 = icmp eq i32 %1, 10
%6 = sext i1 %5 to i32
%7 = select i1 %4, i32 1, i32 %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, int *, int *);
int /*<<< orphan*/ stderr;
void checkInput(int *A, int *B) {
  if ((scanf("%u %u", A, B)) != 2) {
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1180 <checkInput+0x50>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    114a <checkInput+0x1a>
pop    %rax
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%u %u\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%u %u\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0, i32* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1)
%4 = icmp eq i32 %3, 2
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
/* Type definitions */
struct gameState {
  int dummy;
};

/* Variables and functions */
int drawCard(int, struct gameState *);
int checkDrawCard(int p, struct gameState *post) {
  int r;
  r = drawCard(p, post);
}


x86 assembly (clang, -O0):
<checkDrawCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <drawCard@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDrawCard>:
jmp    1030 <drawCard@plt>

LLVM IR (-O0):
%struct.gameState = type { i32 }
define i32 @checkDrawCard(i32 %0, %struct.gameState* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.gameState*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.gameState* %1, %struct.gameState** %5
%7 = load i32, i32* %4
%8 = load %struct.gameState*, %struct.gameState** %5
%9 = call i32 @drawCard(i32 %7, %struct.gameState* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.gameState = type { i32 }
define i32 @checkDrawCard(i32 %0, %struct.gameState* %1) {
%3 = tail call i32 @drawCard(i32 %0, %struct.gameState* %1)
ret i32 undef
}
/* Type definitions */
struct editor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ copy_selection(struct editor *);
int /*<<< orphan*/ erase_selection(struct editor *);
int /*<<< orphan*/ select_toggle(struct editor *);
void cut_selection(struct editor *ed) {
  copy_selection(ed);
  erase_selection(ed);
  select_toggle(ed);
}


x86 assembly (clang, -O0):
<cut_selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <copy_selection@plt>
mov    -0x8(%rbp),%rdi
call   1030 <erase_selection@plt>
mov    -0x8(%rbp),%rdi
call   1050 <select_toggle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cut_selection>:
push   %rbx
mov    %rdi,%rbx
call   1040 <copy_selection@plt>
mov    %rbx,%rdi
call   1030 <erase_selection@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <select_toggle@plt>

LLVM IR (-O0):
%struct.editor = type { i32 }
define void @cut_selection(%struct.editor* %0) {
%2 = alloca %struct.editor*
store %struct.editor* %0, %struct.editor** %2
%3 = load %struct.editor*, %struct.editor** %2
%4 = call i32 @copy_selection(%struct.editor* %3)
%5 = load %struct.editor*, %struct.editor** %2
%6 = call i32 @erase_selection(%struct.editor* %5)
%7 = load %struct.editor*, %struct.editor** %2
%8 = call i32 @select_toggle(%struct.editor* %7)
ret void
}

LLVM IR (-O2):
%struct.editor = type { i32 }
define void @cut_selection(%struct.editor* %0) {
%2 = tail call i32 @copy_selection(%struct.editor* %0)
%3 = tail call i32 @erase_selection(%struct.editor* %0)
%4 = tail call i32 @select_toggle(%struct.editor* %0)
ret void
}
/* Variables and functions */
scalar_t__ LINES;
scalar_t__ disambget(int, int, int);
int lineselected(int lvl, int off) { return disambget(lvl, off, 1) > LINES; }


x86 assembly (clang, -O0):
<lineselected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <disambget@plt>
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineselected>:
push   %rax
mov    $0x1,%edx
call   1030 <disambget@plt>
mov    0x2ec6(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LINES = global i64 0
define i32 @lineselected(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @disambget(i32 %5, i32 %6, i32 1)
%8 = load i64, i64* @LINES
%9 = icmp sgt i64 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@LINES = global i64 0
define i32 @lineselected(i32 %0, i32 %1) {
%3 = tail call i64 @disambget(i32 %0, i32 %1, i32 1)
%4 = load i64, i64* @LINES
%5 = icmp sgt i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_64int64_midword_reg(long long val) {
  return ((val >> 16) & (0x64 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_64int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 100
%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_64int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6553600
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ A();
void xx() { A(); }


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

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

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

LLVM IR (-O2):
define void @xx() {
%1 = tail call i32 (...) @A()
ret void
}
void rop3_209_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_209_1_0>:
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 -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%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    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_209_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
or     %sil,%cl
xor    %dl,%cl
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_209_1_0(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* %6
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%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* %6
%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 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%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 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_209_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %2
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %4, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
int isonum_722(char *p) { return (((p[0] & 0xff) << 8) | (p[1] & 0xff)); }


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

x86 assembly (clang, -O2):
<isonum_722>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @isonum_722(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
const char *basename(const char *filename) {
  const char *base;
  const char *x;
  base = filename;
  for (x = filename; *x != 0; ++x) {
    if (*x == '/' || *x == '\\')
      base = x + 1;
  }
  return base;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116a <basename+0x6a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1148 <basename+0x48>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1154 <basename+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1159 <basename+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <basename+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <basename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <basename+0x10>
cmp    $0x5c,%dl
je     1110 <basename+0x10>
test   %dl,%dl
jne    1113 <basename+0x13>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
i8 92, label %6
]
6: ; preds = %2, %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %3, %2 ]
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
ret i8* %3
}
char *Users_encrypt_password(char *pword) { return pword; }


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

x86 assembly (clang, -O2):
<Users_encrypt_password>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @Users_encrypt_password(i8* readnone returned %0) {
ret i8* %0
}
void test45_M_foo__E() {}


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

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

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

LLVM IR (-O2):
define void @test45_M_foo__E() {
ret void
}
double determinant2x2(double a, double b, double c, double d) {
  return a * d - b * c;
}


x86 assembly (clang, -O0):
<determinant2x2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<determinant2x2>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @determinant2x2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @determinant2x2(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %6)
ret double %7
}
void RTVfsFsStrmQueryInfo(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsFsStrmQueryInfo() {
ret void
}
/* Variables and functions */
size_t string_length(const char *string) {
  size_t length = 0;
  while (*(string++)) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <string_length+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <string_length+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
cmpb   $0x0,(%rdi)
je     111f <string_length+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <string_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @string_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
scalar_t__ isspace(char);
void strtr(char *s) {
  if (s == NULL)
    return;
  for (; *s != '\0'; s++)
    if (isspace(*s))
      *s = ' ';
}


x86 assembly (clang, -O0):
<strtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <strtr+0x1c>
jmp    1174 <strtr+0x64>
jmp    1131 <strtr+0x21>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1174 <strtr+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     115e <strtr+0x4e>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
jmp    1163 <strtr+0x53>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <strtr+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtr>:
push   %rbx
test   %rdi,%rdi
je     114e <strtr+0x3e>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     114e <strtr+0x3e>
add    $0x1,%rbx
jmp    113b <strtr+0x2b>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     114e <strtr+0x3e>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1130 <strtr+0x20>
movb   $0x20,-0x1(%rbx)
jmp    1130 <strtr+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strtr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %12
%7 = phi i8 [ %14, %12 ], [ %4, %3 ]
%8 = phi i8* [ %13, %12 ], [ %0, %3 ]
%9 = tail call i64 @isspace(i8 signext %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %6
store i8 32, i8* %8
br label %12
12: ; preds = %6, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %12, %3, %1
ret void
}
void gdk_colormap_free_colors() {}


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

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

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

LLVM IR (-O2):
define void @gdk_colormap_free_colors() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char *, struct stat *);
void has_folder(char *arg1) {
  0;
  0;
  struct stat stats;
  stat(arg1, &stats);
  if (S_ISDIR(stats.st_mode)) {
    0;
  } else {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<has_folder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1160 <has_folder+0x30>
jmp    1167 <has_folder+0x37>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_folder>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
test   %rax,%rax
je     1148 <has_folder+0x18>
pop    %rax
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @has_folder(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i64 @S_ISDIR(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %13
11: ; preds = %1
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @has_folder(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i64 @S_ISDIR(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %1
ret void
}