xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int nvram_commit(int);
int /*<<< orphan*/ nvram_parse(char *, char *);
int32_t nvram_loadfile(char *section, char *defile) {
  ;
  if ((0) == nvram_parse(section, defile))
    return nvram_commit(1);
  return (-1);
}


x86 assembly (clang, -O0):
<nvram_loadfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <nvram_parse@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    115b <nvram_loadfile+0x3b>
mov    $0x1,%edi
call   1040 <nvram_commit@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <nvram_loadfile+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_loadfile>:
push   %rax
call   1030 <nvram_parse@plt>
test   %eax,%eax
je     1131 <nvram_loadfile+0x11>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    $0x1,%edi
pop    %rax
jmp    1040 <nvram_commit@plt>

LLVM IR (-O0):
define i32 @nvram_loadfile(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 @nvram_parse(i8* %6, i8* %7)
%9 = icmp eq i32 0, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @nvram_commit(i32 1)
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @nvram_loadfile(i8* %0, i8* %1) {
%3 = tail call i32 @nvram_parse(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @nvram_commit(i32 1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
int main(void) {
  "a" - 'B';
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void test_non_identifiers() {
  int i, x;
#pragma omp parallel
#pragma omp parallel master taskloop simd;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp parallel master taskloop simd linear(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp parallel master taskloop simd private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp parallel master taskloop simd, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1194 <test_non_identifiers+0x94>
jmp    1186 <test_non_identifiers+0x86>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <test_non_identifiers+0x77>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_non_identifiers() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
store i32 0, i32* %1
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %18
14: ; preds = %11
br label %15
15: ; preds = %14
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %11
18: ; preds = %11
store i32 0, i32* %1
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 16
br i1 %21, label %22, label %26
22: ; preds = %19
br label %23
23: ; preds = %22
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %19
26: ; preds = %19
store i32 0, i32* %1
br label %27
27: ; preds = %31, %26
%28 = load i32, i32* %1
%29 = icmp slt i32 %28, 16
br i1 %29, label %30, label %34
30: ; preds = %27
br label %31
31: ; preds = %30
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
br label %27
34: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
__attribute__((no, noclone)) long long f2(unsigned x) {
  return ((long long)x) << 4;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
shl    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 %4, 4
ret i64 %5
}

LLVM IR (-O2):
define i64 @f2(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nuw nsw i64 %2, 4
ret i64 %3
}
unsigned char inportb(unsigned int port) {
  unsigned char value;
  __asm__ __volatile__("inb %w1,%b0" : "=a"(value) : "d"(port));
  return value;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @inportb(i32 %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},${0:b}", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
int odd(void *n) { return ((int)n) % 2 != 0; }


x86 assembly (clang, -O0):
<odd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd>:
mov    %rdi,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @odd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = srem i32 %4, 2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @odd(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 1
ret i32 %4
}
int nop(char *c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nop(i8* nocapture readnone %0) {
ret i32 0
}
_Bool chk(unsigned long addr, unsigned long limit, unsigned long size) {
  _Bool ret;
  if (0)
    ret = 0 != (!!(addr > limit - size));
}


x86 assembly (clang, -O0):
<chk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @chk(i64 %0, i64 %1, i64 %2) {
%4 = alloca i1
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = load i1, i1* %4
ret i1 %9
}

LLVM IR (-O2):
define zeroext i1 @chk(i64 %0, i64 %1, i64 %2) {
ret i1 undef
}
AX0I1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (((int *)10000000)[x0]) = 33; }


x86 assembly (clang, -O0):
<AX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movl   $0x21,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0I1>:
movslq %edx,%rax
movl   $0x21,0x989680(,%rax,4)
ret

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

LLVM IR (-O2):
define i32 @AX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
store i32 33, i32* %8
ret i32 undef
}
/* Variables and functions */
int pm8058_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8058_mpp_config_bi_dir(unsigned mpp, unsigned level, unsigned control) {
  return pm8058_mpp_config(mpp, 2, level, control);
}


x86 assembly (clang, -O0):
<pm8058_mpp_config_bi_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x2,%esi
call   1030 <pm8058_mpp_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8058_mpp_config_bi_dir>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <pm8058_mpp_config@plt>

LLVM IR (-O0):
define i32 @pm8058_mpp_config_bi_dir(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 @pm8058_mpp_config(i32 %7, i32 2, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pm8058_mpp_config_bi_dir(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8058_mpp_config(i32 %0, i32 2, i32 %1, i32 %2)
ret i32 %4
}
void av_hmac_update() {}


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

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

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

LLVM IR (-O2):
define void @av_hmac_update() {
ret void
}
unsigned short ntohs(unsigned short n) {
  unsigned short h;
  unsigned char *c = (unsigned char *)&n;
  ((unsigned char *)&h)[0] = c[1];
  ((unsigned char *)&h)[1] = c[0];
  return h;
}


x86 assembly (clang, -O0):
<ntohs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x3(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohs>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @ntohs(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %2
%5 = bitcast i16* %2 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = bitcast i16* %3 to i8*
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = bitcast i16* %3 to i8*
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @ntohs(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int seqgt(unsigned long a, unsigned short win, unsigned long b) {
  return (long)((a + win) - b) > 0;
}


x86 assembly (clang, -O0):
<seqgt>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movzwl -0xa(%rbp),%ecx
add    %rcx,%rax
sub    -0x18(%rbp),%rax
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqgt>:
mov    %esi,%ecx
add    %rdi,%rcx
sub    %rdx,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
ret

LLVM IR (-O0):
define i32 @seqgt(i64 %0, i16 zeroext %1, i64 %2) {
%4 = alloca i64
%5 = alloca i16
%6 = alloca i64
store i64 %0, i64* %4
store i16 %1, i16* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i16, i16* %5
%9 = zext i16 %8 to i64
%10 = add i64 %7, %9
%11 = load i64, i64* %6
%12 = sub i64 %10, %11
%13 = icmp sgt i64 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @seqgt(i64 %0, i16 zeroext %1, i64 %2) {
%4 = zext i16 %1 to i64
%5 = add i64 %4, %0
%6 = sub i64 %5, %2
%7 = icmp sgt i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
void rop3_132_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_132_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_132_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
not    %cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_132_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = xor i8 %5, -1
%7 = and i8 %6, %1
%8 = xor i8 %1, -1
%9 = and i8 %8, %2
%10 = and i8 %9, %4
%11 = or i8 %7, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void fatal(char *s) {
  fprintf(stderr, "[!] %s error: %s\n", s, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"[!] %s error: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"[!] %s error: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
int *if_max(int *pointer_a, int *pointer_b) {
  if (*pointer_a > *pointer_b)
    return pointer_a;
  else
    return pointer_b;
}


x86 assembly (clang, -O0):
<if_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112b <if_max+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1133 <if_max+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_max>:
mov    %rsi,%rax
mov    (%rdi),%ecx
cmp    (%rsi),%ecx
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @if_max(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = select i1 %5, i32* %0, i32* %1
ret i32* %6
}
/* Variables and functions */
char *strstr(char *, char *);
char *extract_line(char *line) {
  char *line_end;
  line_end = strstr(line, "\r\n");
  if (line_end == NULL)
    return (0);
  *line_end = '\0';
  line_end++;
  *line_end = '\0';
  line_end++;
  return (line_end);
}


x86 assembly (clang, -O0):
<extract_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <extract_line+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1176 <extract_line+0x66>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_line>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     112d <extract_line+0x1d>
movw   $0x0,(%rax)
add    $0x2,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i8* @extract_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %18
10: ; preds = %1
%11 = load i8*, i8** %4
store i8 0, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8*, i8** %4
store i8 0, i8* %14
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %10, %9
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i8* @extract_line(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
store i8 0, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %2, i64 2
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
char *get_default_domain();
int __rpc_get_default_domain(char **domain) {
  *domain = get_default_domain();
  if (*domain)
    return (0);
  return (-1);
}


x86 assembly (clang, -O0):
<__rpc_get_default_domain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_default_domain@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1147 <__rpc_get_default_domain+0x37>
movl   $0x0,-0x4(%rbp)
jmp    114e <__rpc_get_default_domain+0x3e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rpc_get_default_domain>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_default_domain@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @__rpc_get_default_domain(i8** nocapture writeonly %0) {
%2 = tail call i8* (...) @get_default_domain()
store i8* %2, i8** %0
%3 = icmp eq i8* %2, null
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int portabook_ext_init_module(void) {
  int error = 0;
  printk("portabook_ext is loaded!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"portabook_ext is loaded!\0A\00"
define i32 @portabook_ext_init_module() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printk(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"portabook_ext is loaded!\0A\00"
define i32 @portabook_ext_init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void delay() {
  struct G *g;
  struct G {
    int x;
  };
  g->x = 1;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.G = type { i32 }
define void @delay() {
%1 = alloca %struct.G*
%2 = load %struct.G*, %struct.G** %1
%3 = getelementptr inbounds %struct.G, %struct.G* %2, i32 0, i32 0
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
void RTStrPrintfExV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrPrintfExV() {
ret void
}
int SignOfDiff(const void *d1, const void *d2) {
  return *((double *)d1) > *((double *)d2) ? 1 : -1;
}


x86 assembly (clang, -O0):
<SignOfDiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignOfDiff>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @SignOfDiff(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @SignOfDiff(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int largestRectangleArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {6, 2, 5, 4, 5, 1, 6};
  printf("%d\n", largestRectangleArea(x, sizeof(x) / sizeof(int)));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1040 <largestRectangleArea@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <largestRectangleArea@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.x = [7 x i32] [i32 6, i32 2, i32 5, i32 4, i32 5, i32 1, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @largestRectangleArea(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int rand_r(unsigned int *seed) {
  int32_t X;
  X = *seed;
  X = 48271 * (X % 44488) - 3399 * (int32_t)(X / 44488);
  if (X < 0)
    X += ((1U << 31) - 1);
  *seed = X;
  return X;
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xadc8,%ecx
cltd
idiv   %ecx
imul   $0xbc8f,%edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xadc8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   $0xd47,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1155 <rand_r+0x55>
mov    -0xc(%rbp),%eax
add    $0x7fffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
movslq (%rdi),%rax
imul   $0x5e4789c9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2e,%rcx
add    %edx,%ecx
imul   $0xadc8,%ecx,%edx
sub    %edx,%eax
imul   $0xbc8f,%eax,%edx
imul   $0xfffff2b9,%ecx,%ecx
lea    (%rcx,%rdx,1),%eax
add    $0x7fffffff,%eax
add    %edx,%ecx
cmovns %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @rand_r(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = srem i32 %6, 44488
%8 = mul nsw i32 48271, %7
%9 = load i32, i32* %3
%10 = sdiv i32 %9, 44488
%11 = mul nsw i32 3399, %10
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i32, i32* %3
%17 = add i32 %16, 2147483647
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %1
%19 = load i32, i32* %3
%20 = load i32*, i32** %2
store i32 %19, i32* %20
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @rand_r(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = srem i32 %2, 44488
%4 = mul nsw i32 %3, 48271
%5 = sdiv i32 %2, 44488
%6 = mul nsw i32 %5, -3399
%7 = add i32 %6, %4
%8 = icmp slt i32 %7, 0
%9 = add i32 %7, 2147483647
%10 = select i1 %8, i32 %9, i32 %7
store i32 %10, i32* %0
ret i32 %10
}
/* Variables and functions */
char *place_commas_in_number_string(char *);
scalar_t__ timlib_exists_string(char *, char *);
char *element_place_commas_in_number_string(char *element_name, char *data) {
  if (timlib_exists_string(element_name, "year"))
    return data;
  else
    return place_commas_in_number_string(data);
}


x86 assembly (clang, -O0):
<element_place_commas_in_number_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <timlib_exists_string@plt>
cmp    $0x0,%rax
je     1157 <element_place_commas_in_number_string+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <element_place_commas_in_number_string+0x44>
mov    -0x18(%rbp),%rdi
call   1040 <place_commas_in_number_string@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_place_commas_in_number_string>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <timlib_exists_string@plt>
test   %rax,%rax
je     113a <element_place_commas_in_number_string+0x1a>
mov    %rbx,%rax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <place_commas_in_number_string@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"year\00"
define i8* @element_place_commas_in_number_string(i8* %0, i8* %1) {
%3 = tail call i64 @timlib_exists_string(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @place_commas_in_number_string(i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ %1, %2 ]
ret i8* %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int bitmap_unit;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_bitmap_unit(void *_p, int _v) {
  ((XImage *)_p)->bitmap_unit = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XImage_bitmap_unit>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XImage_bitmap_unit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_bitmap_unit(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void answer_white(void) {}


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

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

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

LLVM IR (-O2):
define void @answer_white() {
ret void
}
char _read_char(char **pptr) {
  char c = **pptr;
  (*pptr)++;
  return c;
}


x86 assembly (clang, -O0):
<_read_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read_char>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @_read_char(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %7
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @_read_char(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ NoDepX_func();
void NoDepZ_func() { NoDepX_func(); }


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

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

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

LLVM IR (-O2):
define void @NoDepZ_func() {
%1 = tail call i32 (...) @NoDepX_func()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
zor() { ol("orl %edx, %eax"); }


x86 assembly (clang, -O0):
<zor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"orl %edx, %eax\00"
define i32 @zor() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"orl %edx, %eax\00"
define i32 @zor() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
exit_incompat() {
  fprintf(stderr, "%s%s", "The -x and -l options are currently incompatible\n",
          "Please reenter the command without one option\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [50 x i8] c"The -x and -l options are currently incompatible\0A\00"
@.str.2 = [47 x i8] c"Please reenter the command without one option\0A\00"
define i32 @exit_incompat() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [50 x i8] c"The -x and -l options are currently incompatible\0A\00"
@.str.2 = [47 x i8] c"Please reenter the command without one option\0A\00"
define i32 @exit_incompat() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ sem_wait(int /*<<< orphan*/ *);
void waitSem(sem_t *sem) { sem_wait(sem); }


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

x86 assembly (clang, -O2):
<waitSem>:
jmp    1030 <sem_wait@plt>

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

LLVM IR (-O2):
define void @waitSem(i32* %0) {
%2 = tail call i32 @sem_wait(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void failure(void) {
  printf("%s\n", "Sorry, try again...");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [20 x i8] c"Sorry, try again...\00"
define void @failure() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [20 x i8] c"Sorry, try again...\00"
define void @failure() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int close(int fd) { return fclose((FILE *)fd); }


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
movslq %edi,%rdi
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = call i32 @fclose(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @fclose(i32* %3)
ret i32 %4
}
int test_imm_D6int8_reg(signed char val) {
  return ((val) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6int8_reg>:
test   $0xd6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D6int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 214
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D6int8_reg(i8 signext %0) {
%2 = and i8 %0, -42
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int parse_request_type(const char *buf) {
  if (strcmp(buf, "GET") == 0) {
    return 13;
  } else if (strcmp(buf, "POST") == 0) {
    return 14;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_request_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <parse_request_type+0x32>
movl   $0xd,-0x4(%rbp)
jmp    1174 <parse_request_type+0x64>
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <parse_request_type+0x58>
movl   $0xe,-0x4(%rbp)
jmp    1174 <parse_request_type+0x64>
jmp    116d <parse_request_type+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_request_type>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1143 <parse_request_type+0x33>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0xe,%eax
cmovne %ecx,%eax
pop    %rbx
ret
mov    $0xd,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"GET\00"
@.str.1 = [5 x i8] c"POST\00"
define i32 @parse_request_type(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 14, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 13, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ u_int32_t;
typedef int /*<<< orphan*/ ptr;

/* Variables and functions */
float V3DHFGetZPixelCoeff(u_int32_t *ptr, int x, int y, int width, int height) {
  return ((float)((u_int32_t)(ptr[(y * width) + x]) & 0x000000ff) /
          (float)0xff);
}


x86 assembly (clang, -O0):
<V3DHFGetZPixelCoeff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
and    $0xff,%rax
cvtsi2ss %rax,%xmm0
movss  0xec3(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<V3DHFGetZPixelCoeff>:
imul   %ecx,%edx
add    %esi,%edx
movslq %edx,%rax
movzbl (%rdi,%rax,8),%eax
cvtsi2ss %eax,%xmm0
divss  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @V3DHFGetZPixelCoeff(i64* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i64*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i64* %0, i64** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i64*, i64** %6
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %7
%16 = add nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i64, i64* %11, i64 %17
%19 = load i64, i64* %18
%20 = and i64 %19, 255
%21 = sitofp i64 %20 to float
%22 = fdiv float %21, 2.550000e+02
ret float %22
}

LLVM IR (-O2):
define float @V3DHFGetZPixelCoeff(i64* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %3, %2
%7 = add nsw i32 %6, %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 %8
%10 = load i64, i64* %9
%11 = and i64 %10, 255
%12 = sitofp i64 %11 to float
%13 = fdiv float %12, 2.550000e+02
ret float %13
}
const char *suggest_connection_header(const struct mg_connection *conn) {
  return "close";
}


x86 assembly (clang, -O0):
<suggest_connection_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<suggest_connection_header>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.mg_connection = type opaque
@.str = [6 x i8] c"close\00"
define i8* @suggest_connection_header(%struct.mg_connection* %0) {
%2 = alloca %struct.mg_connection*
store %struct.mg_connection* %0, %struct.mg_connection** %2
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.mg_connection = type opaque
@.str = [6 x i8] c"close\00"
define i8* @suggest_connection_header(%struct.mg_connection* nocapture readnone %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned long get_signals();
unsigned long arch_local_save_flags(void) { return get_signals(); }


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

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

LLVM IR (-O0):
define i64 @arch_local_save_flags() {
%1 = call i64 (...) @get_signals()
ret i64 %1
}

LLVM IR (-O2):
define i64 @arch_local_save_flags() {
%1 = tail call i64 (...) @get_signals()
ret i64 %1
}