xunge/DecIR huggingface dataset:
/* Variables and functions */
double celsius(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double f;
  for (f = -40; f <= 220; f = f + 10)
    printf("%f\t%f\n", f, celsius(f));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     118e <main+0x6e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <celsius@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe91(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    113c <main+0x1c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movsd  0xed5(%rip),%xmm0
mov    $0xffffffce,%ebp
lea    0xed9(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
call   1040 <celsius@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xe9c(%rip),%xmm0
add    $0xa,%ebp
cmp    $0xd3,%ebp
jl     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f\09%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double -4.000000e+01, double* %2
br label %3
3: ; preds = %11, %0
%4 = load double, double* %2
%5 = fcmp ole double %4, 2.200000e+02
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load double, double* %2
%8 = load double, double* %2
%9 = call double @celsius(double %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %7, double %9)
br label %11
11: ; preds = %6
%12 = load double, double* %2
%13 = fadd double %12, 1.000000e+01
store double %13, double* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f\09%f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -40, %0 ], [ %6, %1 ]
%3 = sitofp i32 %2 to double
%4 = tail call double @celsius(double %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %3, double %4)
%6 = add nsw i32 %2, 10
%7 = icmp sgt i32 %2, 210
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BgaWriteRegister(int, unsigned short);
void BgaSetBank(unsigned short BankNumber) { BgaWriteRegister(5, BankNumber); }


x86 assembly (clang, -O0):
<BgaSetBank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x5,%edi
movzwl -0x2(%rbp),%esi
call   1030 <BgaWriteRegister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BgaSetBank>:
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <BgaWriteRegister@plt>

LLVM IR (-O0):
define void @BgaSetBank(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @BgaWriteRegister(i32 5, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @BgaSetBank(i16 zeroext %0) {
%2 = tail call i32 @BgaWriteRegister(i32 5, i16 zeroext %0)
ret void
}
void caller_1_1_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_1_2_2_1() {
ret void
}
void dummy(int useless) {}


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

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

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

LLVM IR (-O2):
define void @dummy(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeCharacter(int /*<<< orphan*/);
void writeString(const char *string) {
  while (*string)
    writeCharacter(*string++);
}


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

x86 assembly (clang, -O2):
<writeString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <writeString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <writeCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <writeString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @writeString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @writeCharacter(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
char *getOrdinalNumber(int i) {
  switch (i) {
  case 1:
    return "st";
  case 2:
    return "nd";
  case 3:
    return "rd";
  default:
    return "th";
  }
}


x86 assembly (clang, -O0):
<getOrdinalNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113d <getOrdinalNumber+0x3d>
jmp    111b <getOrdinalNumber+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114d <getOrdinalNumber+0x4d>
jmp    112c <getOrdinalNumber+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     115d <getOrdinalNumber+0x5d>
jmp    116d <getOrdinalNumber+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <getOrdinalNumber+0x78>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <getOrdinalNumber+0x78>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <getOrdinalNumber+0x78>
lea    0xe95(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOrdinalNumber>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     111a <getOrdinalNumber+0x1a>
movslq %edi,%rax
lea    0xefa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xee8(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"st\00"
@.str.1 = [3 x i8] c"nd\00"
@.str.2 = [3 x i8] c"rd\00"
@.str.3 = [3 x i8] c"th\00"
define i8* @getOrdinalNumber(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"st\00"
@.str.1 = [3 x i8] c"nd\00"
@.str.2 = [3 x i8] c"rd\00"
@.str.3 = [3 x i8] c"th\00"
@reltable.getOrdinalNumber = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.getOrdinalNumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.getOrdinalNumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.getOrdinalNumber to i64)) to i32)]
define i8* @getOrdinalNumber(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.getOrdinalNumber to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
/* Variables and functions */
scalar_t__ rfile_fn_is_url(char const *);
int rfile_fn_is_abs(const char *fn) {
  return rfile_fn_is_url(fn) || *fn == '/';
}


x86 assembly (clang, -O0):
<rfile_fn_is_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rfile_fn_is_url@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1147 <rfile_fn_is_abs+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfile_fn_is_abs>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rfile_fn_is_url@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1128 <rfile_fn_is_abs+0x18>
pop    %rbx
ret
xor    %eax,%eax
cmpb   $0x2f,(%rbx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rfile_fn_is_abs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @rfile_fn_is_url(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @rfile_fn_is_abs(i8* %0) {
%2 = tail call i64 @rfile_fn_is_url(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 47
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void report_end(void) { printf("\nTested ended\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"\0ATested ended\0A\00"
define void @report_end() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"\0ATested ended\00"
define void @report_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ss2qsa(int *, int *, int *);
void ss2qsa_(int *stereo, int *fullscreen, int *dome) {
  ss2qsa(stereo, fullscreen, dome);
}


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

x86 assembly (clang, -O2):
<ss2qsa_>:
jmp    1030 <ss2qsa@plt>

LLVM IR (-O0):
define void @ss2qsa_(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 @ss2qsa(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @ss2qsa_(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @ss2qsa(i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
struct linger {
  int l_onoff;
  int l_linger;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ linger;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_LINGER;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, struct linger *,
               int);
int hi_set_linger(int sd, int timeout) {
  struct linger linger;
  socklen_t len;
  linger.l_onoff = 1;
  linger.l_linger = timeout;
  len = sizeof(linger);
  return setsockopt(sd, SOL_SOCKET, SO_LINGER, &linger, len);
}


x86 assembly (clang, -O0):
<hi_set_linger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%r8d
lea    -0x10(%rbp),%rcx
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_set_linger>:
push   %rax
movl   $0x1,(%rsp)
mov    %esi,0x4(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.linger = type { i32, i32 }
@SOL_SOCKET = global i32 0
@SO_LINGER = global i32 0
define i32 @hi_set_linger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.linger
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds %struct.linger, %struct.linger* %5, i32 0, i32 0
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.linger, %struct.linger* %5, i32 0, i32 1
store i32 %8, i32* %9
store i32 8, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* @SOL_SOCKET
%12 = load i32, i32* @SO_LINGER
%13 = load i32, i32* %6
%14 = call i32 @setsockopt(i32 %10, i32 %11, i32 %12, %struct.linger* %5, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.linger = type { i32, i32 }
@SOL_SOCKET = global i32 0
@SO_LINGER = global i32 0
define i32 @hi_set_linger(i32 %0, i32 %1) {
%3 = alloca %struct.linger
%4 = bitcast %struct.linger* %3 to i8*
%5 = getelementptr inbounds %struct.linger, %struct.linger* %3, i64 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.linger, %struct.linger* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_LINGER
%9 = call i32 @setsockopt(i32 %0, i32 %7, i32 %8, %struct.linger* %3, i32 8)
ret i32 %9
}
void closeListeningSockets(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               53, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<closeListeningSockets>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x35,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeListeningSockets>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x35,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.closeListeningSockets = [22 x i8] c"closeListeningSockets\00"
define void @closeListeningSockets() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 53, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.closeListeningSockets, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.closeListeningSockets = [22 x i8] c"closeListeningSockets\00"
define void @closeListeningSockets() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 53, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.closeListeningSockets, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int strictcmp(const char *a, const char *b) {
  return strncmp(a, b, strlen(b)) == 0;
}


x86 assembly (clang, -O0):
<strictcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strictcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strictcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @strictcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t byte_clamp(int v) {
  v >>= 13;
  return v < 0 ? 0 : (v > 255 ? 255 : v);
}


x86 assembly (clang, -O0):
<byte_clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1124 <byte_clamp+0x24>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <byte_clamp+0x4a>
cmpl   $0xff,-0x4(%rbp)
jle    113e <byte_clamp+0x3e>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <byte_clamp+0x44>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_clamp>:
sar    $0xd,%edi
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @byte_clamp(i32 %0) {
%2 = ashr i32 %0, 13
%3 = icmp slt i32 %2, 255
%4 = select i1 %3, i32 %2, i32 255
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
ret i32 %6
}
int execute_msgsnd() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_msgsnd() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_msgsnd() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *fun() {
  char str[30];
  strcpy(str, "this is too simple");
  return (str);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
sub    $0x20,%rsp
lea    0xee4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"this is too simple\00"
define i8* @fun() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
ret i8* %4
}

LLVM IR (-O2):
@.str = [19 x i8] c"this is too simple\00"
define i8* @fun() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ zcoredown();
int /*<<< orphan*/ zcoreinit();
int /*<<< orphan*/ zcoreloop();
int /*<<< orphan*/ zresmdown();
int /*<<< orphan*/ zresminit();
int main() {
  zresminit();
  zcoreinit();
  zcoreloop();
  zresmdown();
  zcoredown();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <zresminit@plt>
mov    $0x0,%al
call   1030 <zcoreinit@plt>
mov    $0x0,%al
call   1050 <zcoreloop@plt>
mov    $0x0,%al
call   1040 <zresmdown@plt>
mov    $0x0,%al
call   1070 <zcoredown@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <zresminit@plt>
xor    %eax,%eax
call   1030 <zcoreinit@plt>
xor    %eax,%eax
call   1050 <zcoreloop@plt>
xor    %eax,%eax
call   1040 <zresmdown@plt>
xor    %eax,%eax
call   1070 <zcoredown@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @zresminit()
%3 = call i32 (...) @zcoreinit()
%4 = call i32 (...) @zcoreloop()
%5 = call i32 (...) @zresmdown()
%6 = call i32 (...) @zcoredown()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @zresminit()
%2 = tail call i32 (...) @zcoreinit()
%3 = tail call i32 (...) @zcoreloop()
%4 = tail call i32 (...) @zresmdown()
%5 = tail call i32 (...) @zcoredown()
ret i32 0
}
/* Type definitions */
struct g2d_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct g2d_context *);
void g2d_fini(struct g2d_context *ctx) {
  if (ctx)
    free(ctx);
}


x86 assembly (clang, -O0):
<g2d_fini>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <g2d_fini+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2d_fini>:
test   %rdi,%rdi
je     111a <g2d_fini+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.g2d_context = type { i32 }
define void @g2d_fini(%struct.g2d_context* %0) {
%2 = alloca %struct.g2d_context*
store %struct.g2d_context* %0, %struct.g2d_context** %2
%3 = load %struct.g2d_context*, %struct.g2d_context** %2
%4 = icmp ne %struct.g2d_context* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.g2d_context*, %struct.g2d_context** %2
%7 = call i32 @free(%struct.g2d_context* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.g2d_context = type { i32 }
define void @g2d_fini(%struct.g2d_context* %0) {
%2 = icmp eq %struct.g2d_context* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.g2d_context* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
scalar_t__ getenv(char *);
int geteuid();
int /*<<< orphan*/ printf(char *);
int main() {
  uid_t myuid;
  myuid = geteuid();
  if (!myuid && getenv("FAKEROOTKEY")) {
    myuid = 99;
  }
  if (myuid) {
    printf("Permission denied!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1170 <main+0x40>
lea    0xea6(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1170 <main+0x40>
movl   $0x63,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1186 <main+0x56>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <geteuid@plt>
test   %eax,%eax
jne    114d <main+0x1d>
lea    0xebd(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1159 <main+0x29>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"FAKEROOTKEY\00"
@str = [19 x i8] c"Permission denied!\00"
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0, %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
ret i32 0
}
int _qdbm_dummyfunc(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @_qdbm_dummyfunc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_qdbm_dummyfunc() {
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dvbmc_list_add_before(struct list *, struct list *);
void dvbmc_list_add_tail(struct list *list, struct list *elem) {
  dvbmc_list_add_before(list, elem);
}


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

x86 assembly (clang, -O2):
<dvbmc_list_add_tail>:
jmp    1030 <dvbmc_list_add_before@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @dvbmc_list_add_tail(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @dvbmc_list_add_before(%struct.list* %5, %struct.list* %6)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @dvbmc_list_add_tail(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @dvbmc_list_add_before(%struct.list* %0, %struct.list* %1)
ret void
}
void Initialize(Array) double Array[];
{
  register int i;
  for (i = 0; i < 100; i++)
    Array[i] = i + RandomInteger() / 8095.0;
}


x86 assembly (clang, -O0):
<Initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1172 <Initialize+0x62>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <RandomInteger@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
movsd  0xeb1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <Initialize+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Initialize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <RandomInteger@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xebe(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1120 <Initialize+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @Initialize(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = call i32 (...) @RandomInteger()
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 8.095000e+03
%13 = fadd double %9, %12
%14 = load double*, double** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double %13, double* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Initialize(double* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %11, %2 ]
%4 = trunc i64 %3 to i32
%5 = sitofp i32 %4 to double
%6 = tail call i32 (...) @RandomInteger()
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 8.095000e+03
%9 = fadd double %8, %5
%10 = getelementptr inbounds double, double* %0, i64 %3
store double %9, double* %10
%11 = add nuw nsw i64 %3, 1
%12 = icmp eq i64 %11, 100
br i1 %12, label %13, label %2
13: ; preds = %2
ret void
}
unsigned char sub(unsigned char a, unsigned char b) { return a ^ b; }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @sub(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %1, %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRRECTANGLE_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 4, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRRECTANGLE_swap>:
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

LLVM IR (-O0):
define void @U_WMRRECTANGLE_swap(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 @U_WMRCORE_N16_swap(i8* %5, i32 4, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRRECTANGLE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 4, i32 %1)
ret void
}
/* Variables and functions */
int foo(int, int);
int main() { return 1 + foo(foo(1, 2), 3); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <foo@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1030 <foo@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1, i32 2)
%3 = call i32 @foo(i32 %2, i32 3)
%4 = add nsw i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2)
%2 = tail call i32 @foo(i32 %1, i32 3)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar_print(int a, int n) {
  if (a > n)
    printf(" ");
  else
    printf("#");
}


x86 assembly (clang, -O0):
<bar_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113b <bar_print+0x2b>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
jmp    1147 <bar_print+0x37>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_print>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @bar_print(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 32, i32 35
%5 = tail call i32 @putchar(i32 %4)
ret void
}
void nseel_asm_beloweq(void) {
  __asm__("fcompp\n"
          "fstsw %ax\n"
          "andl $256, %eax\n"
          "xorl $256, %eax\n");
}


x86 assembly (clang, -O0):
<nseel_asm_beloweq>:
push   %rbp
mov    %rsp,%rbp
fcompp
fstsw  %ax
and    $0x100,%eax
xor    $0x100,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_beloweq>:
fcompp
fstsw  %ax
and    $0x100,%eax
xor    $0x100,%eax
ret

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

LLVM IR (-O2):
define void @nseel_asm_beloweq() {
tail call void asm sideeffect "fcompp\0Afstsw %ax\0Aandl $$256, %eax\0Axorl $$256, %eax\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int MPI_Rsend(const void *buf, int count, int datatype, int dest, int tag,
              int comm) {
  static int callcount = 0;
  if (callcount == 0) {
    printf("MPI Stub WARNING: Should not rsend message to self\n");
    ++callcount;
  }
  return 0;
}


x86 assembly (clang, -O0):
<MPI_Rsend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x0,0x2ef8(%rip)
jne    1155 <MPI_Rsend+0x45>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ee0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed7(%rip)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Rsend>:
push   %rax
cmpl   $0x0,0x2f14(%rip)
jne    112d <MPI_Rsend+0x1d>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
addl   $0x1,0x2eff(%rip)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@MPI_Rsend.callcount = internal global i32 0
@.str = [52 x i8] c"MPI Stub WARNING: Should not rsend message to self\0A\00"
define i32 @MPI_Rsend(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* @MPI_Rsend.callcount
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %6
%16 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @MPI_Rsend.callcount
%18 = add nsw i32 %17, 1
store i32 %18, i32* @MPI_Rsend.callcount
br label %19
19: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@MPI_Rsend.callcount = internal unnamed_addr global i32 0
@str = [51 x i8] c"MPI Stub WARNING: Should not rsend message to self\00"
define i32 @MPI_Rsend(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = load i32, i32* @MPI_Rsend.callcount
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%11 = load i32, i32* @MPI_Rsend.callcount
%12 = add nsw i32 %11, 1
store i32 %12, i32* @MPI_Rsend.callcount
br label %13
13: ; preds = %9, %6
ret i32 0
}
int isalt(char buf[8]) {
  return buf[0] == '\033' && buf[1] > 32 && buf[2] == 0;
}


x86 assembly (clang, -O0):
<isalt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x1b,%ecx
mov    %al,-0x9(%rbp)
jne    1144 <isalt+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
jle    1144 <isalt+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalt>:
xor    %eax,%eax
cmpb   $0x1b,(%rdi)
jne    1116 <isalt+0x16>
cmpb   $0x21,0x1(%rdi)
jl     1116 <isalt+0x16>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isalt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 27
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %12, 32
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br label %20
20: ; preds = %14, %8, %1
%21 = phi i1 [ false, %8 ], [ false, %1 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isalt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 27
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp sgt i8 %6, 32
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %4, %1
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
int global_ext_fun(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @global_ext_fun() {
ret i32 0
}

LLVM IR (-O2):
define i32 @global_ext_fun() {
ret i32 0
}
int findStartCode2(unsigned char *Buf) {
  if (Buf[0] != 0 || Buf[1] != 0 || Buf[2] != 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<findStartCode2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
jne    113a <findStartCode2+0x3a>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    113a <findStartCode2+0x3a>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x1,%eax
je     1146 <findStartCode2+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <findStartCode2+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findStartCode2>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1108 <findStartCode2+0x8>
ret
cmpb   $0x0,0x1(%rdi)
jne    1107 <findStartCode2+0x7>
xor    %eax,%eax
cmpb   $0x1,0x2(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @findStartCode2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 1
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %1, %4
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
int convert6To8(int b) {
  int c = b & 0x3f;
  return (c << 2) | (c >> 4);
}


x86 assembly (clang, -O0):
<convert6To8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert6To8>:
and    $0x3f,%edi
mov    %edi,%eax
shr    $0x4,%eax
lea    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @convert6To8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 63
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 2
%8 = load i32, i32* %3
%9 = ashr i32 %8, 4
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @convert6To8(i32 %0) {
%2 = and i32 %0, 63
%3 = shl nuw nsw i32 %2, 2
%4 = lshr i32 %2, 4
%5 = or i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t __attribute__((always_)) arith_shift_left(int32_t x, int shift) {
  return (int32_t)(((uint32_t)x) << shift);
}


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

x86 assembly (clang, -O2):
<arith_shift_left>:
mov    %esi,%ecx
shl    %cl,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @arith_shift_left(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @arith_shift_left(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, %1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int llz_musicpitch_get_framelen(int);
int llz_pitch2midi_get_framelen(int sample_rate) {
  return llz_musicpitch_get_framelen(sample_rate);
}


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

x86 assembly (clang, -O2):
<llz_pitch2midi_get_framelen>:
jmp    1030 <llz_musicpitch_get_framelen@plt>

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

LLVM IR (-O2):
define i32 @llz_pitch2midi_get_framelen(i32 %0) {
%2 = tail call i32 @llz_musicpitch_get_framelen(i32 %0)
ret i32 %2
}
unsigned get_cell(unsigned *CA, unsigned width, unsigned height) {
  if ((width < 14) && (height < 7)) {
    return CA[(height * 14) + width];
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_cell>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0xe,-0x14(%rbp)
jae    113a <get_cell+0x3a>
cmpl   $0x7,-0x18(%rbp)
jae    113a <get_cell+0x3a>
mov    -0x10(%rbp),%rax
imul   $0xe,-0x18(%rbp),%ecx
add    -0x14(%rbp),%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <get_cell+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cell>:
xor    %eax,%eax
cmp    $0xd,%esi
ja     111a <get_cell+0x1a>
cmp    $0x6,%edx
ja     111a <get_cell+0x1a>
mov    %edx,%eax
shl    $0x4,%eax
sub    %edx,%eax
sub    %edx,%eax
add    %esi,%eax
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @get_cell(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %1, 14
%5 = icmp ult i32 %2, 7
%6 = and i1 %4, %5
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = mul nuw nsw i32 %2, 14
%9 = add nuw nsw i32 %8, %1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
br label %13
13: ; preds = %3, %7
%14 = phi i32 [ %12, %7 ], [ 0, %3 ]
ret i32 %14
}