xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void f4() {
  char array[] = "Allen Downey";
  float *p = array;
  printf("%f\n", (double)*p);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeda(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.f4.array = [13 x i8] c"Allen Downey\00"
@.str = [4 x i8] c"%f\0A\00"
define void @f4() {
%1 = alloca [13 x i8]
%2 = alloca float*
%3 = bitcast [13 x i8]* %1 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = bitcast i8* %4 to float*
store float* %5, float** %2
%6 = load float*, float** %2
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @f4() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x44AD8D8820000000)
ret void
}
void LEDs_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @LEDs_Init() {
ret void
}
/* Variables and functions */
int isready(int /*<<< orphan*/);
int keypressed(void) { return isready(0); }


x86 assembly (clang, -O0):
<keypressed>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <isready@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keypressed>:
xor    %edi,%edi
jmp    1030 <isready@plt>

LLVM IR (-O0):
define i32 @keypressed() {
%1 = call i32 @isready(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @keypressed() {
%1 = tail call i32 @isready(i32 0)
ret i32 %1
}
/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_short(char *str, short *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(short), true);
}


x86 assembly (clang, -O0):
<try_parse_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_short>:
mov    $0x2,%edx
mov    $0x1,%ecx
jmp    1030 <try_parse_int_imp@plt>

LLVM IR (-O0):
define i32 @try_parse_short(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @try_parse_int_imp(i8* %5, i8* %7, i32 2, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @try_parse_short(i8* %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 2, i32 1)
ret i32 %4
}
struct page *trans_huge_page_release_encode(struct page *page) {
  return page;
}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define %struct.page* @trans_huge_page_release_encode(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
ret %struct.page* %3
}

LLVM IR (-O2):
%struct.page = type opaque
define %struct.page* @trans_huge_page_release_encode(%struct.page* readnone returned %0) {
ret %struct.page* %0
}
void UARTBreakCtl(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<UARTBreakCtl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTBreakCtl>:
orq    $0x1,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @UARTBreakCtl(i64 %0) {
%2 = add i64 %0, 12
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int get_seed(int *seed) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(997, seed, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<get_seed>:
mov    %rdi,%rsi
mov    $0x3e5,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @get_seed(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 997, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x04() {
  Assert_real((isprint(4) == 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_isprint.c",
              25, ("isprint should be 0 for 0x04"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x04>:
push   %rax
mov    $0x4,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x04\00"
define void @t_isprint_0x04() {
%1 = call i64 @isprint(i32 4)
%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 25, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x04\00"
define void @t_isprint_0x04() {
%1 = tail call i64 @isprint(i32 4)
%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 25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doProgram();
int /*<<< orphan*/ init();
int main(int argc, const char *argv[]) {
  init();
  doProgram();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <doProgram@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @doProgram()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: test_path"
                        " [<path> ...\n]");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: test_path [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: test_path [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int max(int a, int b) {
  int c;
  c = a > b ? a : b;
  return c;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "'commandable-hab' publishes several Resources that can be commanded.\n"
      "\n"
      "usage:  commandable-hab [OPTIONS]\n"
      "\n"
      " -?,--help                     Show this usage information.\n"
      " -v,--version                  Show the version number\n"
      " -e,--require-security         Require security\n"
      " -i,--id <ID>                  Use ID as the HAB-ID (defaults to\n"
      "                               hostname if omitted).\n"
      " -s,--security-dir <dir>       Directory containing security "
      "certificates\n"
      "\n"
      "Security can only be required when a security directory has been "
      "specified.\n"
      "  commandable-hab [--security-dir <dir> [--require-security]]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [600 x i8] c"'commandable-hab' publishes several Resources that can be commanded.\0A\0Ausage: commandable-hab [OPTIONS]\0A\0A -?,--help Show this usage information.\0A -v,--version Show the version number\0A -e,--require-security Require security\0A -i,--id <ID> Use ID as the HAB-ID (defaults to\0A hostname if omitted).\0A -s,--security-dir <dir> Directory containing security certificates\0A\0ASecurity can only be required when a security directory has been specified.\0A commandable-hab [--security-dir <dir> [--require-security]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([600 x i8], [600 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [600 x i8] c"'commandable-hab' publishes several Resources that can be commanded.\0A\0Ausage: commandable-hab [OPTIONS]\0A\0A -?,--help Show this usage information.\0A -v,--version Show the version number\0A -e,--require-security Require security\0A -i,--id <ID> Use ID as the HAB-ID (defaults to\0A hostname if omitted).\0A -s,--security-dir <dir> Directory containing security certificates\0A\0ASecurity can only be required when a security directory has been specified.\0A commandable-hab [--security-dir <dir> [--require-security]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([600 x i8], [600 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
int /*<<< orphan*/ ft_strdel(char **);
void ft_arrdel(char **s) {
  int i;
  i = 0;
  while (s[i]) {
    ft_strdel(&s[i]);
    i++;
  }
  free(s);
}


x86 assembly (clang, -O0):
<ft_arrdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1168 <ft_arrdel+0x48>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1040 <ft_strdel@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ft_arrdel+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_arrdel>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmpq   $0x0,(%rdi)
je     1143 <ft_arrdel+0x23>
mov    %r14,%rbx
mov    %rbx,%rdi
call   1040 <ft_strdel@plt>
cmpq   $0x0,0x8(%rbx)
lea    0x8(%rbx),%rbx
jne    1130 <ft_arrdel+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ft_arrdel(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %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 = icmp ne i8* %9, null
br i1 %10, label %11, label %19
11: ; preds = %4
%12 = load i8**, i8*** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = call i32 @ft_strdel(i8** %15)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
%20 = load i8**, i8*** %2
%21 = call i32 @free(i8** %20)
ret void
}

LLVM IR (-O2):
define void @ft_arrdel(i8** %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @ft_strdel(i8** %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret void
}
void foo(char *p) {
  __builtin_memcpy(p, "abc", 0);
  p[0] = 'd';
}


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

x86 assembly (clang, -O2):
<foo>:
movb   $0x64,(%rdi)
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
store i8 100, i8* %5
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0) {
store i8 100, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void too_bad(void) {
  puts("SeeSaw software extends its heartfelt condolences");
  puts("to you upon the failure of your program");
}


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

x86 assembly (clang, -O2):
<too_bad>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"SeeSaw software extends its heartfelt condolences\00"
@.str.1 = [40 x i8] c"to you upon the failure of your program\00"
define void @too_bad() {
%1 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"SeeSaw software extends its heartfelt condolences\00"
@.str.1 = [40 x i8] c"to you upon the failure of your program\00"
define void @too_bad() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double gte_double(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<gte_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gte_double>:
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gte_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @gte_double(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
void dump_stack(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dump_stack() {
ret void
}
int test_imm_31int8_reg(signed char val) {
  return ((val) & (0x31 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_31int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x31,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_31int8_reg>:
test   $0x31,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_31int8_reg(i8 signext %0) {
%2 = and i8 %0, 49
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int sniffer();
int main(int argc, char *argv[]) { return sniffer(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <sniffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sniffer()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GL_ONE_MINUS_SRC_ALPHA;
int /*<<< orphan*/ GL_SRC_ALPHA;
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
void ffunc(void) {
  static int state = 1;
  if (state ^= 1)
    glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);
  else
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}


x86 assembly (clang, -O0):
<ffunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2f05(%rip)
cmp    $0x0,%eax
je     1148 <ffunc+0x38>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
jmp    115f <ffunc+0x4f>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffunc>:
xorl   $0x1,0x2f11(%rip)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    %edi,%esi
jne    112d <ffunc+0x1d>
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
jmp    1030 <glBlendFunc@plt>

LLVM IR (-O0):
@ffunc.state = internal global i32 1
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
define void @ffunc() {
%1 = load i32, i32* @ffunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @ffunc.state
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @GL_SRC_ALPHA
%6 = load i32, i32* @GL_SRC_ALPHA
%7 = call i32 @glBlendFunc(i32 %5, i32 %6)
br label %12
8: ; preds = %0
%9 = load i32, i32* @GL_SRC_ALPHA
%10 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%11 = call i32 @glBlendFunc(i32 %9, i32 %10)
br label %12
12: ; preds = %8, %4
ret void
}

LLVM IR (-O2):
@ffunc.state = internal unnamed_addr global i32 1
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
define void @ffunc() {
%1 = load i32, i32* @ffunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @ffunc.state
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_SRC_ALPHA
%5 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%6 = select i1 %3, i32 %5, i32 %4
%7 = tail call i32 @glBlendFunc(i32 %4, i32 %6)
ret void
}
void VecSelfScalarMult3iv(int v[3], int s) {
  v[0] *= s;
  v[1] *= s;
  v[2] *= s;
}


x86 assembly (clang, -O0):
<VecSelfScalarMult3iv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
imul   (%rax),%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
imul   0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
imul   0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecSelfScalarMult3iv>:
mov    (%rdi),%eax
imul   %esi,%eax
mov    %eax,(%rdi)
mov    0x4(%rdi),%eax
imul   %esi,%eax
mov    %eax,0x4(%rdi)
imul   0x8(%rdi),%esi
mov    %esi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @VecSelfScalarMult3iv(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, %5
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = mul nsw i32 %13, %10
store i32 %14, i32* %12
%15 = load i32, i32* %4
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = mul nsw i32 %18, %15
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @VecSelfScalarMult3iv(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = mul nsw i32 %3, %1
store i32 %4, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, %1
store i32 %7, i32* %5
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %1
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
double exp(int);
double pow(int, int);
double sqrt(double);
double stirlingsApproximation1(int n) {
  return pow(n, n) * exp(-n) * sqrt(2.0 * 3.141592653589793 * n);
}


x86 assembly (clang, -O0):
<stirlingsApproximation1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xe8d(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stirlingsApproximation1>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %edi,%esi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
neg    %edi
call   1030 <exp@plt>
movapd %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xea0(%rip),%xmm0
mulsd  0x8(%rsp),%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1176 <stirlingsApproximation1+0x46>
sqrtsd %xmm0,%xmm0
jmp    1187 <stirlingsApproximation1+0x57>
movsd  %xmm2,0x8(%rsp)
call   1050 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @stirlingsApproximation1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call double @pow(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = call double @exp(i32 %7)
%9 = fmul double %5, %8
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
%12 = fmul double 0x401921FB54442D18, %11
%13 = call double @sqrt(double %12)
%14 = fmul double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @stirlingsApproximation1(i32 %0) {
%2 = tail call double @pow(i32 %0, i32 %0)
%3 = sub nsw i32 0, %0
%4 = tail call double @exp(i32 %3)
%5 = fmul double %2, %4
%6 = sitofp i32 %0 to double
%7 = fmul double %6, 0x401921FB54442D18
%8 = tail call double @sqrt(double %7)
%9 = fmul double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ write_u8(int, int, int);
void L3GD20H_init(int fd) {
  write_u8(fd, 0x20, 0x00);
  write_u8(fd, 0x23, 0x80);
  if (0) {
    write_u8(fd, 0x2E, 0x20);
    write_u8(fd, 0x24, 0x52);
  } else if (1) {
    write_u8(fd, 0x21, 0x09);
    write_u8(fd, 0x24, 0x12);
  } else {
    write_u8(fd, 0x24, 0x00);
  }
  write_u8(fd, 0x20, 0x0F);
}


x86 assembly (clang, -O0):
<L3GD20H_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
xor    %edx,%edx
call   1030 <write_u8@plt>
mov    -0x4(%rbp),%edi
mov    $0x23,%esi
mov    $0x80,%edx
call   1030 <write_u8@plt>
mov    -0x4(%rbp),%edi
mov    $0x21,%esi
mov    $0x9,%edx
call   1030 <write_u8@plt>
mov    -0x4(%rbp),%edi
mov    $0x24,%esi
mov    $0x12,%edx
call   1030 <write_u8@plt>
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
mov    $0xf,%edx
call   1030 <write_u8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L3GD20H_init>:
push   %rbx
mov    %edi,%ebx
mov    $0x20,%esi
xor    %edx,%edx
call   1030 <write_u8@plt>
mov    %ebx,%edi
mov    $0x23,%esi
mov    $0x80,%edx
call   1030 <write_u8@plt>
mov    %ebx,%edi
mov    $0x21,%esi
mov    $0x9,%edx
call   1030 <write_u8@plt>
mov    %ebx,%edi
mov    $0x24,%esi
mov    $0x12,%edx
call   1030 <write_u8@plt>
mov    %ebx,%edi
mov    $0x20,%esi
mov    $0xf,%edx
pop    %rbx
jmp    1030 <write_u8@plt>

LLVM IR (-O0):
define void @L3GD20H_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write_u8(i32 %3, i32 32, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @write_u8(i32 %5, i32 35, i32 128)
%7 = load i32, i32* %2
%8 = call i32 @write_u8(i32 %7, i32 33, i32 9)
%9 = load i32, i32* %2
%10 = call i32 @write_u8(i32 %9, i32 36, i32 18)
%11 = load i32, i32* %2
%12 = call i32 @write_u8(i32 %11, i32 32, i32 15)
ret void
}

LLVM IR (-O2):
define void @L3GD20H_init(i32 %0) {
%2 = tail call i32 @write_u8(i32 %0, i32 32, i32 0)
%3 = tail call i32 @write_u8(i32 %0, i32 35, i32 128)
%4 = tail call i32 @write_u8(i32 %0, i32 33, i32 9)
%5 = tail call i32 @write_u8(i32 %0, i32 36, i32 18)
%6 = tail call i32 @write_u8(i32 %0, i32 32, i32 15)
ret void
}
double f4_cb_send_short(double (*cb)(short)) {
  short r = -22;
  return cb(r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0xffea,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswl -0xa(%rbp),%edi
call   *%rax
movsd  0xedc(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_short>:
push   %rax
mov    %rdi,%rax
mov    $0xffffffea,%edi
call   *%rax
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_short(double (i16)* %0) {
%2 = alloca double (i16)*
%3 = alloca i16
store double (i16)* %0, double (i16)** %2
store i16 -22, i16* %3
%4 = load double (i16)*, double (i16)** %2
%5 = load i16, i16* %3
%6 = call double %4(i16 signext %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_short(double (i16)* nocapture %0) {
%2 = tail call double %0(i16 signext -22)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int tty_getc(char *byte) {
  unsigned int ret = 0;
  while (ret == 0) {
    ret = sys_call(0x03, (unsigned int)byte, 1, 0, 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<tty_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1150 <tty_getc+0x40>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    $0x3,%edi
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <sys_call@plt>
mov    %eax,-0xc(%rbp)
jmp    1123 <tty_getc+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_getc>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x3,%edi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sys_call@plt>
test   %eax,%eax
je     1120 <tty_getc+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tty_getc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = ptrtoint i8* %8 to i32
%10 = call i32 @sys_call(i32 3, i32 %9, i32 1, i32 0, i32 0)
store i32 %10, i32* %3
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @tty_getc(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
br label %4
4: ; preds = %1, %4
%5 = tail call i32 @sys_call(i32 3, i32 %3, i32 1, i32 0, i32 0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
void sec2datetimestr(const time_t seconds, char *datetimestr) {
  strftime(datetimestr, 20, "%Y-%m-%d %H:%M:%S", localtime(&seconds));
}


x86 assembly (clang, -O0):
<sec2datetimestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xeae(%rip),%rdx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec2datetimestr>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define void @sec2datetimestr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %5, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define void @sec2datetimestr(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @localtime(i32* %3)
%5 = call i32 @strftime(i8* %1, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ real_renderer_set_interlace(int, int);
void renderer_set_interlace(int enable, int is_odd) {
  real_renderer_set_interlace(enable, is_odd);
}


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

x86 assembly (clang, -O2):
<renderer_set_interlace>:
jmp    1030 <real_renderer_set_interlace@plt>

LLVM IR (-O0):
define void @renderer_set_interlace(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 @real_renderer_set_interlace(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @renderer_set_interlace(i32 %0, i32 %1) {
%3 = tail call i32 @real_renderer_set_interlace(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_swap64p(int /*<<< orphan*/ *, int /*<<< orphan*/);
void cpu_to_be64p(uint64_t *outp, uint64_t in) { cpu_swap64p(outp, in); }


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

x86 assembly (clang, -O2):
<cpu_to_be64p>:
jmp    1030 <cpu_swap64p@plt>

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

LLVM IR (-O2):
define void @cpu_to_be64p(i32* %0, i32 %1) {
%3 = tail call i32 @cpu_swap64p(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestSmokeTest();
int /*<<< orphan*/ TestVersion();
void RunTests(void) {
  TestVersion();
  TestSmokeTest();
}


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

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

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

LLVM IR (-O2):
define void @RunTests() {
%1 = tail call i32 (...) @TestVersion()
%2 = tail call i32 (...) @TestSmokeTest()
ret void
}
/* Variables and functions */
double sqrt(double const);
double radius_from_diagonal(double radius, double thick_rim, double thick_face,
                            double length) {
  const double radius_tot = radius + thick_rim;
  const double length_tot = length + 2.0 * thick_face;
  return sqrt(radius_tot * radius_tot + 0.25 * length_tot * length_tot);
}


x86 assembly (clang, -O0):
<radius_from_diagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xe9c(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_from_diagonal>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movsd  0xedc(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1143 <radius_from_diagonal+0x33>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @radius_from_diagonal(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, %1
%6 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %3)
%7 = fmul double %6, 2.500000e-01
%8 = fmul double %6, %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %8)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Variables and functions */
int baz(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int /*<<< orphan*/ test_skip_file_and_function();
int main() {
  volatile int x;
  baz(foo());
  x = 0;
  x = baz(foo());
  test_skip_file_and_function();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%edi
call   1030 <baz@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%edi
call   1030 <baz@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_skip_file_and_function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%edi
call   1030 <baz@plt>
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%edi
call   1030 <baz@plt>
mov    %eax,0x4(%rsp)
xor    %eax,%eax
call   1050 <test_skip_file_and_function@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @foo()
%4 = call i32 @baz(i32 %3)
store volatile i32 0, i32* %2
%5 = call i32 (...) @foo()
%6 = call i32 @baz(i32 %5)
store volatile i32 %6, i32* %2
%7 = call i32 (...) @test_skip_file_and_function()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @baz(i32 %3)
store volatile i32 0, i32* %1
%5 = tail call i32 (...) @foo()
%6 = tail call i32 @baz(i32 %5)
store volatile i32 %6, i32* %1
%7 = tail call i32 (...) @test_skip_file_and_function()
ret i32 0
}
int getch(void) {
  __asm__ volatile("xor %ah,%ah");
  __asm__ volatile("int $0x16");
  __asm__ volatile("xor %ah,%ah");
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
xor    %ah,%ah
int    $0x16
xor    %ah,%ah
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
xor    %ah,%ah
int    $0x16
xor    %ah,%ah
ret

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

LLVM IR (-O2):
define i32 @getch() {
tail call void asm sideeffect "xor %ah,%ah", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x16", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "xor %ah,%ah", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t trunnel_get_uint32(const void *p) {
  uint32_t x;
  memcpy(&x, p, 4);
  return x;
}


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

x86 assembly (clang, -O2):
<trunnel_get_uint32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @trunnel_get_uint32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSet16BitBalanceLUT(char byBoardNum, char byChannel, short *pLUT) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSet16BitBalanceLUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSet16BitBalanceLUT(i8 signext %0, i8 signext %1, i16* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i16*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i16* %2, i16** %6
%7 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSet16BitBalanceLUT(i8 signext %0, i8 signext %1, i16* nocapture readnone %2) {
%4 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long int f(int year, int month) {
  if (month < 3)
    return year - 1;
  else
    return year;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1125 <f+0x25>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    112d <f+0x2d>
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x3,%esi
setl   %al
sub    %eax,%edi
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i64 @f(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 3
%4 = sext i1 %3 to i32
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ MON_8;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_mon_8() { return nl_langinfo(MON_8); }


x86 assembly (clang, -O0):
<langinfo_mon_8>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_mon_8>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@MON_8 = global i32 0
define i8* @langinfo_mon_8() {
%1 = load i32, i32* @MON_8
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@MON_8 = global i32 0
define i8* @langinfo_mon_8() {
%1 = load i32, i32* @MON_8
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ pmu_set_adc_period(int);
int /*<<< orphan*/ pmu_setting_temp_based(int /*<<< orphan*/);
void pmu_set_clk_init() {
  pmu_setting_temp_based(0);
  pmu_set_adc_period(1);
}


x86 assembly (clang, -O0):
<pmu_set_clk_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <pmu_setting_temp_based@plt>
mov    $0x1,%edi
call   1040 <pmu_set_adc_period@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_clk_init>:
push   %rax
xor    %edi,%edi
call   1030 <pmu_setting_temp_based@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <pmu_set_adc_period@plt>

LLVM IR (-O0):
define void @pmu_set_clk_init() {
%1 = call i32 @pmu_setting_temp_based(i32 0)
%2 = call i32 @pmu_set_adc_period(i32 1)
ret void
}

LLVM IR (-O2):
define void @pmu_set_clk_init() {
%1 = tail call i32 @pmu_setting_temp_based(i32 0)
%2 = tail call i32 @pmu_set_adc_period(i32 1)
ret void
}