xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int pfd[2];
  pipe(pfd);
  printf("Pipe read end desc is %d\n", pfd[0]);
  printf("Pipe write end desc is %d\n", pfd[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <pipe@plt>
mov    (%rsp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Pipe read end desc is %d\0A\00"
@.str.1 = [27 x i8] c"Pipe write end desc is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Pipe read end desc is %d\0A\00"
@.str.1 = [27 x i8] c"Pipe write end desc is %d\0A\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
char *escape_field(char *);
char *escape_string(char *source_destination) {
  return escape_field(source_destination);
}


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

x86 assembly (clang, -O2):
<escape_string>:
jmp    1030 <escape_field@plt>

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

LLVM IR (-O2):
define i8* @escape_string(i8* %0) {
%2 = tail call i8* @escape_field(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_dialog_hide_i(char const *);
void roadmap_coord_cancel(const char *name, void *data) {
  roadmap_dialog_hide_i(name);
}


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

x86 assembly (clang, -O2):
<roadmap_coord_cancel>:
jmp    1030 <roadmap_dialog_hide_i@plt>

LLVM IR (-O0):
define void @roadmap_coord_cancel(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 = call i32 @roadmap_dialog_hide_i(i8* %5)
ret void
}

LLVM IR (-O2):
define void @roadmap_coord_cancel(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @roadmap_dialog_hide_i(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void putchr(char ch) { write(1, &ch, 1); }


x86 assembly (clang, -O0):
<putchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchr>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putchr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @putchr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xdf() {
  Assert_real((isprint(223) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1120, ("isprint should be 0 for 0xdf"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xdf>:
push   %rax
mov    $0xdf,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x460,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xdf\00"
define void @t_isprint_0xdf() {
%1 = call i64 @isprint(i32 223)
%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 1120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xdf\00"
define void @t_isprint_0xdf() {
%1 = tail call i64 @isprint(i32 223)
%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 1120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void handler2(int sig) {
  write(1, "Async action on sigint (2)\n",
        sizeof("Async action on sigint (2)\n") - 1);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Async action on sigint (2)\0A\00"
define void @handler2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Async action on sigint (2)\0A\00"
define void @handler2(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Chen Small X\n");
  printf("Chen\nSmall\nX\n");
  printf("Chen ");
  printf("Small ");
  printf("X\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>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Chen Small X\0A\00"
@.str.1 = [14 x i8] c"Chen\0ASmall\0AX\0A\00"
@.str.2 = [6 x i8] c"Chen \00"
@.str.3 = [7 x i8] c"Small \00"
@.str.4 = [3 x i8] c"X\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))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"Chen \00"
@.str.3 = [7 x i8] c"Small \00"
@str = [13 x i8] c"Chen Small X\00"
@str.5 = [13 x i8] c"Chen\0ASmall\0AX\00"
@str.6 = [2 x i8] c"X\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))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
__uint128_t foo(void) {
  __uint128_t a = -1;
  __uint128_t b = -1;
  return a / b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
movq   $0xffffffffffffffff,-0x28(%rbp)
ff
movq   $0xffffffffffffffff,-0x30(%rbp)
ff
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1160 <__udivti3>
mov    %rdx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%eax
xor    %edx,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @foo() {
%1 = alloca i128
%2 = alloca i128
%3 = alloca i128
store i128 -1, i128* %2
store i128 -1, i128* %3
%4 = load i128, i128* %2
%5 = load i128, i128* %3
%6 = udiv i128 %4, %5
store i128 %6, i128* %1
%7 = bitcast i128* %1 to { i64, i64 }*
%8 = load { i64, i64 }, { i64, i64 }* %7
ret { i64, i64 } %8
}

LLVM IR (-O2):
define { i64, i64 } @foo() {
ret { i64, i64 } { i64 1, i64 0 }
}
/* Variables and functions */
int inb(int);
int is_transmit_empty(int port) { return inb(port + 5) & (0x01 << 5); }


x86 assembly (clang, -O0):
<is_transmit_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x5,%edi
call   1030 <inb@plt>
and    $0x20,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_transmit_empty>:
push   %rax
add    $0x5,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_transmit_empty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 5
%5 = call i32 @inb(i32 %4)
%6 = and i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_transmit_empty(i32 %0) {
%2 = add nsw i32 %0, 5
%3 = tail call i32 @inb(i32 %2)
%4 = and i32 %3, 32
ret i32 %4
}
/* Variables and functions */
double pow(double, int);
double int_power(double x, int y) { return pow(x, y); }


x86 assembly (clang, -O0):
<int_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_power>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @int_power(double %0, i32 %1) {
%3 = tail call double @pow(double %0, i32 %1)
ret double %3
}
int chroot(s)
char *s;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @chroot(i8* nocapture readnone %0) {
ret i32 0
}
int owWriteBytePower(int portnum, int sendbyte) {
  portnum = 0;
  sendbyte = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @owWriteBytePower(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t now_nsec(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * ((uint64_t)1000 * 1000 * 1000) + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<now_nsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now_nsec>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @now_nsec() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @now_nsec() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
double mylog(x)
double x;
{
  if (x > 0)
    return (log(x));
  else {
    printf("Log (%lf) = \n", x);
    return (0);
  }
}


x86 assembly (clang, -O0):
<mylog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <mylog+0x33>
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    116e <mylog+0x4e>
movsd  -0x10(%rbp),%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mylog>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112f <mylog+0xf>
jmp    1040 <log@plt>
push   %rax
lea    0xec9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Log (%lf) = \0A\00"
define double @mylog(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @log(double %7)
store double %8, double* %2
br label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %10)
store double 0.000000e+00, double* %2
br label %12
12: ; preds = %9, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"Log (%lf) = \0A\00"
define double @mylog(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @log(double %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ 0.000000e+00, %5 ]
ret double %8
}
void foo801(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo801(i32 %0) {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *pls_entry_get_value(char *line) {
  char *i;
  i = strchr(line, '=');
  if (!i || i[1] == '\0')
    return NULL;
  else
    return i + 1;
}


x86 assembly (clang, -O0):
<pls_entry_get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <pls_entry_get_value+0x3a>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1157 <pls_entry_get_value+0x47>
movq   $0x0,-0x8(%rbp)
jmp    1163 <pls_entry_get_value+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pls_entry_get_value>:
push   %rax
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1136 <pls_entry_get_value+0x26>
mov    %rax,%rcx
mov    %rax,%rdx
add    $0x1,%rdx
xor    %eax,%eax
cmpb   $0x0,0x1(%rcx)
cmovne %rdx,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @pls_entry_get_value(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* null, i8* %5
br label %9
9: ; preds = %4, %1
%10 = phi i8* [ null, %1 ], [ %8, %4 ]
ret i8* %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT16_MAX;
uint32_t reg_val_to_clk_val(uint32_t val) { return val & UINT16_MAX; }


x86 assembly (clang, -O0):
<reg_val_to_clk_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_val_to_clk_val>:
mov    %edi,%eax
mov    0x2ed7(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@UINT16_MAX = global i32 0
define i32 @reg_val_to_clk_val(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @UINT16_MAX
%5 = and i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@UINT16_MAX = global i32 0
define i32 @reg_val_to_clk_val(i32 %0) {
%2 = load i32, i32* @UINT16_MAX
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ isalpha(char const);
size_t countalpha(const char *str) {
  size_t ret = 0;
  while (*str) {
    if (isalpha(*str))
      ++ret;
    ++str;
  }
  return ret;
}


x86 assembly (clang, -O0):
<countalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <countalpha+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1153 <countalpha+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <countalpha+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countalpha>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114d <countalpha+0x3d>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <isalpha@plt>
cmp    $0x1,%rax
sbb    $0xffffffffffffffff,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <countalpha+0x20>
jmp    1150 <countalpha+0x40>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @countalpha(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = tail call i64 @isalpha(i8 signext %5)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = add i64 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %16
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long Athena_GetMillisecondTicks() {
  struct timeval t;
  gettimeofday(&t, NULL);
  {
    unsigned long time_ms = t.tv_sec * 1000;
    time_ms += t.tv_usec / 1000;
    return time_ms;
  }
}


x86 assembly (clang, -O0):
<Athena_GetMillisecondTicks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Athena_GetMillisecondTicks>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @Athena_GetMillisecondTicks() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sext i32 %6 to i64
store i64 %7, i64* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
%12 = load i64, i64* %2
%13 = add i64 %12, %11
store i64 %13, i64* %2
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @Athena_GetMillisecondTicks() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %7
ret i64 %12
}
void kopiuj2(char *tab1, char *tab2) {
  while (*tab2++ = *tab1++)
    ;
}


x86 assembly (clang, -O0):
<kopiuj2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <kopiuj2+0x3b>
jmp    110c <kopiuj2+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kopiuj2>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <kopiuj2+0x10>
ret

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

LLVM IR (-O2):
define void @kopiuj2(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int hwlist_sensor_type(const char *value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hwlist_sensor_type(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int isfinite(double);
int aa_isfinite(double l) { return isfinite(l); }


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

x86 assembly (clang, -O2):
<aa_isfinite>:
jmp    1030 <isfinite@plt>

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

LLVM IR (-O2):
define i32 @aa_isfinite(double %0) {
%2 = tail call i32 @isfinite(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _call_send_func(void *, void *, char *, int);
void _iobeam_generic_EndHeaders(void *obj, void *func) {
  _call_send_func(obj, func, "\r\n", sizeof("\r\n") - 1);
}


x86 assembly (clang, -O0):
<_iobeam_generic_EndHeaders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
mov    $0x2,%ecx
call   1030 <_call_send_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_iobeam_generic_EndHeaders>:
lea    0xee9(%rip),%rdx
mov    $0x2,%ecx
jmp    1030 <_call_send_func@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @_iobeam_generic_EndHeaders(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 i32 @_call_send_func(i8* %5, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @_iobeam_generic_EndHeaders(i8* %0, i8* %1) {
%3 = tail call i32 @_call_send_func(i8* %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
double log2(double x) { return 0; }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @log2(double %0) {
ret double 0.000000e+00
}
void *foo(char *a, int c, long len) { return __builtin_memset(a, c, len); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @foo(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
scalar_t__ EINTR;
int /*<<< orphan*/ FIONBIO;
scalar_t__ errno;
int ioctl(int, int /*<<< orphan*/, int *);
int voip_sock_nonblock(int fd, int set) {
  int r;
  do
    r = ioctl(fd, FIONBIO, &set);
  while (r == -1 && errno == EINTR);
  return r;
}


x86 assembly (clang, -O0):
<voip_sock_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    115f <voip_sock_nonblock+0x4f>
mov    0x2e94(%rip),%rax
mov    (%rax),%rax
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111e <voip_sock_nonblock+0xe>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voip_sock_nonblock>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,0xc(%rsp)
mov    0x2eae(%rip),%r15
lea    0xc(%rsp),%r14
mov    0x2eaa(%rip),%r12
mov    0x2e93(%rip),%r13
nopl   (%rax)
mov    (%r15),%esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    115c <voip_sock_nonblock+0x4c>
mov    0x0(%r13),%rcx
cmp    %rcx,(%r12)
je     1140 <voip_sock_nonblock+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
@errno = global i64 0
@EINTR = global i64 0
define i32 @voip_sock_nonblock(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %3
%8 = load i32, i32* @FIONBIO
%9 = call i32 @ioctl(i32 %7, i32 %8, i32* %4)
store i32 %9, i32* %5
br label %10
10: ; preds = %6
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i64, i64* @errno
%15 = load i64, i64* @EINTR
%16 = icmp eq i64 %14, %15
br label %17
17: ; preds = %13, %10
%18 = phi i1 [ false, %10 ], [ %16, %13 ]
br i1 %18, label %6, label %19
19: ; preds = %17
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@FIONBIO = global i32 0
@errno = global i64 0
@EINTR = global i64 0
define i32 @voip_sock_nonblock(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
br label %4
4: ; preds = %4, %2
%5 = load i32, i32* @FIONBIO
%6 = call i32 @ioctl(i32 %0, i32 %5, i32* %3)
%7 = icmp eq i32 %6, -1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
%11 = select i1 %7, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
float VoltRawToFloat(uint16_t raw) { return ((float)raw) * 0.0001f; }


x86 assembly (clang, -O0):
<VoltRawToFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<VoltRawToFloat>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @VoltRawToFloat(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fmul float %4, 0x3F1A36E2E0000000
ret float %5
}

LLVM IR (-O2):
define float @VoltRawToFloat(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 0x3F1A36E2E0000000
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *);
void badfmt(const char *fmt) { errx(1, "\"%s\": bad format", fmt); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\22%s\22: bad format\00"
define void @badfmt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @errx(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\22%s\22: bad format\00"
define void @badfmt(i8* %0) {
%2 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int O_NOCTTY;
int O_RDWR;
int open(char *, int);
int getpt(void) { return open("/dev/ptmx", O_RDWR | O_NOCTTY); }


x86 assembly (clang, -O0):
<getpt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
lea    0xed3(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpt>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xed7(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
define i32 @getpt() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %1, %2
%4 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
define i32 @getpt() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void v_free_align(void *pA) { free(pA); }


x86 assembly (clang, -O0):
<v_free_align>:
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):
<v_free_align>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @v_free_align(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void *Cyc_Dict_intersect_f(void *(*f)(void *, void *, void *), void *a,
                           void *b1, void *b2) {
  void *_T0;
  _T0 = f(a, b1, b2);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Dict_intersect_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   *%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Dict_intersect_f>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    *%rax

LLVM IR (-O0):
define i8* @Cyc_Dict_intersect_f(i8* (i8*, i8*, i8*)* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8* (i8*, i8*, i8*)*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* (i8*, i8*, i8*)* %0, i8* (i8*, i8*, i8*)** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8* (i8*, i8*, i8*)*, i8* (i8*, i8*, i8*)** %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i8* %10(i8* %11, i8* %12, i8* %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
ret i8* %15
}

LLVM IR (-O2):
define i8* @Cyc_Dict_intersect_f(i8* (i8*, i8*, i8*)* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i8* %0(i8* %1, i8* %2, i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ keyedit_trap_exit(int);
void op_keytrap() { keyedit_trap_exit(2); }


x86 assembly (clang, -O0):
<op_keytrap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <keyedit_trap_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_keytrap>:
mov    $0x2,%edi
jmp    1030 <keyedit_trap_exit@plt>

LLVM IR (-O0):
define void @op_keytrap() {
%1 = call i32 @keyedit_trap_exit(i32 2)
ret void
}

LLVM IR (-O2):
define void @op_keytrap() {
%1 = tail call i32 @keyedit_trap_exit(i32 2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void avpriv_codec2_make_extradata(uint8_t *ptr, int mode) {
  ptr[0] = 0;
  ptr[1] = 8;
  ptr[2] = mode;
  ptr[3] = 0;
}


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

x86 assembly (clang, -O2):
<avpriv_codec2_make_extradata>:
movabs $0x800000000,%rax
mov    %rax,(%rdi)
mov    %esi,0x8(%rdi)
movl   $0x0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @avpriv_codec2_make_extradata(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 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 8, i32* %8
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 2
store i32 %9, i32* %11
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 0, i32* %13
ret void
}

LLVM IR (-O2):
define void @avpriv_codec2_make_extradata(i32* nocapture writeonly %0, i32 %1) {
store i32 0, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 8, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %1, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 3
store i32 0, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int mask, number;
  scanf("%d %d", &mask, &number);
  int what_bit = (number >> mask) & 1;
  printf("%d", what_bit);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%cl
shr    %cl,%esi
and    $0x1,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
scalar_t__ test_dual();
int test_swap();
int main() {
  if (test_dual()) {
    return 1;
  }
  printf("[+] passed dual test\n");
  return test_swap();
  sleep(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_dual@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1172 <main+0x42>
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test_swap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_dual@plt>
test   %rax,%rax
je     1144 <main+0x14>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_swap@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"[+] passed dual test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_dual()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_swap()
store i32 %7, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [21 x i8] c"[+] passed dual test\00"
define i32 @main() {
%1 = tail call i64 (...) @test_dual()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @test_swap()
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 1, %0 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ isspace(char);
void trim_start(char **l) {
  while (isspace(**l)) {
    (*l)++;
  }
}


x86 assembly (clang, -O0):
<trim_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <trim_start+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <trim_start+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_start>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     113a <trim_start+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <trim_start+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trim_start(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int match(char *dest, char *src) { return !strcasecmp(dest, src); }


x86 assembly (clang, -O0):
<match>:
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 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rax
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @match(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 i32 @strcasecmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}