xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x29() {
  Assert_real((isdigit(41) == 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",
              210, ("isdigit should be 0 for )"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x29>:
push   %rax
mov    $0x29,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xd2,%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 )\00"
define void @t_isdigit_0x29() {
%1 = call i64 @isdigit(i32 41)
%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 210, 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 )\00"
define void @t_isdigit_0x29() {
%1 = tail call i64 @isdigit(i32 41)
%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 210, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ par_open(char *);
void par_open_f_(char *filename) { par_open(filename); }


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

x86 assembly (clang, -O2):
<par_open_f_>:
jmp    1030 <par_open@plt>

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

LLVM IR (-O2):
define void @par_open_f_(i8* %0) {
%2 = tail call i32 @par_open(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_number();
int /*<<< orphan*/ create_prime();
int scanf(char *, int *, int *);
int /*<<< orphan*/ solve(int, int);
int main(void) {
  int m, n;
  create_prime();
  create_number();
  while (scanf("%d %d", &m, &n), m != 0)
    solve(m, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <create_prime@plt>
mov    $0x0,%al
call   1040 <create_number@plt>
lea    0xe9c(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     118b <main+0x4b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <solve@plt>
jmp    115d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <create_prime@plt>
xor    %eax,%eax
call   1040 <create_number@plt>
lea    0xea2(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
test   %edi,%edi
je     11af <main+0x6f>
lea    0xe84(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
call   1030 <solve@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
test   %edi,%edi
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (...) @create_prime()
%6 = tail call i32 (...) @create_number()
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %0, %10
%11 = phi i32 [ %15, %10 ], [ %8, %0 ]
%12 = load i32, i32* %2
%13 = call i32 @solve(i32 %11, i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %10
17: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MapErrorWindow(char *);
int /*<<< orphan*/ PrintErrorMessage(char *);
void Message(char *msg) {
  MapErrorWindow("E R R O R");
  (void)PrintErrorMessage(msg);
}


x86 assembly (clang, -O0):
<Message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <MapErrorWindow@plt>
mov    -0x8(%rbp),%rdi
call   1040 <PrintErrorMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Message>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <MapErrorWindow@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <PrintErrorMessage@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"E R R O R\00"
define void @Message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @MapErrorWindow(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @PrintErrorMessage(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"E R R O R\00"
define void @Message(i8* %0) {
%2 = tail call i32 @MapErrorWindow(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @PrintErrorMessage(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(char *arr, int arrLength) {
  for (int i = 0; i < arrLength; i++) {
    printf("%c ", *(arr + i));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printArr+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <printArr+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%c \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c \00"
define void @printArr(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ int32_t;
typedef scalar_t__ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__, int /*<<< orphan*/ *, int);
void ptr_set_int32_t(void *arg1, int offset, int32_t value) {
  memcpy((caddr_t)arg1 + offset, &value, sizeof(value));
}


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

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

LLVM IR (-O0):
define void @ptr_set_int32_t(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 i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
%12 = call i32 @memcpy(i64 %11, i32* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @ptr_set_int32_t(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = ptrtoint i8* %0 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %5
%8 = call i32 @memcpy(i64 %7, i32* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ calculate_sec(int, int *, int *, int *);
void test4(void) {
  int input_sec = 55;
  int sec, min, hr;
  calculate_sec(input_sec, &sec, &min, &hr);
  assert(hr == 0);
  assert(min == 0);
  assert(sec == 55);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x37,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <calculate_sec@plt>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x37,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0x37,%edi
call   1030 <calculate_sec@plt>
xor    %edi,%edi
cmpl   $0x0,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,0x10(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x37,0x14(%rsp)
sete   %dil
call   1040 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test4() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 55, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @calculate_sec(i32 %5, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 55
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test4() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @calculate_sec(i32 55, i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 55
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}
/* Variables and functions */
void *calloc(int, int);
void *zalloc(int size) { return calloc(size, 1); }


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

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

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

LLVM IR (-O2):
define noalias i8* @zalloc(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void _exit(int i) { abort(); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _ps2sdk_stdlib_deinit();
void _ps2sdk_libc_deinit() { _ps2sdk_stdlib_deinit(); }


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

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

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

LLVM IR (-O2):
define void @_ps2sdk_libc_deinit() {
%1 = tail call i32 (...) @_ps2sdk_stdlib_deinit()
ret void
}
int nrt_testing_atomic_cas(void *volatile *ptr, void *cmp, void *val,
                           void **oldptr) {
  void *old = *ptr;
  *oldptr = old;
  if (old == cmp) {
    *ptr = val;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<nrt_testing_atomic_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    114f <nrt_testing_atomic_cas+0x4f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1156 <nrt_testing_atomic_cas+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrt_testing_atomic_cas>:
mov    (%rdi),%r8
mov    %r8,(%rcx)
xor    %eax,%eax
cmp    %rsi,%r8
je     110e <nrt_testing_atomic_cas+0xe>
ret
mov    %rdx,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nrt_testing_atomic_cas(i8** %0, i8* readnone %1, i8* %2, i8** nocapture writeonly %3) {
%5 = load volatile i8*, i8** %0
store i8* %5, i8** %3
%6 = icmp eq i8* %5, %1
br i1 %6, label %7, label %8
7: ; preds = %4
store volatile i8* %2, i8** %0
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *application) {
  printf("Usage: %s [OPTION]...\n"
         "Extracts operator table from the proprietary sec-ril.\n\n"
         "Mandatory arguments to long options are mandatory for short options "
         "too.\n"
         "  -i, --input=<FILE>  use specified file as the library image.\n"
         "  -o, --output=<FILE> write SQL to specified file.\n"
         "  --version           print version information and exit.\n"
         "  --help              print this message and exit.\n",
         application);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [374 x i8] c"Usage: %s [OPTION]...\0AExtracts operator table from the proprietary sec-ril.\0A\0AMandatory arguments to long options are mandatory for short options too.\0A -i, --input=<FILE> use specified file as the library image.\0A -o, --output=<FILE> write SQL to specified file.\0A --version print version information and exit.\0A --help print this message and exit.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([374 x i8], [374 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [374 x i8] c"Usage: %s [OPTION]...\0AExtracts operator table from the proprietary sec-ril.\0A\0AMandatory arguments to long options are mandatory for short options too.\0A -i, --input=<FILE> use specified file as the library image.\0A -o, --output=<FILE> write SQL to specified file.\0A --version print version information and exit.\0A --help print this message and exit.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([374 x i8], [374 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int whoknows();
int bad(void) {
  int x = whoknows();
  int y = whoknows();
  return x - y;
}


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

x86 assembly (clang, -O2):
<bad>:
push   %rbx
xor    %eax,%eax
call   1030 <whoknows@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <whoknows@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bad() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @whoknows()
store i32 %3, i32* %1
%4 = call i32 (...) @whoknows()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bad() {
%1 = tail call i32 (...) @whoknows()
%2 = tail call i32 (...) @whoknows()
%3 = sub nsw i32 %1, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XButtonReleasedEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XButtonReleasedEvent(void) {
  XButtonReleasedEvent *_p =
      (XButtonReleasedEvent *)malloc(sizeof(XButtonReleasedEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XButtonReleasedEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XButtonReleasedEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XButtonReleasedEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XButtonReleasedEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XButtonReleasedEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XButtonReleasedEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void interrupt_disable(unsigned long dummy) {}


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

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

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

LLVM IR (-O2):
define void @interrupt_disable(i64 %0) {
ret void
}
/* Variables and functions */
char *strcat(char *, char const *);
char *genstrcat(char *dest, const char *src) { return strcat(dest, src); }


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

x86 assembly (clang, -O2):
<genstrcat>:
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define i8* @genstrcat(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main_nouse(int argc, char *argv[]) {
  int deepth = 0;
  if (argc != 2) {
    printf("Error!\nUsage:%s path\n", argv[0]);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main_nouse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114f <main_nouse+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1156 <main_nouse+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_nouse>:
xor    %eax,%eax
cmp    $0x2,%edi
je     1130 <main_nouse+0x20>
push   %rax
mov    (%rsi),%rsi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Error!\0AUsage:%s path\0A\00"
define i32 @main_nouse(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"Error!\0AUsage:%s path\0A\00"
define i32 @main_nouse(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
int mod(int n, int m) {
  if (n < 0) {
    n += (1 + (-n) / m) * m;
  }
  return n - n / m * m;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <mod+0x2a>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%eax
imul   -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
test   %edi,%edi
jns    1115 <mod+0x15>
mov    %edi,%eax
cltd
idiv   %esi
mov    $0x1,%ecx
sub    %eax,%ecx
imul   %esi,%ecx
add    %ecx,%edi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub nsw i32 0, %8
%10 = load i32, i32* %4
%11 = sdiv i32 %9, %10
%12 = add nsw i32 1, %11
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %7, %2
%18 = load i32, i32* %3
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = sdiv i32 %19, %20
%22 = load i32, i32* %4
%23 = mul nsw i32 %21, %22
%24 = sub nsw i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = sdiv i32 %0, %1
%6 = sub i32 1, %5
%7 = mul nsw i32 %6, %1
%8 = add nsw i32 %7, %0
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ %8, %4 ], [ %0, %2 ]
%11 = srem i32 %10, %1
ret i32 %11
}
int B(int c, int d) { return c + d; }


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

x86 assembly (clang, -O2):
<B>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @B(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @B(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int rm(char *, int);
int remove(char *path, int isDir) {
  int a = rm(path, isDir);
  return a;
}


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

x86 assembly (clang, -O2):
<remove>:
jmp    1030 <rm@plt>

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

LLVM IR (-O2):
define i32 @remove(i8* %0, i32 %1) {
%3 = tail call i32 @rm(i8* %0, i32 %1)
ret i32 %3
}
int mystrlen(char *str) {
  int i = 0;
  while (*str++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <mystrlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
cmpb   $0x0,(%rdi)
je     111c <mystrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(int);
void errexit(char opt) {
  fprintf(stderr, "in flag -%c\n", opt);
  usage(1);
}


x86 assembly (clang, -O0):
<errexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <usage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errexit>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <usage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"in flag -%c\0A\00"
define void @errexit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @stderr
%4 = load i8, i8* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = call i32 @usage(i32 1)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"in flag -%c\0A\00"
define void @errexit(i8 signext %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%4 = tail call i32 @usage(i32 1)
ret void
}
int doublecmp(const void *p1, const void *p2) {
  double a = *((double *)p1);
  double b = *((double *)p2);
  if (a > b)
    return (1);
  if (a < b)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<doublecmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1142 <doublecmp+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1169 <doublecmp+0x69>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <doublecmp+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <doublecmp+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doublecmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @doublecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pwmOff();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
void closePwm() {
  printf("Chiudo pwm\n\r");
  pwmOff();
  printf("unexport\n\r");
  system("echo 0 > /sys/class/pwm/pwmchip0/unexport");
  system("echo 1 > /sys/class/pwm/pwmchip0/unexport");
  sleep(1);
}


x86 assembly (clang, -O0):
<closePwm>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <pwmOff@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1030 <system@plt>
lea    0xecc(%rip),%rdi
call   1030 <system@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<closePwm>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <pwmOff@plt>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <system@plt>
lea    0xecf(%rip),%rdi
call   1030 <system@plt>
mov    $0x1,%edi
pop    %rax
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Chiudo pwm\0A\0D\00"
@.str.1 = [11 x i8] c"unexport\0A\0D\00"
@.str.2 = [42 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/unexport\00"
@.str.3 = [42 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/unexport\00"
define void @closePwm() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @pwmOff()
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Chiudo pwm\0A\0D\00"
@.str.1 = [11 x i8] c"unexport\0A\0D\00"
@.str.2 = [42 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/unexport\00"
@.str.3 = [42 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/unexport\00"
define void @closePwm() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @pwmOff()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: ul [-i] [-t terminal] [file ...]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: ul [-i] [-t terminal] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: ul [-i] [-t terminal] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
char desdeA(int n) { return 97 + n; }


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

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

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

LLVM IR (-O2):
define signext i8 @desdeA(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 97
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ gator_hrtimer_offline(int /*<<< orphan*/);
int /*<<< orphan*/ smp_processor_id();
void gator_hrtimer_switch_cpus_offline(void *unused) {
  gator_hrtimer_offline(smp_processor_id());
}


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

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

LLVM IR (-O0):
define void @gator_hrtimer_switch_cpus_offline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @smp_processor_id()
%4 = call i32 @gator_hrtimer_offline(i32 %3)
ret void
}

LLVM IR (-O2):
define void @gator_hrtimer_switch_cpus_offline(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @smp_processor_id()
%3 = tail call i32 @gator_hrtimer_offline(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ my_str(char *);
void sig_bye() {
  my_str("\nSignal server exiting.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_bye>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <my_str@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_bye>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <my_str@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0ASignal server exiting.\0A\00"
define void @sig_bye() {
%1 = call i32 @my_str(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0ASignal server exiting.\0A\00"
define void @sig_bye() {
%1 = tail call i32 @my_str(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ X_OK;
int access(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ *strstr(char const *, char *);
int can_start(const char *command) {
  if (strstr(command, "/") != NULL) {
    return (access(command, X_OK) != -1);
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<can_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     116b <can_start+0x4b>
mov    -0x10(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <can_start+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_start>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1150 <can_start+0x30>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <access@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@X_OK = global i32 0
define i32 @can_start(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @X_OK
%6 = tail call i32 @access(i8* %0, i32 %5)
%7 = icmp ne i32 %6, -1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 1, %1 ]
ret i32 %10
}
/* Variables and functions */
int is_perfect(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int num, perf;
  printf("Digite o número que deseja saber se é perfeito : ");
  scanf("%d", &num);
  perf = is_perfect(num);
  printf("%d", perf);
  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)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <is_perfect@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeea(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <is_perfect@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Digite o n\C3\BAmero que deseja saber se \C3\A9 perfeito : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%10 = load i32, i32* %6
%11 = call i32 @is_perfect(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"Digite o n\C3\BAmero que deseja saber se \C3\A9 perfeito : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @is_perfect(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_padding(char ch, int n) {
  int i;
  for (i = 0; i < n; i++)
    putchar(ch);
}


x86 assembly (clang, -O0):
<print_padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <print_padding+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <print_padding+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_padding>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <print_padding+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_padding+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print_padding(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_padding(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t msr_unset_bit(uint64_t val, int bit) {
  uint64_t m = ~(1 << bit);
  return (val & m);
}


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

x86 assembly (clang, -O2):
<msr_unset_bit>:
mov    %edi,%eax
btr    %esi,%eax
ret

LLVM IR (-O0):
define i32 @msr_unset_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = and i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @msr_unset_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}