xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ inner();
__attribute__((no)) void outer(void) { inner(); }


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

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

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

LLVM IR (-O2):
define void @outer() {
%1 = tail call i32 (...) @inner()
ret void
}
void avpriv_float_dsp_alloc() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_float_dsp_alloc() {
ret void
}
uleq(c1, c2) register char *c1, *c2;
{
  register int c;
  while (c = *c1++)
    if ((c | 040) != (*c2 | 040))
      return (0);
    else
      c2++;
  return (*c2 == 0);
}


x86 assembly (clang, -O0):
<uleq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     115f <uleq+0x5f>
mov    -0x1c(%rbp),%eax
or     $0x20,%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
or     $0x20,%ecx
cmp    %ecx,%eax
je     114e <uleq+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1174 <uleq+0x74>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <uleq+0xc>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uleq>:
mov    (%rdi),%al
test   %al,%al
je     1125 <uleq+0x25>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
xor    (%rsi),%al
test   $0xdf,%al
jne    112e <uleq+0x2e>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <uleq+0x10>
xor    %eax,%eax
cmpb   $0x0,(%rsi)
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @uleq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %14
%6 = phi i8 [ %16, %14 ], [ %3, %2 ]
%7 = phi i8* [ %9, %14 ], [ %0, %2 ]
%8 = phi i8* [ %15, %14 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %8
%11 = xor i8 %10, %6
%12 = and i8 %11, -33
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %5
%15 = getelementptr inbounds i8, i8* %8, i64 1
%16 = load i8, i8* %9
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %14, %2
%19 = phi i8* [ %1, %2 ], [ %15, %14 ]
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %5, %18
%24 = phi i32 [ %22, %18 ], [ 0, %5 ]
ret i32 %24
}
void genblez_test() {}


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

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

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

LLVM IR (-O2):
define void @genblez_test() {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
void test(void) {
  char *buffer;
  struct tm timestruct;
  buffer = asctime(&timestruct);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %rsp,%rdi
call   1030 <asctime@plt>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @test() {
%1 = alloca %struct.tm
%2 = bitcast %struct.tm* %1 to i8*
%3 = call i8* @asctime(%struct.tm* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int _start(void) {
  printf("nomain!\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"nomain!\0A\00"
define i32 @_start() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"nomain!\00"
define i32 @_start() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct server {
  int dummy;
};
struct imapmsg {
  int dummy;
};
struct folder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ start_delete(struct server *, struct folder *);
void imap_copyok(struct imapmsg *msg, struct server *sptr,
                 struct folder *fptr) {
  start_delete(sptr, fptr);
}


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

x86 assembly (clang, -O2):
<imap_copyok>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <start_delete@plt>

LLVM IR (-O0):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_copyok(%struct.imapmsg* %0, %struct.server* %1, %struct.folder* %2) {
%4 = alloca %struct.imapmsg*
%5 = alloca %struct.server*
%6 = alloca %struct.folder*
store %struct.imapmsg* %0, %struct.imapmsg** %4
store %struct.server* %1, %struct.server** %5
store %struct.folder* %2, %struct.folder** %6
%7 = load %struct.server*, %struct.server** %5
%8 = load %struct.folder*, %struct.folder** %6
%9 = call i32 @start_delete(%struct.server* %7, %struct.folder* %8)
ret void
}

LLVM IR (-O2):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_copyok(%struct.imapmsg* nocapture readnone %0, %struct.server* %1, %struct.folder* %2) {
%4 = tail call i32 @start_delete(%struct.server* %1, %struct.folder* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inlineFunc();
void use88() { inlineFunc(); }


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

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

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

LLVM IR (-O2):
define void @use88() {
%1 = tail call i32 (...) @inlineFunc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printLogFileInfo(const char *cmd) {
  (void)cmd;
  output("LogFile\n");
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"LogFile\0A\00"
define void @printLogFileInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"LogFile\0A\00"
define void @printLogFileInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ipv6hdr {
  int dummy;
};
typedef int __u8;
typedef int __u16;

/* Variables and functions */
int htons(int);
int ntohs(int);
void ipv6_change_dsfield(struct ipv6hdr *ipv6h, __u8 mask, __u8 value) {
  __u16 tmp;
  tmp = ntohs(*(__u16 *)ipv6h);
  tmp = (tmp & ((mask << 4) | 0xf00f)) | (value << 4);
  *(__u16 *)ipv6h = htons(tmp);
}


x86 assembly (clang, -O0):
<ipv6_change_dsfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x4,%ecx
or     $0xf00f,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_change_dsfield>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    (%rdi),%edi
call   1040 <ntohs@plt>
shl    $0x4,%ebp
or     $0xf00f,%ebp
and    %eax,%ebp
shl    $0x4,%ebx
or     %ebp,%ebx
mov    %ebx,%edi
call   1030 <htons@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.ipv6hdr = type { i32 }
define void @ipv6_change_dsfield(%struct.ipv6hdr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ipv6hdr*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.ipv6hdr* %0, %struct.ipv6hdr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.ipv6hdr*, %struct.ipv6hdr** %4
%9 = bitcast %struct.ipv6hdr* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @ntohs(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = shl i32 %13, 4
%15 = or i32 %14, 61455
%16 = and i32 %12, %15
%17 = load i32, i32* %6
%18 = shl i32 %17, 4
%19 = or i32 %16, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = call i32 @htons(i32 %20)
%22 = load %struct.ipv6hdr*, %struct.ipv6hdr** %4
%23 = bitcast %struct.ipv6hdr* %22 to i32*
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
%struct.ipv6hdr = type { i32 }
define void @ipv6_change_dsfield(%struct.ipv6hdr* nocapture %0, i32 %1, i32 %2) {
%4 = getelementptr %struct.ipv6hdr, %struct.ipv6hdr* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
%7 = shl i32 %1, 4
%8 = or i32 %7, 61455
%9 = and i32 %6, %8
%10 = shl i32 %2, 4
%11 = or i32 %9, %10
%12 = tail call i32 @htons(i32 %11)
store i32 %12, i32* %4
ret void
}
/* Variables and functions */
float max(float, float);
float blendLinearBurn(float base, float blend) {
  return max(base + blend - 1.0f, 0.0f);
}


x86 assembly (clang, -O0):
<blendLinearBurn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendLinearBurn>:
addss  %xmm1,%xmm0
addss  0xee4(%rip),%xmm0
xorps  %xmm1,%xmm1
jmp    1030 <max@plt>

LLVM IR (-O0):
define float @blendLinearBurn(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = fsub float %7, 1.000000e+00
%9 = call float @max(float %8, float 0.000000e+00)
ret float %9
}

LLVM IR (-O2):
define float @blendLinearBurn(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fadd float %3, -1.000000e+00
%5 = tail call float @max(float %4, float 0.000000e+00)
ret float %5
}
/* Variables and functions */
int faca(int);
int main(int x) {
  int y;
  y = faca(x);
  return y;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <faca@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 @faca(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA_LC898122AF(unsigned short, unsigned char *);
int /*<<< orphan*/ RegWriteA_LC898122AF(unsigned short, unsigned char);
void BsyWit(unsigned short UsTrgAdr, unsigned char UcTrgDat) {
  unsigned char UcFlgVal;
  RegWriteA_LC898122AF(UsTrgAdr, UcTrgDat);
  UcFlgVal = 1;
  while (UcFlgVal) {
    RegReadA_LC898122AF(UsTrgAdr, &UcFlgVal);
    UcFlgVal &= (UcTrgDat & 0x0F);
  };
}


x86 assembly (clang, -O0):
<BsyWit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzbl -0x3(%rbp),%esi
call   1030 <RegWriteA_LC898122AF@plt>
movb   $0x1,-0x4(%rbp)
cmpb   $0x0,-0x4(%rbp)
je     1175 <BsyWit+0x55>
lea    -0x4(%rbp),%rsi
movzwl -0x2(%rbp),%edi
call   1040 <RegReadA_LC898122AF@plt>
movzbl -0x3(%rbp),%ecx
and    $0xf,%ecx
movzbl -0x4(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x4(%rbp)
jmp    1149 <BsyWit+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BsyWit>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <RegWriteA_LC898122AF@plt>
movb   $0x1,0xf(%rsp)
and    $0xf,%bl
movzwl %bp,%ebp
lea    0xf(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <RegReadA_LC898122AF@plt>
and    %bl,0xf(%rsp)
jne    1150 <BsyWit+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @BsyWit(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
%5 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%6 = load i16, i16* %3
%7 = load i8, i8* %4
%8 = call i32 @RegWriteA_LC898122AF(i16 zeroext %6, i8 zeroext %7)
store i8 1, i8* %5
br label %9
9: ; preds = %12, %2
%10 = load i8, i8* %5
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i16, i16* %3
%14 = call i32 @RegReadA_LC898122AF(i16 zeroext %13, i8* %5)
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = and i32 %16, 15
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = and i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @BsyWit(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = tail call i32 @RegWriteA_LC898122AF(i16 zeroext %0, i8 zeroext %1)
store i8 1, i8* %3
%5 = and i8 %1, 15
br label %6
6: ; preds = %2, %6
%7 = call i32 @RegReadA_LC898122AF(i16 zeroext %0, i8* %3)
%8 = load i8, i8* %3
%9 = and i8 %5, %8
store i8 %9, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int urandom();
int main(int argc, char *argv[]) {
  printf("%d\n", urandom());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @urandom()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @urandom()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef unsigned long uint64_t;

/* Variables and functions */
bool is_power_of_2(uint64_t x) { return ((x != 0UL) && !(x & (x - 1UL))); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <is_power_of_2+0x33>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %rdi,%rdi
je     1112 <is_power_of_2+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_power_of_2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void rop3_138_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = *D & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_138_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_138_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %6
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_138_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xc4() {
  Assert_real((isprint(196) == 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",
              985, ("isprint should be 0 for 0xc4"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xc4>:
push   %rax
mov    $0xc4,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d9,%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 0xc4\00"
define void @t_isprint_0xc4() {
%1 = call i64 @isprint(i32 196)
%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 985, 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 0xc4\00"
define void @t_isprint_0xc4() {
%1 = tail call i64 @isprint(i32 196)
%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 985, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ smsc911x_enable_promiscuous_reception();
void enablePromiscuousReception(void) {
  smsc911x_enable_promiscuous_reception();
}


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

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

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

LLVM IR (-O2):
define void @enablePromiscuousReception() {
%1 = tail call i32 (...) @smsc911x_enable_promiscuous_reception()
ret void
}
unsigned char inb(unsigned short port) {
  unsigned char data;
  asm volatile("in"
               "b"
               " %1,%0"
               : "=a"(data)
               : "d"(port));
  return (data);
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <numops> <syscall>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [30 x i8] c"Usage: %s <numops> <syscall>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [30 x i8] c"Usage: %s <numops> <syscall>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fwrite(char *, int, int, int /*<<< orphan*/ *);
int writestr(FILE *fp, char *str, int count) {
  return (int)fwrite(str, 1, count, fp) == count;
}


x86 assembly (clang, -O0):
<writestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writestr>:
push   %rbx
mov    %edx,%ebx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @writestr(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 i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i64 @fwrite(i8* %7, i32 1, i32 %8, i32* %9)
%11 = trunc i64 %10 to i32
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @writestr(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @fwrite(i8* %1, i32 1, i32 %2, i32* %0)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, char *);
void readfile(FILE *fp, char *c) {
  while (fscanf(fp, "%c", c) == 1)
    c++;
}


x86 assembly (clang, -O0):
<readfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    114e <readfile+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <readfile+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readfile>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xede(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <fscanf@plt>
add    $0x1,%rbx
cmp    $0x1,%eax
je     1130 <readfile+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @readfile(i32* nocapture %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %7, %3 ]
%5 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i32 %5, 1
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ US_Print(int /*<<< orphan*/);
int /*<<< orphan*/ ltoa(long, char *, int);
void US_PrintSigned(long n) {
  char buffer[32];
  US_Print(ltoa(n, buffer, 10));
}


x86 assembly (clang, -O0):
<US_PrintSigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   1030 <ltoa@plt>
mov    %eax,%edi
call   1040 <US_Print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<US_PrintSigned>:
sub    $0x28,%rsp
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <ltoa@plt>
mov    %eax,%edi
call   1040 <US_Print@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @US_PrintSigned(i64 %0) {
%2 = alloca i64
%3 = alloca [32 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = call i32 @ltoa(i64 %4, i8* %5, i32 10)
%7 = call i32 @US_Print(i32 %6)
ret void
}

LLVM IR (-O2):
define void @US_PrintSigned(i64 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @ltoa(i64 %0, i8* %3, i32 10)
%5 = call i32 @US_Print(i32 %4)
ret void
}
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
pid_t waitpid(pid_t pid, int *status, int options) {
  pid_t result;
  asm("movl $7, %%eax;"
      "int $0x80;"
      : "=a"(result)
      : "b"(pid), "c"(status), "d"(options));
  return result;
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    $0x7,%eax
int    $0x80
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x7,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i8* @waitpid(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i8* asm "movl $$7, %eax;int $$0x80;", "={ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %8, i32* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
ret i8* %12
}

LLVM IR (-O2):
define i8* @waitpid(i8* readnone %0, i32* readnone %1, i32 %2) {
%4 = tail call i8* asm "movl $$7, %eax;int $$0x80;", "={ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32* %1, i32 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _timegm(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
time_t utc2local(time_t in) {
  struct tm *tt;
  tt = localtime(&in);
  return _timegm(tt);
}


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

x86 assembly (clang, -O2):
<utc2local>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <_timegm@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @utc2local(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = call i32 @_timegm(%struct.tm* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @utc2local(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
%4 = call i32 @_timegm(%struct.tm* %3)
ret i32 %4
}
/* Variables and functions */
char getc(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char input, input1;
  printf("Please type two characters: \n");
  input = getc(stdin);
  input1 = getchar();
  printf("You typed: %c%c \n", input, input1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%esi
movsbl -0x6(%rbp),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1060 <getc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %bl,%esi
movsbl %al,%edx
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Please type two characters: \0A\00"
@stdin = global i32 0
@.str.1 = [18 x i8] c"You typed: %c%c \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call signext i8 @getc(i32 %5)
store i8 %6, i8* %2
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [18 x i8] c"You typed: %c%c \0A\00"
@str = [29 x i8] c"Please type two characters: \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call signext i8 @getc(i32 %2)
%4 = tail call signext i8 (...) @getchar()
%5 = sext i8 %3 to i32
%6 = sext i8 %4 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ flip4(unsigned int const *, unsigned int *, int);
int read(int, int *, int);
ssize_t read_int4_array(int f, int *iarray, size_t n) {
  ssize_t nread = read(f, iarray, 4 * n);
  if (nread <= 0)
    return 0;
  flip4((const unsigned int *)iarray, (unsigned int *)iarray, nread / 4);
  return nread / 4;
}


x86 assembly (clang, -O0):
<read_int4_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     1162 <read_int4_array+0x42>
movl   $0x0,-0x4(%rbp)
jmp    118a <read_int4_array+0x6a>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1040 <flip4@plt>
mov    -0x1c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int4_array>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
shl    $0x2,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1146 <read_int4_array+0x26>
mov    %eax,%ebp
shr    $0x2,%ebp
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <flip4@plt>
jmp    1148 <read_int4_array+0x28>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_int4_array(i32 %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = mul i64 4, %11
%13 = trunc i64 %12 to i32
%14 = call i32 @read(i32 %9, i32* %10, i32 %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 0, i32* %4
br label %26
18: ; preds = %3
%19 = load i32*, i32** %6
%20 = load i32*, i32** %6
%21 = load i32, i32* %8
%22 = sdiv i32 %21, 4
%23 = call i32 @flip4(i32* %19, i32* %20, i32 %22)
%24 = load i32, i32* %8
%25 = sdiv i32 %24, 4
store i32 %25, i32* %4
br label %26
26: ; preds = %18, %17
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @read_int4_array(i32 %0, i32* %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = shl i32 %4, 2
%6 = tail call i32 @read(i32 %0, i32* %1, i32 %5)
%7 = icmp slt i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = lshr i32 %6, 2
%10 = tail call i32 @flip4(i32* %1, i32* %1, i32 %9)
br label %11
11: ; preds = %3, %8
%12 = phi i32 [ %9, %8 ], [ 0, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void crash_vfprintf() {
  FILE *f;
  va_list arg;
  f = fopen("this_file_doesnt_exist", "r");
  vfprintf(f, "blablabla\n", arg);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rsi
call   1050 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_vfprintf>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1050 <vfprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"blablabla\0A\00"
define void @crash_vfprintf() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = load i32, i32* %2
%6 = call i32 @vfprintf(i32* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"blablabla\0A\00"
define void @crash_vfprintf() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @vfprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 undef)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
void sig_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
ret void
}
int foo(a, b, c) { return a + b + c; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
void ff_hevc_put_hevc_qpel_hv48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv48_10_avx2() {
ret void
}
/* Type definitions */
typedef int mine;

/* Variables and functions */
int /*<<< orphan*/ set_free(int);
void put_right_fork(int mine) {
  int item = (((mine) + 1) % 5);
  set_free(item);
}


x86 assembly (clang, -O0):
<put_right_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <set_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_right_fork>:
add    $0x1,%edi
movslq %edi,%rdi
imul   $0x66666667,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edi
jmp    1030 <set_free@plt>

LLVM IR (-O0):
define void @put_right_fork(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = srem i32 %5, 5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @set_free(i32 %7)
ret void
}

LLVM IR (-O2):
define void @put_right_fork(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 5
%4 = tail call i32 @set_free(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *const, char *, int *);
void read_skip_const_i(const char *const line, const int *const var) {
  sscanf(line, "%*s %u", (int *)var);
}


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

x86 assembly (clang, -O2):
<read_skip_const_i>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%*s %u\00"
define void @read_skip_const_i(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%*s %u\00"
define void @read_skip_const_i(i8* nocapture %0, i32* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ ssize_t;
typedef scalar_t__ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, int /*<<< orphan*/ *, size_t);
ssize_t tcp_recv(int64_t sockfd, uint8_t *buf, int64_t start, size_t max) {
  return read((int32_t)sockfd, buf + (int)start, max);
}


x86 assembly (clang, -O0):
<tcp_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_recv>:
movslq %edx,%rax
lea    (%rsi,%rax,4),%rsi
mov    %rcx,%rdx
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @tcp_recv(i64 %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = load i32*, i32** %6
%12 = load i64, i64* %7
%13 = trunc i64 %12 to i32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i64, i64* %8
%17 = call i32 @read(i32 %10, i32* %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @tcp_recv(i64 %0, i32* nocapture %1, i64 %2, i64 %3) {
%5 = trunc i64 %0 to i32
%6 = shl i64 %2, 32
%7 = ashr exact i64 %6, 32
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = tail call i32 @read(i32 %5, i32* %8, i64 %3)
ret i32 %9
}