xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ processFile(char *, int /*<<< orphan*/);
void handleObjectFile(char *filename) { processFile(filename, 0); }


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

x86 assembly (clang, -O2):
<handleObjectFile>:
xor    %esi,%esi
jmp    1030 <processFile@plt>

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

LLVM IR (-O2):
define void @handleObjectFile(i8* %0) {
%2 = tail call i32 @processFile(i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(stderr, "crkfind - Look for CROOK-5 kernels in a file.\n"
                  "Usage: crkfind filename\n");
}


x86 assembly (clang, -O0):
<help>:
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):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"crkfind - Look for CROOK-5 kernels in a file.\0AUsage: crkfind filename\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"crkfind - Look for CROOK-5 kernels in a file.\0AUsage: crkfind filename\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sqrt(double);
double reflhorfunc(double absorptivity) {
  double rho;
  rho = (1.0 - sqrt(absorptivity)) / (1.0 + sqrt(absorptivity));
  return (rho);
}


x86 assembly (clang, -O0):
<reflhorfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reflhorfunc>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
sqrtsd %xmm0,%xmm1
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
movapd %xmm1,%xmm0
jae    114f <reflhorfunc+0x3f>
movapd %xmm2,%xmm0
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
call   1030 <sqrt@plt>
xorpd  %xmm4,%xmm4
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
movsd  0xea9(%rip),%xmm3
subsd  %xmm0,%xmm3
ucomisd %xmm4,%xmm2
jae    117a <reflhorfunc+0x6a>
movapd %xmm2,%xmm0
movsd  %xmm3,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm1
addsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @reflhorfunc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @sqrt(double %4)
%6 = fsub double 1.000000e+00, %5
%7 = load double, double* %2
%8 = call double @sqrt(double %7)
%9 = fadd double 1.000000e+00, %8
%10 = fdiv double %6, %9
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @reflhorfunc(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = fsub double 1.000000e+00, %2
%4 = tail call double @sqrt(double %0)
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
ret double %6
}
void f5(enum E{A} * a) {}


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

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

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

LLVM IR (-O2):
define void @f5(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t get_unaligned_be16(const void *ptr) {
  const uint8_t *p = ptr;
  return p[0] << 8 | p[1];
}


x86 assembly (clang, -O0):
<get_unaligned_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_be16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_unaligned_be16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_unaligned_be16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ dcl_rbig();
int /*<<< orphan*/ dcl_reight();
int /*<<< orphan*/ dcl_rfour();
int /*<<< orphan*/ dcl_rone();
int /*<<< orphan*/ dcl_rtwo();
void test_1(void) {
  dcl_rone();
  dcl_rtwo();
  dcl_rfour();
  dcl_reight();
  dcl_rbig();
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <dcl_rone@plt>
mov    $0x0,%al
call   1040 <dcl_rtwo@plt>
mov    $0x0,%al
call   1060 <dcl_rfour@plt>
mov    $0x0,%al
call   1030 <dcl_reight@plt>
mov    $0x0,%al
call   1070 <dcl_rbig@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rax
xor    %eax,%eax
call   1050 <dcl_rone@plt>
xor    %eax,%eax
call   1040 <dcl_rtwo@plt>
xor    %eax,%eax
call   1060 <dcl_rfour@plt>
xor    %eax,%eax
call   1030 <dcl_reight@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <dcl_rbig@plt>

LLVM IR (-O0):
define void @test_1() {
%1 = call i32 (...) @dcl_rone()
%2 = call i32 (...) @dcl_rtwo()
%3 = call i32 (...) @dcl_rfour()
%4 = call i32 (...) @dcl_reight()
%5 = call i32 (...) @dcl_rbig()
ret void
}

LLVM IR (-O2):
define void @test_1() {
%1 = tail call i32 (...) @dcl_rone()
%2 = tail call i32 (...) @dcl_rtwo()
%3 = tail call i32 (...) @dcl_rfour()
%4 = tail call i32 (...) @dcl_reight()
%5 = tail call i32 (...) @dcl_rbig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void sigsys_handler(int signo) {
  errx(1, "System V Semaphore support is not present in the kernel");
}


x86 assembly (clang, -O0):
<sigsys_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed9(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsys_handler>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"System V Semaphore support is not present in the kernel\00"
define void @sigsys_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @errx(i32 1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"System V Semaphore support is not present in the kernel\00"
define void @sigsys_handler(i32 %0) {
%2 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pow257(int, int);
int mkoff_b_f(int i) {
  return (pow257(41, 255 * i) + pow257(41, 253 * i)) % 257;
}


x86 assembly (clang, -O0):
<mkoff_b_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xff,-0x4(%rbp),%esi
mov    $0x29,%edi
call   1030 <pow257@plt>
mov    %eax,-0x8(%rbp)
imul   $0xfd,-0x4(%rbp),%esi
mov    $0x29,%edi
call   1030 <pow257@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    $0x101,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkoff_b_f>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%esi
shl    $0x8,%esi
sub    %edi,%esi
mov    $0x29,%edi
call   1030 <pow257@plt>
mov    %eax,%ebp
imul   $0xfd,%ebx,%esi
mov    $0x29,%edi
call   1030 <pow257@plt>
add    %ebp,%eax
cltq
imul   $0x7f807f81,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x8,%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mkoff_b_f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 255, %3
%5 = call i32 @pow257(i32 41, i32 %4)
%6 = load i32, i32* %2
%7 = mul nsw i32 253, %6
%8 = call i32 @pow257(i32 41, i32 %7)
%9 = add nsw i32 %5, %8
%10 = srem i32 %9, 257
ret i32 %10
}

LLVM IR (-O2):
define i32 @mkoff_b_f(i32 %0) {
%2 = mul nsw i32 %0, 255
%3 = tail call i32 @pow257(i32 41, i32 %2)
%4 = mul nsw i32 %0, 253
%5 = tail call i32 @pow257(i32 41, i32 %4)
%6 = add nsw i32 %5, %3
%7 = srem i32 %6, 257
ret i32 %7
}
void ARGBToARGB1555Row_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB1555Row_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("hello world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void null_pruning1_Good(int *p) {
  if (p == 0) {
    if (p != 0) {
      int a[5];
      a[10] = 1;
    }
  }
}


x86 assembly (clang, -O0):
<null_pruning1_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112a <null_pruning1_Good+0x2a>
cmpq   $0x0,-0x8(%rbp)
je     1125 <null_pruning1_Good+0x25>
movl   $0x1,0x8(%rbp)
jmp    112a <null_pruning1_Good+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_pruning1_Good(i32* %0) {
%2 = alloca i32*
%3 = alloca [5 x i32]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 10
store i32 1, i32* %10
br label %11
11: ; preds = %9, %6
br label %12
12: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @null_pruning1_Good(i32* nocapture %0) {
ret void
}
int execute_break() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_break() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ r4030_delay();
extern unsigned short r4030_read_reg16(unsigned addr) {
  unsigned short ret = *((volatile unsigned short *)addr);
  r4030_delay();
  return ret;
}


x86 assembly (clang, -O0):
<r4030_read_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%ax
mov    %ax,-0x6(%rbp)
mov    $0x0,%al
call   1030 <r4030_delay@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4030_read_reg16>:
push   %rbx
mov    %edi,%eax
movzwl (%rax),%ebx
xor    %eax,%eax
call   1030 <r4030_delay@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @r4030_read_reg16(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
store i16 %7, i16* %3
%8 = call i32 (...) @r4030_delay()
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @r4030_read_reg16(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i16*
%4 = load volatile i16, i16* %3
%5 = tail call i32 (...) @r4030_delay()
ret i16 %4
}
void wr_info(const char *s, int v) {}


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

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

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

LLVM IR (-O2):
define void @wr_info(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void f(void) {
  printf("2nd strong f from %s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/wcnnbdk1/hello_world/refs/heads/master/"
         "CLearning/CPrimerPlus/chap09/s2.c");
}


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

x86 assembly (clang, -O2):
<f>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"2nd strong f from %s\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/wcnnbdk1/hello_world/refs/heads/master/CLearning/CPrimerPlus/chap09/s2.c\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"2nd strong f from %s\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/wcnnbdk1/hello_world/refs/heads/master/CLearning/CPrimerPlus/chap09/s2.c\00"
define void @f() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int uptime();
int main(int argc, char *argv[]) {
  fprintf(stdout, "uptime: %d minutes\n", (uptime() / 100 / 60));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <uptime@plt>
mov    -0x14(%rbp),%edi
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <uptime@plt>
cltq
imul   $0x57619f1,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x27,%rdx
add    %eax,%edx
lea    0xeb2(%rip),%rsi
mov    %ebx,%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [20 x i8] c"uptime: %d minutes\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* @stdout
%7 = call i32 (...) @uptime()
%8 = sdiv i32 %7, 100
%9 = sdiv i32 %8, 60
%10 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [20 x i8] c"uptime: %d minutes\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 (...) @uptime()
%5 = sdiv i32 %4, 6000
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void fa90(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
p0B:
  goto p0B;
  goto a;
a:
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa90>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa90+0x4>

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

LLVM IR (-O0):
define void @fa90() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa90() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int get_val_impl(int *, int);
int get_val(int *p, int x) { return get_val_impl(p, x); }


x86 assembly (clang, -O0):
<get_val>:
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 <get_val_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_val>:
jmp    1030 <get_val_impl@plt>

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

LLVM IR (-O2):
define i32 @get_val(i32* %0, i32 %1) {
%3 = tail call i32 @get_val_impl(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIOCATMARK;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int sockatmark(int s) {
  int ret;
  if (ioctl(s, SIOCATMARK, &ret) < 0)
    return -1;
  return ret;
}


x86 assembly (clang, -O0):
<sockatmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1146 <sockatmark+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <sockatmark+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockatmark>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1135 <sockatmark+0x25>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SIOCATMARK = global i32 0
define i32 @sockatmark(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SIOCATMARK
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) {
  printf("Caught signal being tested!\n");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Caught signal being tested!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Caught signal being tested!\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
void mdea_json_emitter_destroy(void *p) { struct mdea_json_emitter *e = p; }


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

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

LLVM IR (-O0):
%struct.mdea_json_emitter = type opaque
define void @mdea_json_emitter_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.mdea_json_emitter*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.mdea_json_emitter*
store %struct.mdea_json_emitter* %5, %struct.mdea_json_emitter** %3
ret void
}

LLVM IR (-O2):
define void @mdea_json_emitter_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int tests_dir_list();
int main(int argc, char **argv) {
  int failures;
  failures = tests_dir_list();
  if (failures)
    exit(EXIT_FAILURE);
  else
    exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <tests_dir_list@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1158 <main+0x38>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <tests_dir_list@plt>
test   %eax,%eax
jne    113a <main+0x1a>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @tests_dir_list()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @tests_dir_list()
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo2();
void foo1(void) { foo2(); }


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

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

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

LLVM IR (-O2):
define void @foo1() {
%1 = tail call i32 (...) @foo2()
ret void
}
char ByteToChar(unsigned int Int) {
  Int += 0x30;
  return Int;
}


x86 assembly (clang, -O0):
<ByteToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ByteToChar>:
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @ByteToChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 48
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @ByteToChar(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ Delay(short, long *);
void HoldIt(short ticksToWait) {
  long dummyLong;
  Delay(ticksToWait, &dummyLong);
}


x86 assembly (clang, -O0):
<HoldIt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x10(%rbp),%rsi
movswl -0x2(%rbp),%edi
call   1030 <Delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HoldIt>:
push   %rax
mov    %rsp,%rsi
call   1030 <Delay@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @HoldIt(i16 signext %0) {
%2 = alloca i16
%3 = alloca i64
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 @Delay(i16 signext %4, i64* %3)
ret void
}

LLVM IR (-O2):
define void @HoldIt(i16 signext %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @Delay(i16 signext %0, i64* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("hello, C");
  int x = 5;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"hello, C\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 5, i32* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"hello, C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OPLinkSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void OPLinkSettingsUpdated() { UAVObjUpdated(OPLinkSettingsHandle()); }


x86 assembly (clang, -O0):
<OPLinkSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OPLinkSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPLinkSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <OPLinkSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

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

LLVM IR (-O2):
define void @OPLinkSettingsUpdated() {
%1 = tail call i32 (...) @OPLinkSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stack *);
void stack_destroy(struct stack *stack) { free(stack); }


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

x86 assembly (clang, -O2):
<stack_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @stack_destroy(%struct.stack* %0) {
%2 = alloca %struct.stack*
store %struct.stack* %0, %struct.stack** %2
%3 = load %struct.stack*, %struct.stack** %2
%4 = call i32 @free(%struct.stack* %3)
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @stack_destroy(%struct.stack* nocapture %0) {
%2 = tail call i32 @free(%struct.stack* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ sdb_do_log(int);
int sdb_error_vprintf(char const *, int /*<<< orphan*/);
int sdb_vlog(int prio, const char *fmt, va_list ap) {
  int ret = sdb_error_vprintf(fmt, ap);
  if (ret > 0)
    sdb_do_log(prio);
  return ret;
}


x86 assembly (clang, -O0):
<sdb_vlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <sdb_error_vprintf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1153 <sdb_vlog+0x33>
mov    -0x4(%rbp),%edi
call   1040 <sdb_do_log@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_vlog>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <sdb_error_vprintf@plt>
mov    %eax,%ebp
test   %eax,%eax
jle    113c <sdb_vlog+0x1c>
mov    %ebx,%edi
call   1040 <sdb_do_log@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sdb_vlog(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @sdb_error_vprintf(i8* %1, i32 %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @sdb_do_log(i32 %0)
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t round_down_to_nearest_power_2(uint64_t n) {
  uint64_t res = 0;
  for (uint64_t i = n; i >= 1; i--) {
    if ((i & (i - 1)) == 0) {
      res = i;
      break;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<round_down_to_nearest_power_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1150 <round_down_to_nearest_power_2+0x50>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    113d <round_down_to_nearest_power_2+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <round_down_to_nearest_power_2+0x50>
jmp    1142 <round_down_to_nearest_power_2+0x42>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <round_down_to_nearest_power_2+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_down_to_nearest_power_2>:
xor    %eax,%eax
test   %edi,%edi
jle    111e <round_down_to_nearest_power_2+0x1e>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
test   %ecx,%edi
je     111f <round_down_to_nearest_power_2+0x1f>
cmp    $0x1,%edi
mov    %ecx,%edi
jg     1110 <round_down_to_nearest_power_2+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @round_down_to_nearest_power_2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = tail call i32 @llvm.ctpop.i32(i32 %4)
%6 = icmp ult i32 %5, 2
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = icmp sgt i32 %4, 1
br i1 %9, label %3, label %10
10: ; preds = %7, %3, %1
%11 = phi i32 [ 0, %1 ], [ %4, %3 ], [ 0, %7 ]
ret i32 %11
}
void TimerMatchSet64(unsigned long ulBase, unsigned long long ullValue) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000034))) = ullValue >> 32;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) = ullValue & 0xffffffff;
}


x86 assembly (clang, -O0):
<TimerMatchSet64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
shr    $0x20,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x34(%rax)
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerMatchSet64>:
mov    %esi,%eax
shr    $0x20,%rsi
mov    %rsi,0x34(%rdi)
mov    %rax,0x30(%rdi)
ret

LLVM IR (-O0):
define void @TimerMatchSet64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = lshr i64 %5, 32
%7 = load i64, i64* %3
%8 = add i64 %7, 52
%9 = inttoptr i64 %8 to i64*
store volatile i64 %6, i64* %9
%10 = load i64, i64* %4
%11 = and i64 %10, 4294967295
%12 = load i64, i64* %3
%13 = add i64 %12, 48
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @TimerMatchSet64(i64 %0, i64 %1) {
%3 = lshr i64 %1, 32
%4 = add i64 %0, 52
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
%6 = and i64 %1, 4294967295
%7 = add i64 %0, 48
%8 = inttoptr i64 %7 to i64*
store volatile i64 %6, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
size_t strlcat(char *, char const *, size_t);
size_t estrlcat(char *dst, const char *src, size_t siz) {
  size_t ret;
  if ((ret = strlcat(dst, src, siz)) >= siz)
    eprintf("strlcat: input string too long\n");
  return ret;
}


x86 assembly (clang, -O0):
<estrlcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcat@plt>
mov    %rax,-0x20(%rbp)
cmp    -0x18(%rbp),%rax
jb     115f <estrlcat+0x3f>
lea    0xea6(%rip),%rdi
call   1040 <eprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrlcat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1030 <strlcat@plt>
mov    %rax,%r14
cmp    %rbx,%rax
jb     1140 <estrlcat+0x20>
lea    0xec5(%rip),%rdi
call   1040 <eprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"strlcat: input string too long\0A\00"
define i64 @estrlcat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @strlcat(i8* %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = icmp uge i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @eprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i64, i64* %7
ret i64 %17
}

LLVM IR (-O2):
@.str = [32 x i8] c"strlcat: input string too long\0A\00"
define i64 @estrlcat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlcat(i8* %0, i8* %1, i64 %2)
%5 = icmp ult i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @eprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
int first(int);
int rest(int);
int at(int list, int i) { return i > 0 ? at(rest(list), i - 1) : first(list); }


x86 assembly (clang, -O0):
<at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1165 <at+0x35>
mov    -0x4(%rbp),%edi
call   1030 <rest@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1050 <at@plt>
mov    %eax,-0xc(%rbp)
jmp    1170 <at+0x40>
mov    -0x4(%rbp),%edi
call   1040 <first@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at>:
push   %rbx
mov    %edi,%eax
test   %esi,%esi
jle    113f <at+0x1f>
mov    %esi,%ebx
add    $0x1,%ebx
nopl   0x0(%rax)
mov    %eax,%edi
call   1030 <rest@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <at+0x10>
mov    %eax,%edi
pop    %rbx
jmp    1040 <first@plt>

LLVM IR (-O0):
define i32 @at(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @rest(i32 %8)
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = call i32 @at(i32 %9, i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %3
%15 = call i32 @first(i32 %14)
br label %16
16: ; preds = %13, %7
%17 = phi i32 [ %12, %7 ], [ %15, %13 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @at(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = tail call i32 @rest(i32 %6)
%8 = add nsw i32 %5, -1
%9 = icmp ugt i32 %5, 1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ %0, %2 ], [ %7, %4 ]
%12 = tail call i32 @first(i32 %11)
ret i32 %12
}
unsigned setbits(unsigned x, int p, int n, unsigned y) {
  return (x & ((~0 << (p + 1)) | (~(~0 << (p + 1 - n))))) |
         ((y & ~(~0 << n)) << (p + 1 - n));
}


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

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%r9d
add    $0x1,%esi
mov    $0xffffffff,%eax
mov    $0xffffffff,%r10d
mov    %esi,%ecx
shl    %cl,%r10d
sub    %edx,%esi
mov    $0xffffffff,%edx
mov    %esi,%ecx
shl    %cl,%edx
not    %edx
mov    %r9d,%ecx
shl    %cl,%eax
or     %r10d,%edx
and    %edi,%edx
not    %eax
and    %r8d,%eax
mov    %esi,%ecx
shl    %cl,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, 1
%6 = shl nsw i32 -1, %5
%7 = sub nsw i32 %5, %2
%8 = shl nsw i32 -1, %7
%9 = xor i32 %8, -1
%10 = or i32 %6, %9
%11 = and i32 %10, %0
%12 = shl nsw i32 -1, %2
%13 = xor i32 %12, -1
%14 = and i32 %13, %3
%15 = shl i32 %14, %7
%16 = or i32 %11, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_54() {
  Assert_real((isqrt(54) == 7),
              "/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/stdlib/isqrt.c",
              275, ("Integer square root of 54 should be 7"));
}


x86 assembly (clang, -O0):
<t_sqrt_54>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
call   1030 <isqrt@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x113,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_54>:
push   %rax
mov    $0x36,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x113,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 54 should be 7\00"
define void @t_sqrt_54() {
%1 = call i32 @isqrt(i32 54)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 54 should be 7\00"
define void @t_sqrt_54() {
%1 = tail call i32 @isqrt(i32 54)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char encrypt(char plaintext, int a, int b) {
  int offset = 97;
  if (plaintext < 97)
    offset = 65;
  return (((a * (plaintext - offset) + b) % 26) + offset);
}


x86 assembly (clang, -O0):
<encrypt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x61,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jge    112b <encrypt+0x2b>
movl   $0x41,-0x10(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
add    -0xc(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%edx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt>:
xor    %eax,%eax
cmp    $0x61,%dil
setge  %al
shl    $0x5,%eax
lea    0x41(%rax),%ecx
sub    %ecx,%edi
imul   %esi,%edi
add    %edx,%edi
movslq %edi,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%ecx
add    %ecx,%eax
add    $0x41,%eax
ret

LLVM IR (-O0):
define signext i8 @encrypt(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 97, i32* %7
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 97
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 65, i32* %7
br label %12
12: ; preds = %11, %3
%13 = load i32, i32* %5
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = load i32, i32* %7
%17 = sub nsw i32 %15, %16
%18 = mul nsw i32 %13, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %18, %19
%21 = srem i32 %20, 26
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
%24 = trunc i32 %23 to i8
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @encrypt(i8 signext %0, i32 %1, i32 %2) {
%4 = sext i8 %0 to i32
%5 = icmp slt i8 %0, 97
%6 = select i1 %5, i32 65, i32 97
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, %1
%9 = add nsw i32 %8, %2
%10 = srem i32 %9, 26
%11 = add nsw i32 %10, %6
%12 = trunc i32 %11 to i8
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ minscanf(char *, char *, int *, float *);
int /*<<< orphan*/ printf(char *, char *, int, float);
int main(int argc, char *argv[]) {
  char name[100];
  int age;
  float salary;
  minscanf("%s %d %f", name, &age, &salary);
  printf("My name is %s, age %d, salary %f\n", name, age, salary);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xebc(%rip),%rdi
lea    -0x84(%rbp),%rdx
lea    -0x88(%rbp),%rcx
call   1040 <minscanf@plt>
lea    -0x80(%rbp),%rsi
mov    -0x84(%rbp),%edx
movss  -0x88(%rbp),%xmm0
ff
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xed1(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rsi
call   1040 <minscanf@plt>
mov    0xc(%rsp),%edx
movss  0x8(%rsp),%xmm0
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s %d %f\00"
@.str.1 = [34 x i8] c"My name is %s, age %d, salary %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = call i32 @minscanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %9, i32* %7, float* %8)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* %7
%13 = load float, float* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12, float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s %d %f\00"
@.str.1 = [34 x i8] c"My name is %s, age %d, salary %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca i32
%5 = alloca float
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = bitcast float* %5 to i8*
%9 = call i32 @minscanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, i32* %4, float* %5)
%10 = load i32, i32* %4
%11 = load float, float* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %10, float %11)
ret i32 0
}