xunge/DecIR huggingface dataset:
void EUSCIA0_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<EUSCIA0_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <EUSCIA0_IRQHandler+0x9>
jmp    1109 <EUSCIA0_IRQHandler+0x9>

x86 assembly (clang, -O2):
<EUSCIA0_IRQHandler>:
jmp    1100 <EUSCIA0_IRQHandler>

LLVM IR (-O0):
define void @EUSCIA0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @EUSCIA0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *prev_char_safe_utf8(const char *p, const char *StrBegin) {
  for (--p; p >= StrBegin; --p) {
    if ((*p & 0xc0) != 0x80)
      return (char *)p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<prev_char_safe_utf8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1160 <prev_char_safe_utf8+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     114a <prev_char_safe_utf8+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <prev_char_safe_utf8+0x68>
jmp    114f <prev_char_safe_utf8+0x4f>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <prev_char_safe_utf8+0x18>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prev_char_safe_utf8>:
add    $0xffffffffffffffff,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
cmp    %rsi,%rdi
jb     112b <prev_char_safe_utf8+0x2b>
movzbl (%rdi),%ecx
and    $0xc0,%cl
add    $0xffffffffffffffff,%rdi
cmp    $0x80,%cl
je     1110 <prev_char_safe_utf8+0x10>
add    $0x1,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @prev_char_safe_utf8(i8* %0, i8* readnone %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %5, %7 ]
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ult i8* %5, %1
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load i8, i8* %5
%9 = and i8 %8, -64
%10 = icmp eq i8 %9, -128
br i1 %10, label %3, label %11
11: ; preds = %3, %7
%12 = phi i8* [ %5, %7 ], [ null, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gneg() { ol("mnegl\tr0,r0"); }


x86 assembly (clang, -O0):
<gneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"mnegl\09r0,r0\00"
define i32 @gneg() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"mnegl\09r0,r0\00"
define i32 @gneg() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
norettype_old3(a) int **a;
{ return **a; }


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

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

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

LLVM IR (-O2):
define i32 @norettype_old3(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xcb() {
  Assert_real((isalpha(203) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1020, ("isalpha should be 0 for 0xcb"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xcb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcb,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3fc,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xcb>:
push   %rax
mov    $0xcb,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3fc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcb\00"
define void @t_isalpha_0xcb() {
%1 = call i64 @isalpha(i32 203)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1020, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcb\00"
define void @t_isalpha_0xcb() {
%1 = tail call i64 @isalpha(i32 203)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1020, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int GetRecordSeq(const char *msg) {
  return (int)(msg[7] << 24 | msg[8] << 16 | msg[9] << 8 | msg[10]);
}


x86 assembly (clang, -O0):
<GetRecordSeq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x7(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x9(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0xa(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRecordSeq>:
movzbl 0x7(%rdi),%eax
shl    $0x18,%eax
movsbl 0x8(%rdi),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movsbl 0x9(%rdi),%edx
shl    $0x8,%edx
movsbl 0xa(%rdi),%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GetRecordSeq(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 9
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 10
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @GetRecordSeq(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = shl nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 9
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = shl nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 10
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = or i32 %15, %18
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_startup_info(void) {
  printf("\n"
         "DNS Query Performance Testing Tool\n"
         "Version: Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp \n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [101 x i8] c"\0ADNS Query Performance Testing Tool\0AVersion: Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp \0A\0A\00"
define void @show_startup_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [100 x i8] c"\0ADNS Query Performance Testing Tool\0AVersion: Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp \0A\00"
define void @show_startup_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *version_get_git();
const char *plugin_api_info_version_git_cb(const void *pointer, void *data,
                                           const char *info_name,
                                           const char *arguments) {
  (void)pointer;
  (void)data;
  (void)info_name;
  (void)arguments;
  return version_get_git();
}


x86 assembly (clang, -O0):
<plugin_api_info_version_git_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <version_get_git@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @plugin_api_info_version_git_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* (...) @version_get_git()
ret i8* %13
}

LLVM IR (-O2):
define i8* @plugin_api_info_version_git_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i8* (...) @version_get_git()
ret i8* %5
}
void common1() {
  printf("\n%s: \n", __func__);
  printf("liba common1\n");
}


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

x86 assembly (clang, -O2):
<common1>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.common1 = [8 x i8] c"common1\00"
@.str.1 = [14 x i8] c"liba common1\0A\00"
define void @common1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.common1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.common1 = [8 x i8] c"common1\00"
@str = [13 x i8] c"liba common1\00"
define void @common1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.common1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ backtrack(int *, int /*<<< orphan*/, int);
void generate_subsets(int n) {
  int a[50];
  backtrack(a, 0, n);
}


x86 assembly (clang, -O0):
<generate_subsets>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <backtrack@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_subsets>:
sub    $0xc8,%rsp
mov    %edi,%edx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <backtrack@plt>
add    $0xc8,%rsp
ret

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

LLVM IR (-O2):
define void @generate_subsets(i32 %0) {
%2 = alloca [50 x i32]
%3 = bitcast [50 x i32]* %2 to i8*
%4 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%5 = call i32 @backtrack(i32* %4, i32 0, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Course: EG1302A - Spring 2014!\n");
  printf("Name: Sultan Alqahtani!\n");
  printf("Date Created: %d/%d/%d/!\n", 1, 28, 2014);
  printf("Assignment: Assignment05!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Course: EG1302A - Spring 2014!\0A\00"
@.str.1 = [25 x i8] c"Name: Sultan Alqahtani!\0A\00"
@.str.2 = [26 x i8] c"Date Created: %d/%d/%d/!\0A\00"
@.str.3 = [27 x i8] c"Assignment: Assignment05!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [26 x i8] c"Date Created: %d/%d/%d/!\0A\00"
@str = [31 x i8] c"Course: EG1302A - Spring 2014!\00"
@str.4 = [24 x i8] c"Name: Sultan Alqahtani!\00"
@str.5 = [26 x i8] c"Assignment: Assignment05!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
int HelpItem151(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem151() {
ret i32 0
}
/* Variables and functions */
double Expr(int, char const **);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  int argcount = argc - 1;
  const char **args = &argv[1];
  double result = Expr(argcount, args);
  printf("%lf\n", result);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <Expr@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
add    $0xffffffff,%edi
add    $0x8,%rsi
call   1030 <Expr@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8** %12, i8*** %7
%13 = load i32, i32* %6
%14 = load i8**, i8*** %7
%15 = call double @Expr(i32 %13, i8** %14)
store double %15, double* %8
%16 = load double, double* %8
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %16)
%18 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = add nsw i32 %0, -1
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = tail call double @Expr(i32 %3, i8** %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call i32 (...) @getchar()
ret i32 0
}
char *b24ton(char *data, unsigned int val) {
  data[0] = val >> 16;
  data[1] = val >> 8;
  data[2] = val & 0xff;
  return data + 3;
}


x86 assembly (clang, -O0):
<b24ton>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b24ton>:
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %cl,(%rdi)
mov    %ah,0x1(%rdi)
mov    %al,0x2(%rdi)
lea    0x3(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @b24ton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 16
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 3
ret i8* %21
}

LLVM IR (-O2):
define i8* @b24ton(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = trunc i32 %1 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 3
ret i8* %10
}
char is_blank_string(const char *c) {
  char result = 1;
  while (result && (c != '\0')) {
    result &= is_blank(*c);
    c++;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_blank_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x1,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     113d <is_blank_string+0x2d>
cmpq   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    114d <is_blank_string+0x3d>
jmp    1177 <is_blank_string+0x67>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <is_blank@plt>
mov    %eax,%ecx
movsbl -0x9(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <is_blank_string+0x10>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_string>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1134 <is_blank_string+0x24>
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   (%rax)
movsbl (%rbx),%edi
xor    %eax,%eax
call   1030 <is_blank@plt>
add    $0x1,%rbx
test   $0x1,%al
jne    1120 <is_blank_string+0x10>
jmp    1137 <is_blank_string+0x27>
mov    $0x1,%bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @is_blank_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 1, i8* %3
br label %4
4: ; preds = %13, %1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %13, label %24
13: ; preds = %11
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @is_blank to i32 (i32, ...)*)(i32 %16)
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = and i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %2
br label %4
24: ; preds = %11
%25 = load i8, i8* %3
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @is_blank_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @is_blank to i32 (i32, ...)*)(i32 %6)
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = and i32 %7, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i8 [ 1, %1 ], [ 0, %3 ]
ret i8 %12
}
void glwin_draw_image(void *voidhandle, int xsize, int ysize,
                      unsigned char *img) {
  return;
}


x86 assembly (clang, -O0):
<glwin_draw_image>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glwin_draw_image(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @glwin_draw_image(i8* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}
void dr_register_otg(void) {}


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

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

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

LLVM IR (-O2):
define void @dr_register_otg() {
ret void
}
double fisAllMf(double x, double *params) {
  (void)(x);
  (void)(params);
  return (1);
}


x86 assembly (clang, -O0):
<fisAllMf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisAllMf>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fisAllMf(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
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @fisAllMf(double %0, double* nocapture readnone %1) {
ret double 1.000000e+00
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ch;
  int counter = 0;
  while ((ch = getchar()) != EOF) {
    ++counter;
  }
  printf("%d\n", counter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     115d <main+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
mov    0x2eb8(%rip),%r14
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    (%r14),%eax
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
unsigned char iowTouchByte(unsigned char);
unsigned char iowWriteByte(unsigned char sendbyte) {
  return (iowTouchByte(sendbyte) == sendbyte) ? 1 : 0;
}


x86 assembly (clang, -O0):
<iowWriteByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <iowTouchByte@plt>
movzbl %al,%edx
movzbl -0x1(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iowWriteByte>:
push   %rbx
mov    %edi,%ebx
call   1030 <iowTouchByte@plt>
cmp    %bl,%al
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @iowWriteByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @iowTouchByte(i8 zeroext %3)
%5 = zext i8 %4 to i32
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @iowWriteByte(i8 zeroext %0) {
%2 = tail call zeroext i8 @iowTouchByte(i8 zeroext %0)
%3 = icmp eq i8 %2, %0
%4 = zext i1 %3 to i8
ret i8 %4
}
void *sp_to_sc(unsigned long sp) { return ((void *)sp); }


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

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

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

LLVM IR (-O2):
define i8* @sp_to_sc(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
int solcon_read_standard_solutions();
int /*<<< orphan*/ standard_next_retrievals();
void test_standard_next_retrievals(void) {
  int fail = solcon_read_standard_solutions();
  standard_next_retrievals();
}


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

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

LLVM IR (-O0):
define void @test_standard_next_retrievals() {
%1 = alloca i32
%2 = call i32 (...) @solcon_read_standard_solutions()
store i32 %2, i32* %1
%3 = call i32 (...) @standard_next_retrievals()
ret void
}

LLVM IR (-O2):
define void @test_standard_next_retrievals() {
%1 = tail call i32 (...) @solcon_read_standard_solutions()
%2 = tail call i32 (...) @standard_next_retrievals()
ret void
}
_Complex float test_casinf(_Complex float x) { return __builtin_casinf(x); }


x86 assembly (clang, -O0):
<test_casinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <casinf@plt>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_casinf>:
jmp    1030 <casinf@plt>

LLVM IR (-O0):
define <2 x float> @test_casinf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %8, float* %11
store float %10, float* %12
%13 = bitcast { float, float }* %4 to <2 x float>*
%14 = load <2 x float>, <2 x float>* %13
%15 = call <2 x float> @casinf(<2 x float> %14)
%16 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %15, <2 x float>* %16
%17 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%20 = load float, float* %19
%21 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%22 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %18, float* %21
store float %20, float* %22
%23 = bitcast { float, float }* %2 to <2 x float>*
%24 = load <2 x float>, <2 x float>* %23
ret <2 x float> %24
}

LLVM IR (-O2):
define <2 x float> @test_casinf(<2 x float> %0) {
%2 = tail call <2 x float> @casinf(<2 x float> %0)
ret <2 x float> %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int *a;
  *a = 0;
  *a = *a + 13;
  printf("Hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0xd,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
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
%7 = load i32*, i32** %6
store i32 0, i32* %7
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 13
%11 = load i32*, i32** %6
store i32 %10, i32* %11
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
void default_start_row(struct foreign_reader *self, int y) {}


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

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

LLVM IR (-O0):
%struct.foreign_reader = type opaque
define void @default_start_row(%struct.foreign_reader* %0, i32 %1) {
%3 = alloca %struct.foreign_reader*
%4 = alloca i32
store %struct.foreign_reader* %0, %struct.foreign_reader** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.foreign_reader = type opaque
define void @default_start_row(%struct.foreign_reader* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *xfopen(const char *path, const char *mode) {
  FILE *fd = fopen(path, mode);
  if (!fd)
    err(EXIT_FAILURE, ("error: %s"), path);
  return fd;
}


x86 assembly (clang, -O0):
<xfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <xfopen+0x45>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea0(%rip),%rsi
call   1030 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xfopen+0x2c>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %r14,%rdx
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [10 x i8] c"error: %s\00"
define noalias i32* @xfopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @err(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %5, %2
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float itof(const uint32_t x) {
  union {
    uint32_t i;
    float f;
  } u;
  u.i = x;
  return u.f;
}


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

x86 assembly (clang, -O2):
<itof>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @itof(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @itof(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CSlaveDataPut(uint32_t ui32Base, uint8_t ui8Data) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000808))) = ui8Data;
}


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

x86 assembly (clang, -O2):
<I2CSlaveDataPut>:
mov    %rsi,0x808(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveDataPut(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 2056
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveDataPut(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 2056
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void g_ptr_array_remove_index_fast() {}


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

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

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

LLVM IR (-O2):
define void @g_ptr_array_remove_index_fast() {
ret void
}
/* Variables and functions */
int test_csv_out(char *, char *);
bool test_csv_out1() { return test_csv_out("hello,world", "\"hello,world\""); }


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

x86 assembly (clang, -O2):
<test_csv_out1>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <test_csv_out@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hello,world\00"
@.str.1 = [14 x i8] c"\22hello,world\22\00"
define i32 @test_csv_out1() {
%1 = call i32 @test_csv_out(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello,world\00"
@.str.1 = [14 x i8] c"\22hello,world\22\00"
define i32 @test_csv_out1() {
%1 = tail call i32 @test_csv_out(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
unsigned int SCE_String_NChrInStr(const char *str, char c) {
  unsigned int nb = 0;
  for (; *str != '\0'; str++) {
    if (*str == c)
      nb++;
  }
  return nb;
}


x86 assembly (clang, -O0):
<SCE_String_NChrInStr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <SCE_String_NChrInStr+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <SCE_String_NChrInStr+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <SCE_String_NChrInStr+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <SCE_String_NChrInStr+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCE_String_NChrInStr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <SCE_String_NChrInStr+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <SCE_String_NChrInStr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @SCE_String_NChrInStr(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
typedef int int64_t;

/* Variables and functions */
struct timespec lean_timespec(int64_t time) {
  struct timespec ts;
  ts.tv_sec = time / 1000000;
  ts.tv_nsec = (time % 1000000) * 1000;
  return ts;
}


x86 assembly (clang, -O0):
<lean_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lean_timespec>:
movslq %edi,%rcx
imul   $0x431bde83,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
imul   $0xf4240,%eax,%edx
sub    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
shl    $0x20,%rcx
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @lean_timespec(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %3
%8 = srem i32 %7, 1000000
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %9, i32* %10
%11 = bitcast %struct.timespec* %2 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @lean_timespec(i32 %0) {
%2 = sdiv i32 %0, 1000000
%3 = srem i32 %0, 1000000
%4 = mul nsw i32 %3, 1000
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %2 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ gen_im32(int);
int /*<<< orphan*/ gen_op_shr_cc(int, int /*<<< orphan*/);
void gen_op_shr_im_cc(int val, int shift) {
  gen_op_shr_cc(val, gen_im32(shift));
}


x86 assembly (clang, -O0):
<gen_op_shr_im_cc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <gen_im32@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <gen_op_shr_cc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_op_shr_im_cc>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <gen_im32@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <gen_op_shr_cc@plt>

LLVM IR (-O0):
define void @gen_op_shr_im_cc(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 @gen_im32(i32 %6)
%8 = call i32 @gen_op_shr_cc(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @gen_op_shr_im_cc(i32 %0, i32 %1) {
%3 = tail call i32 @gen_im32(i32 %1)
%4 = tail call i32 @gen_op_shr_cc(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2CIntHandler();
void I2C1_Handler(void) { I2CIntHandler(); }


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

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

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

LLVM IR (-O2):
define void @I2C1_Handler() {
%1 = tail call i32 (...) @I2CIntHandler()
ret void
}
int sc_compar(const void *va, const void *vb) {
  const unsigned int *a = (unsigned int *)va;
  const unsigned int *b = (unsigned int *)vb;
  return (*a - *b);
}


x86 assembly (clang, -O0):
<sc_compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_compar>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @sc_compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ distance2(float, float, float, float);
float sqrt(int /*<<< orphan*/);
float distance(float ax, float ay, float bx, float by) {
  return sqrt(distance2(ax, ay, bx, by));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <distance2@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rax
call   1030 <distance2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call i32 @distance2(float %9, float %10, float %11, float %12)
%14 = call float @sqrt(i32 %13)
ret float %14
}

LLVM IR (-O2):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @distance2(float %0, float %1, float %2, float %3)
%6 = tail call float @sqrt(i32 %5)
ret float %6
}