xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void work_a_3378324598_3212880686_init() {
  xsi_register_didat(
      "work_a_3378324598_3212880686",
      "isim/tb_idea_isim_beh.exe.sim/work/a_3378324598_3212880686.didat");
}


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

x86 assembly (clang, -O2):
<work_a_3378324598_3212880686_init>:
lea    0xee9(%rip),%rdi
lea    0xeff(%rip),%rsi
jmp    1030 <xsi_register_didat@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"work_a_3378324598_3212880686\00"
@.str.1 = [65 x i8] c"isim/tb_idea_isim_beh.exe.sim/work/a_3378324598_3212880686.didat\00"
define void @work_a_3378324598_3212880686_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"work_a_3378324598_3212880686\00"
@.str.1 = [65 x i8] c"isim/tb_idea_isim_beh.exe.sim/work/a_3378324598_3212880686.didat\00"
define void @work_a_3378324598_3212880686_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  if (s && f) {
    while (s[i]) {
      f(i, &s[i]);
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <ft_striteri+0x69>
cmpq   $0x0,-0x10(%rbp)
je     1169 <ft_striteri+0x69>
jmp    1132 <ft_striteri+0x32>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1164 <ft_striteri+0x64>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <ft_striteri+0x32>
jmp    1169 <ft_striteri+0x69>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striteri+0x33>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
xor    %ebx,%ebx
mov    %r15,%rsi
nop
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i32, i8*)*
%5 = alloca i32
store i8* %0, i8** %3
store void (i32, i8*)* %1, void (i32, i8*)** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %29
8: ; preds = %2
%9 = load void (i32, i8*)*, void (i32, i8*)** %4
%10 = icmp ne void (i32, i8*)* %9, null
br i1 %10, label %11, label %29
11: ; preds = %8
br label %12
12: ; preds = %19, %11
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %12
%20 = load void (i32, i8*)*, void (i32, i8*)** %4
%21 = load i32, i32* %5
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i32, i32* %5
%27 = add i32 %26, 1
store i32 %27, i32* %5
br label %12
28: ; preds = %12
br label %29
29: ; preds = %28, %8, %2
ret void
}

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %14, %9 ], [ %0, %6 ]
%11 = phi i32 [ %12, %9 ], [ 0, %6 ]
tail call void %1(i32 %11, i8* %10)
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
unsigned int EPFP_exponent_to_IEEE_exponent(unsigned int e) {
  return e + (1023 - 128);
}


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

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

LLVM IR (-O0):
define i32 @EPFP_exponent_to_IEEE_exponent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 895
ret i32 %4
}

LLVM IR (-O2):
define i32 @EPFP_exponent_to_IEEE_exponent(i32 %0) {
%2 = add i32 %0, 895
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq0(unsigned char *, long long);
void vt100_DECTCEMh(void) {
  vt100_EscSeq0((unsigned char *)"\?25h", (long long)5);
}


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

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <vt100_EscSeq0@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"?25h\00"
define void @vt100_DECTCEMh() {
%1 = call i32 @vt100_EscSeq0(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"?25h\00"
define void @vt100_DECTCEMh() {
%1 = tail call i32 @vt100_EscSeq0(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5)
ret void
}
/* Variables and functions */
int write(int, unsigned char *, int);
int kiss_platform_serial_write(int handle, unsigned char *data, int count) {
  return write(handle, data, count);
}


x86 assembly (clang, -O0):
<kiss_platform_serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kiss_platform_serial_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @kiss_platform_serial_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
double rnd(r)
double r;
{
  int i;
  double f;
  i = (rand() & 0xffff);
  f = r * (((double)(i)) / 65536.0);
  return (f);
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
movzwl %ax,%eax
cvtsi2sd %eax,%xmm1
mulsd  0xed4(%rip),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rnd(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
%5 = call i32 (...) @rand()
%6 = and i32 %5, 65535
store i32 %6, i32* %3
%7 = load double, double* %2
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 6.553600e+04
%11 = fmul double %7, %10
store double %11, double* %4
%12 = load double, double* %4
ret double %12
}

LLVM IR (-O2):
define double @rnd(double %0) {
%2 = tail call i32 (...) @rand()
%3 = and i32 %2, 65535
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3EF0000000000000
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  i = 9384;
  do {
    printf("%d\n", i);
    i /= 10;
  } while (i > 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x24a8,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x24a8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3aa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5d,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9384)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 938)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 93)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int get_byte(FILE *fp) {
  static int offset = 0;
  int inByte;
  inByte = fgetc(fp);
  offset++;
  return inByte;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2efe(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef5(%rip)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
push   %rax
call   1030 <fgetc@plt>
addl   $0x1,0x2f0f(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@get_byte.offset = internal global i32 0
define i32 @get_byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* @get_byte.offset
%7 = add nsw i32 %6, 1
store i32 %7, i32* @get_byte.offset
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@get_byte.offset = internal unnamed_addr global i32 0
define i32 @get_byte(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @get_byte.offset
%4 = add nsw i32 %3, 1
store i32 %4, i32* @get_byte.offset
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CodecRegWrite(unsigned int, int, int);
void AIC31Reset(unsigned int baseAddr) {
  CodecRegWrite(baseAddr, (0), 0);
  CodecRegWrite(baseAddr, (1), (0x80));
}


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

x86 assembly (clang, -O2):
<AIC31Reset>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <CodecRegWrite@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x80,%edx
pop    %rbx
jmp    1030 <CodecRegWrite@plt>

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

LLVM IR (-O2):
define void @AIC31Reset(i32 %0) {
%2 = tail call i32 @CodecRegWrite(i32 %0, i32 0, i32 0)
%3 = tail call i32 @CodecRegWrite(i32 %0, i32 1, i32 128)
ret void
}
void emit_type_definition_universe(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_type_definition_universe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_universe(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_universe(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isprint(int);
scalar_t__ ispunct(int);
scalar_t__ isspace(int);
int is_EOE(int c) {
  return ((!isprint(c)) || ispunct(c) || isspace(c)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_EOE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
je     117f <is_EOE+0x4f>
mov    -0x4(%rbp),%edi
call   1030 <ispunct@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    117f <is_EOE+0x4f>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_EOE>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
mov    $0x1,%ebx
test   %eax,%eax
je     115e <is_EOE+0x2e>
mov    %ebp,%edi
call   1030 <ispunct@plt>
test   %rax,%rax
jne    115e <is_EOE+0x2e>
mov    %ebp,%edi
call   1040 <isspace@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_EOE(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isprint(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @ispunct(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i64 @isspace(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_EOE(i32 %0) {
%2 = tail call i32 @isprint(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64 @ispunct(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @isspace(i32 %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
void ccvt_yuyv_rgb32(int width, int height, const void *src, void *dst) {}


x86 assembly (clang, -O0):
<ccvt_yuyv_rgb32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ccvt_yuyv_rgb32(i32 %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
char *scopyn(char const *, size_t);
size_t strlen(char const *);
char *scopy(const char *p) {
  size_t l = strlen(p);
  return scopyn(p, l);
}


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

x86 assembly (clang, -O2):
<scopy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <scopyn@plt>

LLVM IR (-O0):
define i8* @scopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i8* @scopyn(i8* %6, i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @scopy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i8* @scopyn(i8* %0, i64 %2)
ret i8* %3
}
unsigned char *serialize_uchar(unsigned char *dest, unsigned char *src,
                               int len) {
  assert(dest);
  assert(src);
  assert(len);
  memcpy(dest, src, len);
  dest += len;
  return dest;
}


x86 assembly (clang, -O0):
<serialize_uchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_uchar>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <assert@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <assert@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movslq %ebp,%rbp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1040 <memcpy@plt>
add    %rbp,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @serialize_uchar(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %7)
%9 = load i8*, i8** %5
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %9)
%11 = load i32, i32* %6
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = load i32, i32* %6
%18 = load i8*, i8** %4
%19 = sext i32 %17 to i64
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8* %20, i8** %4
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
define i8* @serialize_uchar(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %2)
%7 = sext i32 %2 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %7, i1 false)
%8 = getelementptr inbounds i8, i8* %0, i64 %7
ret i8* %8
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print_util(pid_t id, int start_time, int end_time) {
  printf("%d, %d, %d\n", id, start_time, end_time);
}


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

x86 assembly (clang, -O2):
<print_util>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d, %d, %d\0A\00"
define void @print_util(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int strccmp(char *, char *);
int scomp(const void *p1, const void *p2) {
  char *s1, *s2;
  s1 = (char *)(*((void **)(p1)));
  s2 = (char *)(*((void **)(p2)));
  return strccmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<scomp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strccmp@plt>

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

LLVM IR (-O2):
define i32 @scomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strccmp(i8* %4, i8* %6)
ret i32 %7
}
arrcpy(target, source) short *target, *source;
{
  while (*target++ = *source++)
    ;
}


x86 assembly (clang, -O0):
<arrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%ax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ax,(%rcx)
cmp    $0x0,%ax
je     113f <arrcpy+0x3f>
jmp    110c <arrcpy+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @arrcpy(i16* nocapture writeonly %0, i16* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i16* [ %0, %2 ], [ %8, %3 ]
%5 = phi i16* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %5
%8 = getelementptr inbounds i16, i16* %4, i64 1
store i16 %7, i16* %4
%9 = icmp eq i16 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 undef
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, char *, int);
int getKeyerSpeed(int fd) {
  char response[6];
  write(fd, "KS;", 3);
  usleep(100e3);
  read(fd, response, 6);
  return atoi(response + 2);
}


x86 assembly (clang, -O0):
<getKeyerSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xeab(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    $0x186a0,%edi
call   1060 <usleep@plt>
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x6,%edx
call   1040 <read@plt>
lea    -0xa(%rbp),%rdi
add    $0x2,%rdi
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKeyerSpeed>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xeb2(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    $0x186a0,%edi
call   1060 <usleep@plt>
lea    0xa(%rsp),%rsi
mov    %ebx,%edi
mov    $0x6,%edx
call   1040 <read@plt>
lea    0xc(%rsp),%rdi
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"KS;\00"
define i32 @getKeyerSpeed(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = call i32 @usleep(i32 100000)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 6)
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = call i32 @atoi(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"KS;\00"
define i32 @getKeyerSpeed(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @usleep(i32 100000)
%6 = call i32 @read(i32 %0, i8* %3, i32 6)
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
%8 = call i32 @atoi(i8* %7)
ret i32 %8
}
int main() {
  unsigned long arg = 0x0123456789ABCDEF;
  unsigned long out = 0;
  __asm__("bsrq %%rax, %%rcx" : "=c"(out) : "a"(arg));
  return (out == 56);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movabs $0x123456789abcdef,%rax
45 23 01
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
bsr    %rax,%rcx
mov    %rcx,-0x18(%rbp)
cmpq   $0x38,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movabs $0x123456789abcdef,%rax
45 23 01
bsr    %rax,%rcx
xor    %eax,%eax
cmp    $0x38,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 81985529216486895, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = call i64 asm "bsrq %rax, %rcx", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 56
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 asm "bsrq %rax, %rcx", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 81985529216486895)
%2 = icmp eq i64 %1, 56
%3 = zext i1 %2 to i32
ret i32 %3
}
void __attribute__((no, noclone)) fn2(void) {
  volatile int a[5];
  volatile int j;
  int i = 5;
  int *p = &i;
  asm("" : : "r"(&a) : "memory");
  j = a[*p];
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rax
movslq (%rax),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x24(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
lea    -0x18(%rsp),%rax
mov    -0x4(%rsp),%eax
mov    %eax,-0x1c(%rsp)
ret

LLVM IR (-O0):
define void @fn2() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 5, i32* %3
store i32* %3, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %7
%9 = load volatile i32, i32* %8
store volatile i32 %9, i32* %2
ret void
}

LLVM IR (-O2):
define void @fn2() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 5
%6 = load volatile i32, i32* %5
store volatile i32 %6, i32* %2
ret void
}
int ep_index(int n, int dir) { return (n << 1) | dir; }


x86 assembly (clang, -O0):
<ep_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ep_index>:
lea    (%rdi,%rdi,1),%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @ep_index(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 = shl i32 %5, 1
%7 = load i32, i32* %4
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ep_index(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DoCodeBra();
int /*<<< orphan*/ DoCodeBraSkip();
scalar_t__ cctrue();
void DoCodeBcc(void) {
  if (cctrue()) {
    DoCodeBra();
  } else {
    DoCodeBraSkip();
  }
}


x86 assembly (clang, -O0):
<DoCodeBcc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cctrue@plt>
cmp    $0x0,%rax
je     1151 <DoCodeBcc+0x21>
mov    $0x0,%al
call   1040 <DoCodeBra@plt>
jmp    1158 <DoCodeBcc+0x28>
mov    $0x0,%al
call   1050 <DoCodeBraSkip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeBcc>:
push   %rax
xor    %eax,%eax
call   1030 <cctrue@plt>
test   %rax,%rax
je     1145 <DoCodeBcc+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DoCodeBra@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <DoCodeBraSkip@plt>

LLVM IR (-O0):
define void @DoCodeBcc() {
%1 = call i64 (...) @cctrue()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @DoCodeBra()
br label %7
5: ; preds = %0
%6 = call i32 (...) @DoCodeBraSkip()
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @DoCodeBcc() {
%1 = tail call i64 (...) @cctrue()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @DoCodeBra()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @DoCodeBraSkip()
br label %7
7: ; preds = %5, %3
ret void
}
unsigned xrop3_147_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_147_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_147_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_147_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %5
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_147_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
%7 = xor i32 %6, -1
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ConcatArgs(int);
int /*<<< orphan*/ G_Printf(char *);
int trap_Argc();
int /*<<< orphan*/ trap_SendServerCommand(int, int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int /*<<< orphan*/);
void Svcmd_BannerPrint_f(void) {
  if (trap_Argc() < 2) {
    G_Printf("usage: bp <message>\n");
    return;
  }
  trap_SendServerCommand(-1, va("bp \"%s\"", ConcatArgs(1)));
}


x86 assembly (clang, -O0):
<Svcmd_BannerPrint_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <trap_Argc@plt>
cmp    $0x2,%eax
jge    1175 <Svcmd_BannerPrint_f+0x25>
lea    0xe95(%rip),%rdi
call   1060 <G_Printf@plt>
jmp    1199 <Svcmd_BannerPrint_f+0x49>
mov    $0x1,%edi
call   1050 <ConcatArgs@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1070 <va@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   1030 <trap_SendServerCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_BannerPrint_f>:
push   %rax
xor    %eax,%eax
call   1040 <trap_Argc@plt>
cmp    $0x1,%eax
jg     116a <Svcmd_BannerPrint_f+0x1a>
lea    0xe9c(%rip),%rdi
pop    %rax
jmp    1060 <G_Printf@plt>
mov    $0x1,%edi
call   1050 <ConcatArgs@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1070 <va@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <trap_SendServerCommand@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"usage: bp <message>\0A\00"
@.str.1 = [8 x i8] c"bp \22%s\22\00"
define void @Svcmd_BannerPrint_f() {
%1 = call i32 (...) @trap_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @G_Printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = call i32 @ConcatArgs(i32 1)
%7 = call i32 @va(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @trap_SendServerCommand(i32 -1, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage: bp <message>\0A\00"
@.str.1 = [8 x i8] c"bp \22%s\22\00"
define void @Svcmd_BannerPrint_f() {
%1 = tail call i32 (...) @trap_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @G_Printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = tail call i32 @ConcatArgs(i32 1)
%7 = tail call i32 @va(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 @trap_SendServerCommand(i32 -1, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double GetUnixTimestampMilliseconds() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec + (tv.tv_usec / 1000000.0)) * 1000.0;
}


x86 assembly (clang, -O0):
<GetUnixTimestampMilliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUnixTimestampMilliseconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xecc(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @GetUnixTimestampMilliseconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
%9 = fmul double %8, 1.000000e+03
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @GetUnixTimestampMilliseconds() {
%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 double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
%10 = fmul double %9, 1.000000e+03
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ invert();
int main() {
  invert();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @invert()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ port_out_b(int, int);
void init_pic(void) {
  port_out_b(0x20, 0x11);
  port_out_b(0xA0, 0x11);
  port_out_b(0x21, 0x20);
  port_out_b(0xA1, 0x28);
  port_out_b(0x21, 0x04);
  port_out_b(0xA1, 0x02);
  port_out_b(0x21, 0x01);
  port_out_b(0xA1, 0x01);
  port_out_b(0x21, 0x0);
  port_out_b(0xA1, 0x0);
}


x86 assembly (clang, -O0):
<init_pic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <port_out_b@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <port_out_b@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_pic>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <port_out_b@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <port_out_b@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <port_out_b@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <port_out_b@plt>

LLVM IR (-O0):
define void @init_pic() {
%1 = call i32 @port_out_b(i32 32, i32 17)
%2 = call i32 @port_out_b(i32 160, i32 17)
%3 = call i32 @port_out_b(i32 33, i32 32)
%4 = call i32 @port_out_b(i32 161, i32 40)
%5 = call i32 @port_out_b(i32 33, i32 4)
%6 = call i32 @port_out_b(i32 161, i32 2)
%7 = call i32 @port_out_b(i32 33, i32 1)
%8 = call i32 @port_out_b(i32 161, i32 1)
%9 = call i32 @port_out_b(i32 33, i32 0)
%10 = call i32 @port_out_b(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @init_pic() {
%1 = tail call i32 @port_out_b(i32 32, i32 17)
%2 = tail call i32 @port_out_b(i32 160, i32 17)
%3 = tail call i32 @port_out_b(i32 33, i32 32)
%4 = tail call i32 @port_out_b(i32 161, i32 40)
%5 = tail call i32 @port_out_b(i32 33, i32 4)
%6 = tail call i32 @port_out_b(i32 161, i32 2)
%7 = tail call i32 @port_out_b(i32 33, i32 1)
%8 = tail call i32 @port_out_b(i32 161, i32 1)
%9 = tail call i32 @port_out_b(i32 33, i32 0)
%10 = tail call i32 @port_out_b(i32 161, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetFontName113(char const *);
void setfontname(const char *s) { SetFontName113(s); }


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

x86 assembly (clang, -O2):
<setfontname>:
jmp    1030 <SetFontName113@plt>

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

LLVM IR (-O2):
define void @setfontname(i8* %0) {
%2 = tail call i32 @SetFontName113(i8* %0)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SysCtlIntEnable(uint32_t ui32Ints) {
  (*((volatile unsigned long *)(0x400FE054))) |= ui32Ints;
}


x86 assembly (clang, -O0):
<SysCtlIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400fe054,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fe054,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,0x400fe054
40
ret

LLVM IR (-O0):
define void @SysCtlIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074782292 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074782292 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074782292 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074782292 to i64*)
ret void
}
/* Type definitions */
struct in_addr {
  int s_addr;
};

/* Variables and functions */
char *inet_ntoa(struct in_addr);
char *misc_inet_ntoa(int ip) {
  struct in_addr in;
  in.s_addr = ip;
  return inet_ntoa(in);
}


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

x86 assembly (clang, -O2):
<misc_inet_ntoa>:
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @misc_inet_ntoa(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.in_addr
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i8* @inet_ntoa(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @misc_inet_ntoa(i32 %0) {
%2 = tail call i8* @inet_ntoa(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ strlcat(char *, char const *, int);
char *strcat(char *dest, const char *src) {
  strlcat(dest, src, 0x7FFFFFFF);
  return dest;
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x7fffffff,%edx
call   1030 <strlcat@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strcat(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 @strlcat(i8* %5, i8* %6, i32 2147483647)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlcat(i8* %0, i8* %1, i32 2147483647)
ret i8* %0
}
void parse_term(int argc, char **argv, int *option, char **opt_term,
                int *bad_arg) {
  if (argc != 1 || *option)
    *bad_arg = 1;
  *option = 1;
  if (argc == 1)
    *opt_term = argv[0];
}


x86 assembly (clang, -O0):
<parse_term>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112e <parse_term+0x2e>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1138 <parse_term+0x38>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x1,-0x4(%rbp)
jne    115a <parse_term+0x5a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_term>:
cmp    $0x1,%edi
jne    111e <parse_term+0x1e>
cmpl   $0x0,(%rdx)
je     1111 <parse_term+0x11>
movl   $0x1,(%r8)
movl   $0x1,(%rdx)
mov    (%rsi),%rax
mov    %rax,(%rcx)
ret
movl   $0x1,(%r8)
movl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @parse_term(i32 %0, i8** nocapture %1, i32* nocapture %2, i8** nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = icmp eq i32 %0, 1
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
store i32 1, i32* %4
br label %12
11: ; preds = %5
store i32 1, i32* %4
store i32 1, i32* %2
br label %14
12: ; preds = %7, %10
store i32 1, i32* %2
%13 = load i8*, i8** %1
store i8* %13, i8** %3
br label %14
14: ; preds = %11, %12
ret void
}