xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ steadystate(double *, double *);
void steadySTS(double STATES[]) {
  double mvs[26];
  steadystate(mvs, STATES);
}


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

x86 assembly (clang, -O2):
<steadySTS>:
sub    $0xd8,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <steadystate@plt>
add    $0xd8,%rsp
ret

LLVM IR (-O0):
define void @steadySTS(double* %0) {
%2 = alloca double*
%3 = alloca [26 x double]
store double* %0, double** %2
%4 = getelementptr inbounds [26 x double], [26 x double]* %3, i64 0, i64 0
%5 = load double*, double** %2
%6 = call i32 @steadystate(double* %4, double* %5)
ret void
}

LLVM IR (-O2):
define void @steadySTS(double* %0) {
%2 = alloca [26 x double]
%3 = bitcast [26 x double]* %2 to i8*
%4 = getelementptr inbounds [26 x double], [26 x double]* %2, i64 0, i64 0
%5 = call i32 @steadystate(double* %4, double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_bind_button();
int /*<<< orphan*/ process_binding();
int /*<<< orphan*/ process_led();
int /*<<< orphan*/ process_receiving();
int /*<<< orphan*/ process_systick();
void process_receiver(void) {
  process_systick();
  process_bind_button();
  process_binding();
  process_receiving();
  process_led();
}


x86 assembly (clang, -O0):
<process_receiver>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <process_systick@plt>
mov    $0x0,%al
call   1050 <process_bind_button@plt>
mov    $0x0,%al
call   1040 <process_binding@plt>
mov    $0x0,%al
call   1030 <process_receiving@plt>
mov    $0x0,%al
call   1070 <process_led@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_receiver>:
push   %rax
xor    %eax,%eax
call   1060 <process_systick@plt>
xor    %eax,%eax
call   1050 <process_bind_button@plt>
xor    %eax,%eax
call   1040 <process_binding@plt>
xor    %eax,%eax
call   1030 <process_receiving@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <process_led@plt>

LLVM IR (-O0):
define void @process_receiver() {
%1 = call i32 (...) @process_systick()
%2 = call i32 (...) @process_bind_button()
%3 = call i32 (...) @process_binding()
%4 = call i32 (...) @process_receiving()
%5 = call i32 (...) @process_led()
ret void
}

LLVM IR (-O2):
define void @process_receiver() {
%1 = tail call i32 (...) @process_systick()
%2 = tail call i32 (...) @process_bind_button()
%3 = tail call i32 (...) @process_binding()
%4 = tail call i32 (...) @process_receiving()
%5 = tail call i32 (...) @process_led()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c;
  for (c = 0; c <= 255; c++) {
    printf("%d, %c\n", c, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _citrus_bcs_isspace(char const);
const char *_citrus_bcs_skip_nonws(const char *p) {
  while (*p && !_citrus_bcs_isspace(*p))
    p++;
  return (p);
}


x86 assembly (clang, -O0):
<_citrus_bcs_skip_nonws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <_citrus_bcs_skip_nonws+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <_citrus_bcs_isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <_citrus_bcs_skip_nonws+0x48>
jmp    1169 <_citrus_bcs_skip_nonws+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <_citrus_bcs_skip_nonws+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_bcs_skip_nonws>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <_citrus_bcs_skip_nonws+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <_citrus_bcs_isspace@plt>
test   %eax,%eax
jne    1138 <_citrus_bcs_skip_nonws+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_citrus_bcs_skip_nonws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_citrus_bcs_skip_nonws(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @_citrus_bcs_isspace(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @_citrus_bcs_skip_nonws(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @_citrus_bcs_isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int i2c_read(int, int /*<<< orphan*/ *, int);
int i2c_read_byte(int file_handle, uint8_t *destination) {
  int return_value = i2c_read(file_handle, destination, 1);
  if (return_value < 0)
    return -1;
  else if (return_value != 1)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<i2c_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <i2c_read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1149 <i2c_read_byte+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <i2c_read_byte+0x56>
cmpl   $0x1,-0x14(%rbp)
je     115f <i2c_read_byte+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <i2c_read_byte+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read_byte>:
push   %rax
mov    $0x1,%edx
call   1030 <i2c_read@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @i2c_read_byte(i32 %0, i32* %1) {
%3 = tail call i32 @i2c_read(i32 %0, i32* %1, i32 1)
%4 = icmp ne i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ unicode_to_ksx1001(long, int *, int *);
unsigned long euc_kr_from_ucs(long int ucs) {
  int r, c;
  if (unicode_to_ksx1001(ucs, &r, &c))
    return 0x10000000 | ((r + 0xA1) << 8) | (c + 0xA1);
  else
    return 0;
}


x86 assembly (clang, -O0):
<euc_kr_from_ucs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <unicode_to_ksx1001@plt>
cmp    $0x0,%rax
je     115d <euc_kr_from_ucs+0x4d>
mov    -0x14(%rbp),%eax
add    $0xa1,%eax
shl    $0x8,%eax
or     $0x10000000,%eax
mov    -0x18(%rbp),%ecx
add    $0xa1,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    1165 <euc_kr_from_ucs+0x55>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euc_kr_from_ucs>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <unicode_to_ksx1001@plt>
test   %rax,%rax
je     1147 <euc_kr_from_ucs+0x37>
mov    0x4(%rsp),%eax
shl    $0x8,%eax
add    $0xa100,%eax
movslq (%rsp),%rcx
add    $0xa1,%rcx
cltq
or     %rcx,%rax
or     $0x10000000,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @euc_kr_from_ucs(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = call i64 @unicode_to_ksx1001(i64 %6, i32* %4, i32* %5)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 161
%12 = shl i32 %11, 8
%13 = or i32 268435456, %12
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 161
%16 = or i32 %13, %15
%17 = sext i32 %16 to i64
store i64 %17, i64* %2
br label %19
18: ; preds = %1
store i64 0, i64* %2
br label %19
19: ; preds = %18, %9
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @euc_kr_from_ucs(i64 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i64 @unicode_to_ksx1001(i64 %0, i32* %2, i32* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = add i32 %10, 41216
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 161
%14 = or i32 %13, %11
%15 = or i32 %14, 268435456
%16 = sext i32 %15 to i64
br label %17
17: ; preds = %1, %8
%18 = phi i64 [ %16, %8 ], [ 0, %1 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ test_average();
int /*<<< orphan*/ test_create_dictionary();
int /*<<< orphan*/ test_save_load();
int /*<<< orphan*/ test_similarity();
int /*<<< orphan*/ test_vocabulary();
int main(int argc, char *argv[]) {
  test_save_load();
  test_similarity();
  test_average();
  test_create_dictionary();
  test_vocabulary();
  return 1;
}


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_save_load@plt>
mov    $0x0,%al
call   1060 <test_similarity@plt>
mov    $0x0,%al
call   1040 <test_average@plt>
mov    $0x0,%al
call   1070 <test_create_dictionary@plt>
mov    $0x0,%al
call   1050 <test_vocabulary@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_save_load@plt>
xor    %eax,%eax
call   1060 <test_similarity@plt>
xor    %eax,%eax
call   1040 <test_average@plt>
xor    %eax,%eax
call   1070 <test_create_dictionary@plt>
xor    %eax,%eax
call   1050 <test_vocabulary@plt>
mov    $0x1,%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_save_load()
%7 = call i32 (...) @test_similarity()
%8 = call i32 (...) @test_average()
%9 = call i32 (...) @test_create_dictionary()
%10 = call i32 (...) @test_vocabulary()
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_save_load()
%4 = tail call i32 (...) @test_similarity()
%5 = tail call i32 (...) @test_average()
%6 = tail call i32 (...) @test_create_dictionary()
%7 = tail call i32 (...) @test_vocabulary()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
char *readline();
int /*<<< orphan*/ sscanf(char *, char *, char *);
scalar_t__ strlen(char *);
char *getstring() {
  char *rawline = readline();
  char *newline = malloc(strlen(rawline) + 1);
  sscanf(rawline, "%s", newline);
  if (rawline) {
    free(rawline);
  }
  return newline;
}


x86 assembly (clang, -O0):
<getstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <readline@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe75(%rip),%rsi
call   1070 <sscanf@plt>
cmpq   $0x0,-0x8(%rbp)
je     11a4 <getstring+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstring>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <readline@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1070 <sscanf@plt>
test   %rbx,%rbx
je     1191 <getstring+0x41>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i8* @getstring() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @readline()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %1
%9 = load i8*, i8** %2
%10 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %1
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = load i8*, i8** %1
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %13, %0
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i8* @getstring() {
%1 = tail call i8* (...) @readline()
%2 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i8* %1, null
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = tail call i32 @free(i8* %1)
br label %9
9: ; preds = %7, %0
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ FLEXCOMM5_DriverIRQHandler();
__attribute__((weak)) void FLEXCOMM5_IRQHandler(void) {
  FLEXCOMM5_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @FLEXCOMM5_IRQHandler() {
%1 = call i32 (...) @FLEXCOMM5_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @FLEXCOMM5_IRQHandler() {
%1 = tail call i32 (...) @FLEXCOMM5_DriverIRQHandler()
ret void
}
void instruc_3() {}


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

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

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

LLVM IR (-O2):
define void @instruc_3() {
ret void
}
int test_imm_D6uint8_mem(unsigned char *val) {
  return ((*val) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6uint8_mem>:
testb  $0xd6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -42
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void i2d_NETSCAPE_SPKAC(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_NETSCAPE_SPKAC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(int, int);
main() { func(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 1, i32 2)
ret i32 0
}
double glmComputeVectorLength2dPow2(const double v[2]) {
  return v[0] * v[0] + v[1] * v[1];
}


x86 assembly (clang, -O0):
<glmComputeVectorLength2dPow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorLength2dPow2>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @glmComputeVectorLength2dPow2(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
ret double %6
}
extern void aug_relptr(void *volatile *ptr, void *val) {
  __asm__ __volatile__("sfence" ::: "memory");
  *ptr = val;
}


x86 assembly (clang, -O0):
<aug_relptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
sfence
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<aug_relptr>:
sfence
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @aug_relptr(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %3
store volatile i8* %5, i8** %6
ret void
}

LLVM IR (-O2):
define void @aug_relptr(i8** %0, i8* %1) {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
store volatile i8* %1, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, size_t);
uint8_t *nghttp2_cpymem(uint8_t *dest, const void *src, size_t len) {
  if (len == 0) {
    return dest;
  }
  memcpy(dest, src, len);
  return dest + len;
}


x86 assembly (clang, -O0):
<nghttp2_cpymem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113c <nghttp2_cpymem+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <nghttp2_cpymem+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nghttp2_cpymem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdx,%rdx
je     112b <nghttp2_cpymem+0x1b>
mov    %rdx,%r14
mov    %rbx,%rdi
call   1030 <memcpy@plt>
lea    (%rbx,%r14,4),%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @nghttp2_cpymem(i32* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @memcpy(i32* %0, i8* %1, i64 %2)
%7 = getelementptr inbounds i32, i32* %0, i64 %2
br label %8
8: ; preds = %3, %5
%9 = phi i32* [ %7, %5 ], [ %0, %3 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int main() {
  unsigned char c;
  c = 0;
  printf("c: %u\n", c);
  c = 1;
  printf("~c: %u\n", c);
  c = ~0;
  printf("~c: %u\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
lea    0xed7(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movb   $0x1,-0x5(%rbp)
lea    0xec2(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movb   $0xff,-0x5(%rbp)
lea    0xeae(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee9(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"c: %u\0A\00"
@.str.1 = [8 x i8] c"~c: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -1)
ret i32 0
}
/* Variables and functions */
int wycc_type_flags(int);
int wycc_type_is_tuple(int id) {
  int flgs = wycc_type_flags(id);
  if (flgs & 256) {
    return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<wycc_type_is_tuple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <wycc_type_flags@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1143 <wycc_type_is_tuple+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <wycc_type_is_tuple+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wycc_type_is_tuple>:
push   %rax
call   1030 <wycc_type_flags@plt>
shr    $0x8,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wycc_type_is_tuple(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @wycc_type_flags(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 256
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @wycc_type_is_tuple(i32 %0) {
%2 = tail call i32 @wycc_type_flags(i32 %0)
%3 = lshr i32 %2, 8
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotate(uint32_t x, int n) { return (x << n) | (x >> (32 - n)); }


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotate(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotate(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int get_grid_point_double_mesh(int const *, int const *);
int kgd_get_grid_point_double_mesh(const int address_double[3],
                                   const int mesh[3]) {
  return get_grid_point_double_mesh(address_double, mesh);
}


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

x86 assembly (clang, -O2):
<kgd_get_grid_point_double_mesh>:
jmp    1030 <get_grid_point_double_mesh@plt>

LLVM IR (-O0):
define i32 @kgd_get_grid_point_double_mesh(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 @get_grid_point_double_mesh(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kgd_get_grid_point_double_mesh(i32* %0, i32* %1) {
%3 = tail call i32 @get_grid_point_double_mesh(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int arr[], int low, int high) {
  int pivot;
  if (high - low > 0) {
    pivot = partition(arr, low, high);
    quickSort(arr, low, pivot - 1);
    quickSort(arr, pivot + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1177 <quickSort+0x57>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
struct cart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cartVarDbName(char *, char *);
int /*<<< orphan*/ cartSetDouble(struct cart *, int /*<<< orphan*/, double);
void cartSetDoubleDb(struct cart *cart, char *db, char *var, double val) {
  cartSetDouble(cart, _cartVarDbName(db, var), val);
}


x86 assembly (clang, -O0):
<cartSetDoubleDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_cartVarDbName@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
movsd  -0x20(%rbp),%xmm0
call   1030 <cartSetDouble@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cartSetDoubleDb>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <_cartVarDbName@plt>
mov    %rbx,%rdi
mov    %eax,%esi
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <cartSetDouble@plt>

LLVM IR (-O0):
%struct.cart = type { i32 }
define void @cartSetDoubleDb(%struct.cart* %0, i8* %1, i8* %2, double %3) {
%5 = alloca %struct.cart*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca double
store %struct.cart* %0, %struct.cart** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store double %3, double* %8
%9 = load %struct.cart*, %struct.cart** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @_cartVarDbName(i8* %10, i8* %11)
%13 = load double, double* %8
%14 = call i32 @cartSetDouble(%struct.cart* %9, i32 %12, double %13)
ret void
}

LLVM IR (-O2):
%struct.cart = type { i32 }
define void @cartSetDoubleDb(%struct.cart* %0, i8* %1, i8* %2, double %3) {
%5 = tail call i32 @_cartVarDbName(i8* %1, i8* %2)
%6 = tail call i32 @cartSetDouble(%struct.cart* %0, i32 %5, double %3)
ret void
}
int Xloop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Xloop() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ function1();
int /*<<< orphan*/ function2();
int main() {
  function1();
  function2();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @function1()
%2 = tail call i32 (...) @function2()
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_copy_into_systems_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(99, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_copy_into_systems_container>:
mov    $0x63,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_copy_into_systems_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 99, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_copy_into_systems_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 99, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
size_t _jw_base64_decode_size(const char *orig, size_t orig_len) {
  size_t result = (orig_len >> 2) * 3;
  const char *ptr = orig + (orig_len - 1);
  while (*ptr-- == '=') {
    --result;
  }
  return result;
}


x86 assembly (clang, -O0):
<_jw_base64_decode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x2,%rax
imul   $0x3,%rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    115b <_jw_base64_decode_size+0x5b>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <_jw_base64_decode_size+0x2f>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jw_base64_decode_size>:
mov    %rsi,%rax
shr    $0x2,%rax
lea    (%rax,%rax,2),%rax
cmpb   $0x3d,-0x1(%rsi,%rdi,1)
jne    112d <_jw_base64_decode_size+0x2d>
lea    (%rsi,%rdi,1),%rcx
add    $0xfffffffffffffffe,%rcx
nopw   0x0(%rax,%rax,1)
add    $0xffffffffffffffff,%rax
cmpb   $0x3d,(%rcx)
lea    -0x1(%rcx),%rcx
je     1120 <_jw_base64_decode_size+0x20>
ret

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

LLVM IR (-O2):
define i64 @_jw_base64_decode_size(i8* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 2
%4 = mul nuw i64 %3, 3
%5 = add i64 %1, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 61
br i1 %8, label %9, label %16
9: ; preds = %2, %9
%10 = phi i8* [ %12, %9 ], [ %6, %2 ]
%11 = phi i64 [ %13, %9 ], [ %4, %2 ]
%12 = getelementptr inbounds i8, i8* %10, i64 -1
%13 = add i64 %11, -1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 61
br i1 %15, label %9, label %16
16: ; preds = %9, %2
%17 = phi i64 [ %4, %2 ], [ %13, %9 ]
ret i64 %17
}
int rightmostNotB(char *array, int n) {
  for (int i = n - 1; i >= 0; i--) {
    if (array[i] != 'B') {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<rightmostNotB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1151 <rightmostNotB+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x42,%eax
je     113e <rightmostNotB+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <rightmostNotB+0x58>
jmp    1143 <rightmostNotB+0x43>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <rightmostNotB+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightmostNotB>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1121 <rightmostNotB+0x21>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmpb   $0x42,(%rdi,%rcx,1)
je     1110 <rightmostNotB+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @rightmostNotB(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = and i64 %6, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 66
br i1 %13, label %4, label %14
14: ; preds = %9
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %4, %14
%17 = phi i32 [ %15, %14 ], [ -1, %4 ]
ret i32 %17
}
/* Variables and functions */
float __ocml_fabs_f32(float);
float fabsf(float x) { return __ocml_fabs_f32(x); }


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

x86 assembly (clang, -O2):
<fabsf>:
jmp    1030 <__ocml_fabs_f32@plt>

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

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = tail call float @__ocml_fabs_f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ btr(int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ readinput();
int main() {
  readinput();
  btr(1, 1);
  puts("error, puzzle not solved");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <readinput@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <btr@plt>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <readinput@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <btr@plt>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"error, puzzle not solved\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @readinput()
%3 = call i32 @btr(i32 1, i32 1)
%4 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"error, puzzle not solved\00"
define i32 @main() {
%1 = tail call i32 (...) @readinput()
%2 = tail call i32 @btr(i32 1, i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Enter a number: ");
  scanf("%d", &x);
  if (x % 2)
    printf("Number is odd.\n");
  else
    printf("Number is not odd.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1170 <main+0x50>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xeba(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Number is odd.\0A\00"
@.str.3 = [20 x i8] c"Number is not odd.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [19 x i8] c"Number is not odd.\00"
@str.4 = [15 x i8] c"Number is odd.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
double simpson(double (*f)(double), double a, double b) {
  return ((b - a) / 6) * (f(a) + 4 * f((a + b) / 2) + f(b));
}


x86 assembly (clang, -O0):
<simpson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   *%rax
movsd  -0x30(%rbp),%xmm1
movsd  0xe96(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
call   *%rax
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpson>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x8(%rsp)
mov    %rdi,%rbx
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
divsd  0xee0(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
call   *%rdi
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xec7(%rip),%xmm0
call   *%rbx
mulsd  0xec5(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   *%rbx
addsd  (%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @simpson(double (double)* %0, double %1, double %2) {
%4 = alloca double (double)*
%5 = alloca double
%6 = alloca double
store double (double)* %0, double (double)** %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = fdiv double %9, 6.000000e+00
%11 = load double (double)*, double (double)** %4
%12 = load double, double* %5
%13 = call double %11(double %12)
%14 = load double (double)*, double (double)** %4
%15 = load double, double* %5
%16 = load double, double* %6
%17 = fadd double %15, %16
%18 = fdiv double %17, 2.000000e+00
%19 = call double %14(double %18)
%20 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %19, double %13)
%21 = load double (double)*, double (double)** %4
%22 = load double, double* %6
%23 = call double %21(double %22)
%24 = fadd double %20, %23
%25 = fmul double %10, %24
ret double %25
}

LLVM IR (-O2):
define double @simpson(double (double)* nocapture %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = fdiv double %4, 6.000000e+00
%6 = tail call double %0(double %1)
%7 = fadd double %1, %2
%8 = fmul double %7, 5.000000e-01
%9 = tail call double %0(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 4.000000e+00, double %6)
%11 = tail call double %0(double %2)
%12 = fadd double %10, %11
%13 = fmul double %5, %12
ret double %13
}