xunge/DecIR huggingface dataset:
/* Variables and functions */
int complex(int, int);
int main() {
  int a = 1, b = 1, answer = 0;
  answer = complex(a, b);
  return answer;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <complex@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @complex(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @complex(i32 1, i32 1)
ret i32 %1
}
unsigned int getbits(unsigned int x, unsigned int p, unsigned int n) {
  return (x >> (p + 1 - n)) & ~(~0U << n);
}


x86 assembly (clang, -O0):
<getbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits>:
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shr    %cl,%edi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add i32 %8, 1
%10 = load i32, i32* %6
%11 = sub i32 %9, %10
%12 = lshr i32 %7, %11
%13 = load i32, i32* %6
%14 = shl i32 -1, %13
%15 = xor i32 %14, -1
%16 = and i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, 1
%5 = sub i32 %4, %2
%6 = lshr i32 %0, %5
%7 = shl nsw i32 -1, %2
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(float *, int, int, int /*<<< orphan*/ *);
float freadf(FILE *fIn) {
  float fTemp;
  fread(&fTemp, sizeof(float), 1, fIn);
  return fTemp;
}


x86 assembly (clang, -O0):
<freadf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freadf>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @freadf(i32* %0) {
%2 = alloca i32*
%3 = alloca float
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(float* %3, i32 4, i32 1, i32* %4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @freadf(i32* nocapture %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @fread(float* %2, i32 4, i32 1, i32* %0)
%5 = load float, float* %2
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a = 255;
  int b = &a;
  printf("%d \n", b);
  b = b + 1;
  printf("%d \n", b);
  b = b + 4;
  printf("%d \n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xff,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0xff,0x4(%rsp)
lea    0x4(%rsp),%rbx
lea    0xed8(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0x1(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x5,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 255, i32* %1
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = or i32 %4, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add i32 %4, 5
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
void permitUnusedLong(long l) {}


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

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

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

LLVM IR (-O2):
define void @permitUnusedLong(i64 %0) {
ret void
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 4 * 0x00100 | 1 * 0x00001;
}


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

x86 assembly (clang, -O2):
<http_parser_version>:
mov    $0x20401,%eax
ret

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 132097
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 132097
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
int init_module() {
  panic("dopanic: init_module calls panic");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"dopanic: init_module calls panic\00"
define i32 @init_module() {
%1 = call i32 @panic(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"dopanic: init_module calls panic\00"
define i32 @init_module() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Mod1_StdControl_init();
int main(void) {
  Mod1_StdControl_init();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Mod1_StdControl_init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x6d() {
  Assert_real((isdigit(109) == 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_isdigit.c",
              550, ("isdigit should be 0 for m"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x6d>:
push   %rax
mov    $0x6d,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x226,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for m\00"
define void @t_isdigit_0x6d() {
%1 = call i64 @isdigit(i32 109)
%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 550, i8* getelementptr inbounds ([26 x i8], [26 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for m\00"
define void @t_isdigit_0x6d() {
%1 = tail call i64 @isdigit(i32 109)
%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 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int banner() {
  fprintf(stderr,
          "hpe_open %s HPE file compressor/decompressor\n(c) 2014 Jacek "
          "Lipkowski SQ5BPF\n",
          "0.2");
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
lea    0xf1f(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"hpe_open %s HPE file compressor/decompressor\0A(c) 2014 Jacek Lipkowski SQ5BPF\0A\00"
@.str.1 = [4 x i8] c"0.2\00"
define i32 @banner() {
%1 = alloca i32
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"hpe_open %s HPE file compressor/decompressor\0A(c) 2014 Jacek Lipkowski SQ5BPF\0A\00"
@.str.1 = [4 x i8] c"0.2\00"
define i32 @banner() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double find_nth_double(double *, int, int);
double median_double(double *array, int n_elements) {
  return find_nth_double(array, n_elements, (n_elements - 1) / 2);
}


x86 assembly (clang, -O0):
<median_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <find_nth_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_double>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <find_nth_double@plt>

LLVM IR (-O0):
define double @median_double(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call double @find_nth_double(double* %5, i32 %6, i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @median_double(double* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call double @find_nth_double(double* %0, i32 %1, i32 %4)
ret double %5
}
/* Variables and functions */
char *strdup(char const *);
char *jv_mem_strdup_unguarded(const char *s) { return strdup(s); }


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

x86 assembly (clang, -O2):
<jv_mem_strdup_unguarded>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @jv_mem_strdup_unguarded(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int timedif(struct timeval a, struct timeval b) {
  register int us, s;
  us = a.tv_usec - b.tv_usec;
  us /= 1000;
  s = a.tv_sec - b.tv_sec;
  s *= 1000;
  return s + us;
}


x86 assembly (clang, -O0):
<timedif>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0x3e8,-0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timedif>:
mov    %rdi,%rax
shr    $0x20,%rax
sub    %esi,%edi
shr    $0x20,%rsi
movslq %edi,%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
sub    %esi,%eax
imul   $0x3e8,%eax,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timedif(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = alloca i32
%6 = alloca i32
%7 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %7
%8 = bitcast %struct.timeval* %4 to i64*
store i64 %1, i64* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = sdiv i32 %14, 1000
store i32 %15, i32* %5
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%19 = load i32, i32* %18
%20 = sub nsw i32 %17, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, 1000
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @timedif(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = trunc i64 %1 to i32
%7 = lshr i64 %1, 32
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %3, %6
%10 = sdiv i32 %9, 1000
%11 = sub nsw i32 %5, %8
%12 = mul nsw i32 %11, 1000
%13 = add nsw i32 %12, %10
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rdtsc();
uint32_t RDTSC(void) { return (uint32_t)(rdtsc()); }


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

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

LLVM IR (-O0):
define i32 @RDTSC() {
%1 = call i32 (...) @rdtsc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @RDTSC() {
%1 = tail call i32 (...) @rdtsc()
ret i32 %1
}
/* Type definitions */
struct mtop {
  int mt_op;
  scalar_t__ mt_count;
};
typedef scalar_t__ daddr_t;

/* Variables and functions */
int /*<<< orphan*/ MTIOCTOP;
int /*<<< orphan*/ err(int, char *);
scalar_t__ ioctl(int, int /*<<< orphan*/, char *);
void writeop(int fd, int type) {
  struct mtop op;
  op.mt_op = type;
  op.mt_count = (daddr_t)1;
  if (ioctl(fd, MTIOCTOP, (char *)&op) < 0)
    err(6, "tape op");
}


x86 assembly (clang, -O0):
<writeop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    116c <writeop+0x4c>
mov    $0x6,%edi
lea    0xe99(%rip),%rsi
call   1040 <err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeop>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movq   $0x1,0x10(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <ioctl@plt>
test   %rax,%rax
js     114e <writeop+0x2e>
add    $0x18,%rsp
ret
lea    0xeab(%rip),%rsi
mov    $0x6,%edi
call   1040 <err@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.mtop = type { i32, i64 }
@MTIOCTOP = global i32 0
@.str = [8 x i8] c"tape op\00"
define void @writeop(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.mtop
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.mtop, %struct.mtop* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.mtop, %struct.mtop* %5, i32 0, i32 1
store i64 1, i64* %8
%9 = load i32, i32* %3
%10 = load i32, i32* @MTIOCTOP
%11 = bitcast %struct.mtop* %5 to i8*
%12 = call i64 @ioctl(i32 %9, i32 %10, i8* %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @err(i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
%struct.mtop = type { i32, i64 }
@MTIOCTOP = global i32 0
@.str = [8 x i8] c"tape op\00"
define void @writeop(i32 %0, i32 %1) {
%3 = alloca %struct.mtop
%4 = bitcast %struct.mtop* %3 to i8*
%5 = getelementptr inbounds %struct.mtop, %struct.mtop* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.mtop, %struct.mtop* %3, i64 0, i32 1
store i64 1, i64* %6
%7 = load i32, i32* @MTIOCTOP
%8 = call i64 @ioctl(i32 %0, i32 %7, i8* %4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @err(i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ ceilf(float const);
void ceil_l_s(const float *source, int64_t *dest) {
  *dest = (int64_t)ceilf(*source);
}


x86 assembly (clang, -O0):
<ceil_l_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <ceilf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_l_s>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <ceilf@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ceil_l_s(float* %0, i64* %1) {
%3 = alloca float*
%4 = alloca i64*
store float* %0, float** %3
store i64* %1, i64** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = call i64 @ceilf(float %6)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @ceil_l_s(float* nocapture %0, i64* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = tail call i64 @ceilf(float %3)
store i64 %4, i64* %1
ret void
}
int astG3DCap(int cap, int value) { return 0; }


x86 assembly (clang, -O0):
<astG3DCap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @astG3DCap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @astG3DCap(i32 %0, i32 %1) {
ret i32 0
}
void X509_CRL_get_ext_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CRL_get_ext_by_NID() {
ret void
}
unsigned long gcd(unsigned long a, unsigned long b) {
  unsigned long c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <gcd+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rax
test   %rdi,%rdi
je     1135 <gcd+0x35>
mov    %rdi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %0, %2 ]
%6 = phi i64 [ %5, %4 ], [ %1, %2 ]
%7 = urem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %1, %2 ], [ %5, %4 ]
ret i64 %10
}
char *get_options(const char *str, int nints, int *ints) {
  *ints = 0;
  return (char *)str;
}


x86 assembly (clang, -O0):
<get_options>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_options>:
mov    %rdi,%rax
movl   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @get_options(i8* readnone returned %0, i32 %1, i32* nocapture writeonly %2) {
store i32 0, i32* %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "Usage: arduino-serial -p <serialport> [OPTIONS]\n"
      "\n"
      "Options:\n"
      "  -h, --help                   Print this help message\n"
      "  -p, --port=serialport        Serial port Arduino is on\n"
      "  -b, --baud=baudrate          Baudrate (bps) of Arduino\n"
      "  -s, --send=data              Send data to Arduino\n"
      "  -r, --receive                Receive data from Arduino & print it "
      "out\n"
      "  -n  --num=num                Send a number as a single byte\n"
      "  -d  --delay=millis           Delay for specified milliseconds\n"
      "\n"
      "Note: Order is important. Set '-b' before doing '-p'. \n"
      "      Used to make series of actions:  '-d 2000 -s hello -d 100 -r' \n"
      "      means 'wait 2secs, send 'hello', wait 100msec, get reply'\n"
      "\n");
}


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

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

LLVM IR (-O0):
@.str = [668 x i8] c"Usage: arduino-serial -p <serialport> [OPTIONS]\0A\0AOptions:\0A -h, --help Print this help message\0A -p, --port=serialport Serial port Arduino is on\0A -b, --baud=baudrate Baudrate (bps) of Arduino\0A -s, --send=data Send data to Arduino\0A -r, --receive Receive data from Arduino & print it out\0A -n --num=num Send a number as a single byte\0A -d --delay=millis Delay for specified milliseconds\0A\0ANote: Order is important. Set '-b' before doing '-p'. \0A Used to make series of actions: '-d 2000 -s hello -d 100 -r' \0A means 'wait 2secs, send 'hello', wait 100msec, get reply'\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([668 x i8], [668 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [667 x i8] c"Usage: arduino-serial -p <serialport> [OPTIONS]\0A\0AOptions:\0A -h, --help Print this help message\0A -p, --port=serialport Serial port Arduino is on\0A -b, --baud=baudrate Baudrate (bps) of Arduino\0A -s, --send=data Send data to Arduino\0A -r, --receive Receive data from Arduino & print it out\0A -n --num=num Send a number as a single byte\0A -d --delay=millis Delay for specified milliseconds\0A\0ANote: Order is important. Set '-b' before doing '-p'. \0A Used to make series of actions: '-d 2000 -s hello -d 100 -r' \0A means 'wait 2secs, send 'hello', wait 100msec, get reply'\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([667 x i8], [667 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertStringsEqual(char *, int /*<<< orphan*/);
int /*<<< orphan*/ call_vsnprintf(char *, long, char *);
void test_long_int() {
  assertStringsEqual(
      "Hello Bob at coordinate 42",
      call_vsnprintf("Hello %2$s at coordinate %1$d", 42L, "Bob"));
}


x86 assembly (clang, -O0):
<test_long_int>:
push   %rbp
mov    %rsp,%rbp
lea    0xef0(%rip),%rdi
mov    $0x2a,%esi
lea    0xf02(%rip),%rdx
call   1030 <call_vsnprintf@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1040 <assertStringsEqual@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long_int>:
push   %rax
lea    0xef3(%rip),%rdi
lea    0xf0a(%rip),%rdx
mov    $0x2a,%esi
call   1030 <call_vsnprintf@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <assertStringsEqual@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Hello Bob at coordinate 42\00"
@.str.1 = [30 x i8] c"Hello %2$s at coordinate %1$d\00"
@.str.2 = [4 x i8] c"Bob\00"
define void @test_long_int() {
%1 = call i32 @call_vsnprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i64 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @assertStringsEqual(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Hello Bob at coordinate 42\00"
@.str.1 = [30 x i8] c"Hello %2$s at coordinate %1$d\00"
@.str.2 = [4 x i8] c"Bob\00"
define void @test_long_int() {
%1 = tail call i32 @call_vsnprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i64 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @assertStringsEqual(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void eglGetCurrentDisplay(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglGetCurrentDisplay() {
ret void
}
int test_imm_81uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x81 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_81uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x81,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_81uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 554050781184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void out8(unsigned short port, unsigned char value) {
  __asm__ volatile("outb %0, %1" : : "a"(value), "d"(port));
}


x86 assembly (clang, -O0):
<out8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<out8>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @out8(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $0, $1", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BuYi_bind();
int /*<<< orphan*/ JiXiaJianFa_bind();
int /*<<< orphan*/ MeiYing_bind();
int /*<<< orphan*/ MoZiJianFa_bind();
int /*<<< orphan*/ SouXin_bind();
int /*<<< orphan*/ ZhanXuan_bind();
int /*<<< orphan*/ ZhenJiXia_bind();
int /*<<< orphan*/ ZhenMoZi_bind();
void JZ_Ability_init() {
  BuYi_bind();
  JiXiaJianFa_bind();
  MeiYing_bind();
  MoZiJianFa_bind();
  SouXin_bind();
  ZhanXuan_bind();
  ZhenJiXia_bind();
  ZhenMoZi_bind();
}


x86 assembly (clang, -O0):
<JZ_Ability_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <BuYi_bind@plt>
mov    $0x0,%al
call   1080 <JiXiaJianFa_bind@plt>
mov    $0x0,%al
call   1090 <MeiYing_bind@plt>
mov    $0x0,%al
call   1030 <MoZiJianFa_bind@plt>
mov    $0x0,%al
call   1050 <SouXin_bind@plt>
mov    $0x0,%al
call   1060 <ZhanXuan_bind@plt>
mov    $0x0,%al
call   1040 <ZhenJiXia_bind@plt>
mov    $0x0,%al
call   10a0 <ZhenMoZi_bind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<JZ_Ability_init>:
push   %rax
xor    %eax,%eax
call   1070 <BuYi_bind@plt>
xor    %eax,%eax
call   1080 <JiXiaJianFa_bind@plt>
xor    %eax,%eax
call   1090 <MeiYing_bind@plt>
xor    %eax,%eax
call   1030 <MoZiJianFa_bind@plt>
xor    %eax,%eax
call   1050 <SouXin_bind@plt>
xor    %eax,%eax
call   1060 <ZhanXuan_bind@plt>
xor    %eax,%eax
call   1040 <ZhenJiXia_bind@plt>
xor    %eax,%eax
pop    %rcx
jmp    10a0 <ZhenMoZi_bind@plt>

LLVM IR (-O0):
define void @JZ_Ability_init() {
%1 = call i32 (...) @BuYi_bind()
%2 = call i32 (...) @JiXiaJianFa_bind()
%3 = call i32 (...) @MeiYing_bind()
%4 = call i32 (...) @MoZiJianFa_bind()
%5 = call i32 (...) @SouXin_bind()
%6 = call i32 (...) @ZhanXuan_bind()
%7 = call i32 (...) @ZhenJiXia_bind()
%8 = call i32 (...) @ZhenMoZi_bind()
ret void
}

LLVM IR (-O2):
define void @JZ_Ability_init() {
%1 = tail call i32 (...) @BuYi_bind()
%2 = tail call i32 (...) @JiXiaJianFa_bind()
%3 = tail call i32 (...) @MeiYing_bind()
%4 = tail call i32 (...) @MoZiJianFa_bind()
%5 = tail call i32 (...) @SouXin_bind()
%6 = tail call i32 (...) @ZhanXuan_bind()
%7 = tail call i32 (...) @ZhenJiXia_bind()
%8 = tail call i32 (...) @ZhenMoZi_bind()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EPERM;
char *mystrerror(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void *threadFunc(void *arg) {
  char *str;
  printf("Other thread about to call mystrerror()\n");
  str = mystrerror(EPERM);
  printf("Other thread: str (%p) = %s\n", str, str);
  return NULL;
}


x86 assembly (clang, -O0):
<threadFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <mystrerror@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadFunc>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <mystrerror@plt>
lea    0xeae(%rip),%rdi
mov    %rax,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Other thread about to call mystrerror()\0A\00"
@EPERM = global i32 0
@.str.1 = [29 x i8] c"Other thread: str (%p) = %s\0A\00"
define i8* @threadFunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EPERM
%6 = call i8* @mystrerror(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
ret i8* null
}

LLVM IR (-O2):
@EPERM = global i32 0
@.str.1 = [29 x i8] c"Other thread: str (%p) = %s\0A\00"
@str = [40 x i8] c"Other thread about to call mystrerror()\00"
define noalias i8* @threadFunc(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EPERM
%4 = tail call i8* @mystrerror(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %4)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ pet_watchdog();
void touch_hw_watchdog(void) { pet_watchdog(); }


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

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

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

LLVM IR (-O2):
define void @touch_hw_watchdog() {
%1 = tail call i32 (...) @pet_watchdog()
ret void
}
void av_read_play() {}


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

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

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

LLVM IR (-O2):
define void @av_read_play() {
ret void
}
int strlen2(char *s) {
  char *p2 = s;
  while (*p2 != '\0') {
    p2++;
  }
  return p2 - s;
}


x86 assembly (clang, -O0):
<strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen2+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen2+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen2(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *emalloc(size_t size) {
  void *p;
  p = calloc(1, size);
  if (!p) {
    fprintf(stderr, "libcmml: memory allocation error.");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <emalloc+0x48>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
test   %rax,%rax
je     1145 <emalloc+0x15>
pop    %rcx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"libcmml: memory allocation error.\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"libcmml: memory allocation error.\00"
define i8* @emalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void time_bad() {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
}


x86 assembly (clang, -O0):
<time_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_bad>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @time_bad() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @time_bad() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
ret void
}
/* Variables and functions */
int lengthOfLongestSubstring2(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  if (argc < 2) {
    return 0;
  }
  printf("%d\n", lengthOfLongestSubstring2(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <lengthOfLongestSubstring2@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1141 <main+0x21>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <lengthOfLongestSubstring2@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @lengthOfLongestSubstring2(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 0, i32* %3
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @lengthOfLongestSubstring2(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %2, %4
ret i32 0
}
void set_curr_task_idle(struct rq *rq) {}


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

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

LLVM IR (-O0):
%struct.rq = type opaque
define void @set_curr_task_idle(%struct.rq* %0) {
%2 = alloca %struct.rq*
store %struct.rq* %0, %struct.rq** %2
ret void
}

LLVM IR (-O2):
%struct.rq = type opaque
define void @set_curr_task_idle(%struct.rq* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nRF24L01P_setRxAddress(unsigned long long, int, int);
void nRF24L01P_setRxAddressNL(unsigned long msb_address,
                              unsigned long lsb_address, int width, int pipe) {
  unsigned long long address = (((unsigned long long)msb_address) << 32) |
                               (((unsigned long long)lsb_address) << 0);
  nRF24L01P_setRxAddress(address, width, pipe);
}


x86 assembly (clang, -O0):
<nRF24L01P_setRxAddressNL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
mov    -0x10(%rbp),%rcx
shl    $0x0,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <nRF24L01P_setRxAddress@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nRF24L01P_setRxAddressNL>:
shl    $0x20,%rdi
or     %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <nRF24L01P_setRxAddress@plt>

LLVM IR (-O0):
define void @nRF24L01P_setRxAddressNL(i64 %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i64, i64* %5
%11 = shl i64 %10, 32
%12 = load i64, i64* %6
%13 = shl i64 %12, 0
%14 = or i64 %11, %13
store i64 %14, i64* %9
%15 = load i64, i64* %9
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @nRF24L01P_setRxAddress(i64 %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @nRF24L01P_setRxAddressNL(i64 %0, i64 %1, i32 %2, i32 %3) {
%5 = shl i64 %0, 32
%6 = or i64 %5, %1
%7 = tail call i32 @nRF24L01P_setRxAddress(i64 %6, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void PrintNumbers(int num1, int num2) {
  printf("num1 = %d\n", num1);
  printf("num2 = %d\n", num2);
}


x86 assembly (clang, -O0):
<PrintNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintNumbers>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"num1 = %d\0A\00"
@.str.1 = [11 x i8] c"num2 = %d\0A\00"
define void @PrintNumbers(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 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"num1 = %d\0A\00"
@.str.1 = [11 x i8] c"num2 = %d\0A\00"
define void @PrintNumbers(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}