xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: now +N[dw]\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Usage: now +N[dw]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Usage: now +N[dw]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int lgmt_prepend2() {}


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

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

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

LLVM IR (-O2):
define i32 @lgmt_prepend2() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *open_file(char *path, char *mode) {
  FILE *file = fopen(path, mode);
  if (NULL == file) {
    fprintf(stderr, "Failed to open file \"%s\"", path);
    exit(EXIT_FAILURE);
  }
  return file;
}


x86 assembly (clang, -O0):
<open_file>:
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)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1184 <open_file+0x54>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <open_file+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Failed to open file \22%s\22\00"
@EXIT_FAILURE = global i32 0
define i32* @open_file(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 eq i32* null, %9
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Failed to open file \22%s\22\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @open_file(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 %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i32* %3
}
/* Variables and functions */
double *lsd_scale_region(int *, double *, int, int, double,
                         int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *);
double *lsd_scale(int *n_out, double *img, int X, int Y, double scale) {
  return lsd_scale_region(n_out, img, X, Y, scale, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<lsd_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
movq   $0x0,(%rsp)
call   1030 <lsd_scale_region@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_scale>:
push   %rax
movq   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <lsd_scale_region@plt>
pop    %rcx
ret

LLVM IR (-O0):
define double* @lsd_scale(i32* %0, double* %1, i32 %2, i32 %3, double %4) {
%6 = alloca i32*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32* %0, i32** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load i32*, i32** %6
%12 = load double*, double** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load double, double* %10
%16 = call double* @lsd_scale_region(i32* %11, double* %12, i32 %13, i32 %14, double %15, i32* null, i32* null, i32* null)
ret double* %16
}

LLVM IR (-O2):
define double* @lsd_scale(i32* %0, double* %1, i32 %2, i32 %3, double %4) {
%6 = tail call double* @lsd_scale_region(i32* %0, double* %1, i32 %2, i32 %3, double %4, i32* null, i32* null, i32* null)
ret double* %6
}
int str_len(char str[]) {
  int i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <str_len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void GPIOPinReset(unsigned long ulPort, unsigned long ulPins) {
  ;
  (*((volatile unsigned long *)(ulPort + 0x00000014))) = ulPins;
}


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

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

LLVM IR (-O0):
define void @GPIOPinReset(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 i64 %6, 20
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIOPinReset(i64 %0, i64 %1) {
%3 = add i64 %0, 20
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo() {
  bar();
  bar();
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Tracking_UI_modePressed();
void UI_UI_modePressed() { Tracking_UI_modePressed(); }


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

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

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

LLVM IR (-O2):
define void @UI_UI_modePressed() {
%1 = tail call i32 (...) @Tracking_UI_modePressed()
ret void
}
int ass_isspace(int c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' ||
         c == '\r';
}


x86 assembly (clang, -O0):
<ass_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ass_isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ass_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ass_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ass_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <ass_isspace+0x5c>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ass_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%ecx
jae    110e <ass_isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <ass_isspace+0xd>
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ass_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 12, label %5
i32 11, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void terminate(char *error_mes) {
  fprintf(stderr, "%s: %s\n", "index", error_mes);
  exit(EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<terminate>:
push   %rax
mov    %rdi,%rcx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecd(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [6 x i8] c"index\00"
@EXIT_FAILURE = global i32 0
define void @terminate(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
unsigned long str$add_not(const unsigned long *asign, const long *aexp,
                          const struct dsc$descriptor_s *adigits,
                          const unsigned long *bsign, const long *bexp,
                          const struct dsc$descriptor_s *bdigits,
                          unsigned long *csign, long *cexp,
                          struct dsc$descriptor_s *cdigits) {
  assert(0);
  return 2392148;
}


x86 assembly (clang, -O0):
<str$add_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    $0x248054,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str$add_not>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x248054,%eax
pop    %rcx
ret

LLVM IR (-O0):
%"struct.dsc$descriptor_s" = type opaque
define i64 @"str$add_not"(i64* %0, i64* %1, %"struct.dsc$descriptor_s"* %2, i64* %3, i64* %4, %"struct.dsc$descriptor_s"* %5, i64* %6, i64* %7, %"struct.dsc$descriptor_s"* %8) {
%10 = alloca i64*
%11 = alloca i64*
%12 = alloca %"struct.dsc$descriptor_s"*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca %"struct.dsc$descriptor_s"*
%16 = alloca i64*
%17 = alloca i64*
%18 = alloca %"struct.dsc$descriptor_s"*
store i64* %0, i64** %10
store i64* %1, i64** %11
store %"struct.dsc$descriptor_s"* %2, %"struct.dsc$descriptor_s"** %12
store i64* %3, i64** %13
store i64* %4, i64** %14
store %"struct.dsc$descriptor_s"* %5, %"struct.dsc$descriptor_s"** %15
store i64* %6, i64** %16
store i64* %7, i64** %17
store %"struct.dsc$descriptor_s"* %8, %"struct.dsc$descriptor_s"** %18
%19 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i64 2392148
}

LLVM IR (-O2):
%"struct.dsc$descriptor_s" = type opaque
define i64 @"str$add_not"(i64* nocapture readnone %0, i64* nocapture readnone %1, %"struct.dsc$descriptor_s"* nocapture readnone %2, i64* nocapture readnone %3, i64* nocapture readnone %4, %"struct.dsc$descriptor_s"* nocapture readnone %5, i64* nocapture readnone %6, i64* nocapture readnone %7, %"struct.dsc$descriptor_s"* nocapture readnone %8) {
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i64 2392148
}
char *get_substring_no_copy(char *full_string, char *cutoff) {
  *cutoff = '\0';
  return full_string;
}


x86 assembly (clang, -O0):
<get_substring_no_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_substring_no_copy>:
mov    %rdi,%rax
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @get_substring_no_copy(i8* readnone returned %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SHSAX(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = (((((int32_t)x << 16) >> 16) + (((int32_t)y) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  s = (((((int32_t)x) >> 16) - (((int32_t)y << 16) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SHSAX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
add    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SHSAX>:
movswl %di,%eax
movswl %si,%ecx
mov    %esi,%edx
sar    $0x10,%edx
add    %eax,%edx
shr    %edx
movzwl %dx,%eax
sar    $0x10,%edi
sub    %ecx,%edi
and    $0xfffffffe,%edi
shl    $0xf,%edi
or     %eax,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__SHSAX(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = ashr i32 %12, 16
%14 = add nsw i32 %10, %13
%15 = ashr i32 %14, 1
%16 = and i32 %15, 65535
store i32 %16, i32* %5
%17 = load i64, i64* %3
%18 = trunc i64 %17 to i32
%19 = ashr i32 %18, 16
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
%22 = shl i32 %21, 16
%23 = ashr i32 %22, 16
%24 = sub nsw i32 %19, %23
%25 = ashr i32 %24, 1
%26 = and i32 %25, 65535
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = shl i32 %27, 16
%29 = load i32, i32* %5
%30 = or i32 %28, %29
%31 = sext i32 %30 to i64
ret i64 %31
}

LLVM IR (-O2):
define i64 @__SHSAX(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
%6 = trunc i64 %1 to i32
%7 = ashr i32 %6, 16
%8 = add nsw i32 %5, %7
%9 = lshr i32 %8, 1
%10 = and i32 %9, 65535
%11 = ashr i32 %3, 16
%12 = shl i32 %6, 16
%13 = ashr exact i32 %12, 16
%14 = sub nsw i32 %11, %13
%15 = shl nsw i32 %14, 15
%16 = and i32 %15, -65536
%17 = or i32 %16, %10
%18 = sext i32 %17 to i64
ret i64 %18
}
double sqrt(double x) {
  __asm__("fldl   %0	    \n\t"
          "fsqrt	    \n\t"
          "fstpl   %0	    \n\t"
          : "=m"((x))
          : "m"((x)));
  return x;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
fsqrt
fstpl  -0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fsqrt
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
ret

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

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ bellman_ford(struct graph *, unsigned long);
int /*<<< orphan*/ dijkstra_array(struct graph *, unsigned long);
struct graph *init_random_graph(int, double);
int main(void) {
  struct graph *graph;
  unsigned long src_vertex;
  graph = init_random_graph(64, 0.01);
  assert(!(!graph));
  src_vertex = 5;
  dijkstra_array(graph, src_vertex);
  bellman_ford(graph, src_vertex);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40,%edi
movsd  0xea4(%rip),%xmm0
call   1060 <init_random_graph@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movq   $0x5,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <dijkstra_array@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <bellman_ford@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xeb7(%rip),%xmm0
mov    $0x40,%edi
call   1060 <init_random_graph@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    $0x5,%esi
mov    %rbx,%rdi
call   1040 <dijkstra_array@plt>
mov    $0x5,%esi
mov    %rbx,%rdi
call   1050 <bellman_ford@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.graph = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.graph*
%3 = alloca i64
store i32 0, i32* %1
%4 = call %struct.graph* @init_random_graph(i32 64, double 1.000000e-02)
store %struct.graph* %4, %struct.graph** %2
%5 = load %struct.graph*, %struct.graph** %2
%6 = icmp ne %struct.graph* %5, null
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store i64 5, i64* %3
%11 = load %struct.graph*, %struct.graph** %2
%12 = load i64, i64* %3
%13 = call i32 @dijkstra_array(%struct.graph* %11, i64 %12)
%14 = load %struct.graph*, %struct.graph** %2
%15 = load i64, i64* %3
%16 = call i32 @bellman_ford(%struct.graph* %14, i64 %15)
ret i32 0
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define i32 @main() {
%1 = tail call %struct.graph* @init_random_graph(i32 64, double 1.000000e-02)
%2 = icmp ne %struct.graph* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @dijkstra_array(%struct.graph* %1, i64 5)
%6 = tail call i32 @bellman_ford(%struct.graph* %1, i64 5)
ret i32 0
}
int quitter_le_serveur(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @quitter_le_serveur() {
ret i32 0
}
void sig_nop(int signo) {}


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

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

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

LLVM IR (-O2):
define void @sig_nop(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
int get_XButtonReleasedEvent_type(void *_p) {
  return (int)((XButtonReleasedEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XButtonReleasedEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XButtonReleasedEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int isSubsequence(char *a, char *b) {
  while (*a) {
    if (*b == *a)
      b++;
    a++;
  }
  return !*b;
}


x86 assembly (clang, -O0):
<isSubsequence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <isSubsequence+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113b <isSubsequence+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <isSubsequence+0xc>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSubsequence>:
mov    (%rdi),%al
test   %al,%al
je     1125 <isSubsequence+0x25>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    %al,(%rsi)
sete   %cl
add    %rcx,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <isSubsequence+0x10>
xor    %eax,%eax
cmpb   $0x0,(%rsi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isSubsequence(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %1, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, %6
%11 = zext i1 %10 to i64
%12 = getelementptr i8, i8* %7, i64 %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i8* [ %1, %2 ], [ %12, %5 ]
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int spi_bulkread(void *, unsigned short, unsigned char, unsigned char *, int);
signed int fc8180_spib_byteread(void *handle, unsigned short addr,
                                unsigned char *data) {
  signed int res;
  unsigned char command = 0x40;
  OAL_OBTAIN_SEMAPHORE();
  res = spi_bulkread(handle, addr, command, data, 1);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
<fc8180_spib_byteread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x40,-0x1d(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0x1d(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
movzwl %dx,%esi
movzbl %al,%edx
call   1040 <spi_bulkread@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8180_spib_byteread>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x40,%edx
mov    %r14,%rcx
mov    $0x1,%r8d
call   1040 <spi_bulkread@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8180_spib_byteread(i8* %0, i16 zeroext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
store i8 64, i8* %8
%9 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%10 = load i8*, i8** %4
%11 = load i16, i16* %5
%12 = load i8, i8* %8
%13 = load i8*, i8** %6
%14 = call i32 @spi_bulkread(i8* %10, i16 zeroext %11, i8 zeroext %12, i8* %13, i32 1)
store i32 %14, i32* %7
%15 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @fc8180_spib_byteread(i8* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%5 = tail call i32 @spi_bulkread(i8* %0, i16 zeroext %1, i8 zeroext 64, i8* %2, i32 1)
%6 = tail call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %5
}
char *strcpy(char *dest, const char *src) {
  char *ptrDest = dest;
  const char *ptrSrc = src;
  while (*ptrSrc != '\0') {
    *ptrDest = *ptrSrc;
    ptrDest++;
    ptrSrc++;
  }
  *ptrDest = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
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    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <strcpy+0x55>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <strcpy+0x1c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %0
}
int opng_isdigit(int ch) { return (ch >= '0' && ch <= '9'); }


x86 assembly (clang, -O0):
<opng_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <opng_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opng_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @opng_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @opng_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void SSMR3GetS128(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetS128() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mpgedit_free(void *ptr) {
  if (ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<mpgedit_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <mpgedit_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpgedit_free>:
test   %rdi,%rdi
je     111a <mpgedit_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @mpgedit_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @mpgedit_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgincgw(char *s) { sgen("%s\t%s", "incq", s); }


x86 assembly (clang, -O0):
<cgincgw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <sgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincgw>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <sgen@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s\09%s\00"
@.str.1 = [5 x i8] c"incq\00"
define void @cgincgw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sgen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%s\00"
@.str.1 = [5 x i8] c"incq\00"
define void @cgincgw(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void panic(const char *msg) {
  printf("MEMORY ERROR\n");
  printf("function: %s\n", msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<panic>:
push   %rbx
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"MEMORY ERROR\0A\00"
@.str.1 = [14 x i8] c"function: %s\0A\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"function: %s\0A\00"
@str = [13 x i8] c"MEMORY ERROR\00"
define void @panic(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void gtk_button_box_set_child_secondary() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_box_set_child_secondary() {
ret void
}
void call(name) char *name;
{
  out_callstring();
  outstr(name);
}


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

x86 assembly (clang, -O2):
<call>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <out_callstring@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <outstr@plt>

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

LLVM IR (-O2):
define void @call(i8* %0) {
%2 = tail call i32 (...) @out_callstring()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_leairrx1(int /*<<< orphan*/, int, int, int);
int gen_tlb_addr_w(int ar, int map) {
  if (map >= 0) {
    emit_leairrx1(0, ar, map, ar);
  }
}


x86 assembly (clang, -O0):
<gen_tlb_addr_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1138 <gen_tlb_addr_w+0x28>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %edi,%edi
call   1030 <emit_leairrx1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_tlb_addr_w>:
test   %esi,%esi
js     1126 <gen_tlb_addr_w+0x16>
push   %rax
mov    %esi,%edx
mov    %edi,%ecx
xor    %edi,%edi
mov    %ecx,%esi
call   1030 <emit_leairrx1@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @gen_tlb_addr_w(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @emit_leairrx1(i32 0, i32 %0, i32 %1, i32 %0)
br label %6
6: ; preds = %4, %2
ret i32 undef
}
int get_word_count(char *p_str) {
  int cnt = 0;
  return cnt;
}


x86 assembly (clang, -O0):
<get_word_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_word_count(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dscal_(int *, double *, double *, int *);
void dscal(int N, double ALPHA, double *X, int INCX) {
  dscal_(&N, &ALPHA, X, &INCX);
}


x86 assembly (clang, -O0):
<dscal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <dscal_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dscal>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    %rax,%rdx
call   1030 <dscal_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @dscal(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %7
%10 = call i32 @dscal_(i32* %5, double* %6, double* %9, i32* %8)
ret void
}

LLVM IR (-O2):
define void @dscal(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i32 %3, i32* %7
%8 = call i32 @dscal_(i32* %5, double* %6, double* %2, i32* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ da_add(double const *, double *, double *);
int /*<<< orphan*/ da_copy(double const *, double *);
int /*<<< orphan*/ da_minus(double *);
void da_sub(const double *a, const double *b, double *c) {
  double minb[10];
  da_copy(b, minb);
  da_minus(minb);
  da_add(a, minb, c);
}


x86 assembly (clang, -O0):
<da_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <da_copy@plt>
lea    -0x70(%rbp),%rdi
call   1040 <da_minus@plt>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <da_add@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<da_sub>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdx,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1050 <da_copy@plt>
mov    %rbx,%rdi
call   1040 <da_minus@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <da_add@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @da_sub(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [10 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %5
%9 = getelementptr inbounds [10 x double], [10 x double]* %7, i64 0, i64 0
%10 = call i32 @da_copy(double* %8, double* %9)
%11 = getelementptr inbounds [10 x double], [10 x double]* %7, i64 0, i64 0
%12 = call i32 @da_minus(double* %11)
%13 = load double*, double** %4
%14 = getelementptr inbounds [10 x double], [10 x double]* %7, i64 0, i64 0
%15 = load double*, double** %6
%16 = call i32 @da_add(double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @da_sub(double* %0, double* %1, double* %2) {
%4 = alloca [10 x double]
%5 = bitcast [10 x double]* %4 to i8*
%6 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 0
%7 = call i32 @da_copy(double* %1, double* %6)
%8 = call i32 @da_minus(double* %6)
%9 = call i32 @da_add(double* %0, double* %6, double* %2)
ret void
}
/* Variables and functions */
int pow(int, double);
double InversePhred(double phred) {
  float num = 1;
  float denom = (1 + pow(10, phred / 10));
  return num / denom;
}


x86 assembly (clang, -O0):
<InversePhred>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movss  0xee3(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InversePhred>:
push   %rax
divsd  0xee7(%rip),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xed3(%rip),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @InversePhred(double %0) {
%2 = alloca double
%3 = alloca float
%4 = alloca float
store double %0, double* %2
store float 1.000000e+00, float* %3
%5 = load double, double* %2
%6 = fdiv double %5, 1.000000e+01
%7 = call i32 @pow(i32 10, double %6)
%8 = add nsw i32 1, %7
%9 = sitofp i32 %8 to float
store float %9, float* %4
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fdiv float %10, %11
%13 = fpext float %12 to double
ret double %13
}

LLVM IR (-O2):
define double @InversePhred(double %0) {
%2 = fdiv double %0, 1.000000e+01
%3 = tail call i32 @pow(i32 10, double %2)
%4 = add nsw i32 %3, 1
%5 = sitofp i32 %4 to float
%6 = fdiv float 1.000000e+00, %5
%7 = fpext float %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ glClearColor(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void initializeGL(void) {
  glEnable(GL_DEPTH_TEST);
  glClearColor(0, 0, 0, 1.0);
}


x86 assembly (clang, -O0):
<initializeGL>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
xor    %edx,%edx
movsd  0xec4(%rip),%xmm0
mov    %edx,%edi
mov    %edx,%esi
call   1040 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeGL>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
movsd  0xec9(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <glClearColor@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
define void @initializeGL() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
%3 = call i32 @glClearColor(i32 0, i32 0, i32 0, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
define void @initializeGL() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
%3 = tail call i32 @glClearColor(i32 0, i32 0, i32 0, double 1.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int is_interesting(char);
int main(void) {
  assert(!is_interesting('a'));
  assert(is_interesting('b'));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <is_interesting@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x62,%edi
call   1030 <is_interesting@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1030 <is_interesting@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x62,%edi
call   1030 <is_interesting@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @is_interesting(i8 signext 97)
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @is_interesting(i8 signext 98)
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @is_interesting(i8 signext 97)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @is_interesting(i8 signext 98)
%6 = tail call i32 @assert(i32 %5)
ret i32 0
}