xunge/DecIR huggingface dataset:
int getIntFromString(char *a) {
  int result = 0;
  while (*a != '\0') {
    int digit;
    digit = a[0] - '0';
    result = result * 10 + digit;
    a++;
  }
  return result;
}


x86 assembly (clang, -O0):
<getIntFromString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <getIntFromString+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <getIntFromString+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIntFromString>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <getIntFromString+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <getIntFromString+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getIntFromString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %12, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %7, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void showUsage(const char *programName) {
  fprintf(stderr, "%s [--help] [--testVector] file\n", programName);
}


x86 assembly (clang, -O0):
<showUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showUsage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"%s [--help] [--testVector] file\0A\00"
define void @showUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"%s [--help] [--testVector] file\0A\00"
define void @showUsage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *strerror(int errnum) {
  extern char *sys_errlist[];
  extern int sys_nerr;
  if (errnum >= 0 && errnum < sys_nerr)
    return sys_errlist[errnum];
  return (char *)"Unknown error";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113b <strerror+0x3b>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jge    113b <strerror+0x3b>
movslq -0xc(%rbp),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <strerror+0x46>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
js     1123 <strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1123 <strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [14 x i8] c"Unknown error\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %16
15: ; preds = %6, %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [14 x i8] c"Unknown error\00"
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}
/* Variables and functions */
int __mkostemps(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int mkstemp(char *template) { return __mkostemps(template, 0, 0); }


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

x86 assembly (clang, -O2):
<mkstemp>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__mkostemps@plt>

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

LLVM IR (-O2):
define i32 @mkstemp(i8* %0) {
%2 = tail call i32 @__mkostemps(i8* %0, i32 0, i32 0)
ret i32 %2
}
int main() {
  int a[3] = {1, 2, 20};
  int i = 2;
  return *(&i) + *(&a[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 20]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
store i32 2, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 22
}
int Mini_AigLitIsConst(int Lit) { return Lit == 0 || Lit == 1; }


x86 assembly (clang, -O0):
<Mini_AigLitIsConst>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <Mini_AigLitIsConst+0x20>
cmpl   $0x1,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mini_AigLitIsConst>:
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @Mini_AigLitIsConst(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @Mini_AigLitIsConst(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_timed_shutdown_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_timed@%p::shutdown (rtpp_timed_shutdown) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_timed_shutdown_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_timed_shutdown_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_timed@%p::shutdown (rtpp_timed_shutdown) is invoked after destruction\0A\00"
define void @rtpp_timed_shutdown_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_timed@%p::shutdown (rtpp_timed_shutdown) is invoked after destruction\0A\00"
define void @rtpp_timed_shutdown_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
double minus(double d1, double d2) { return d1 - d2; }


x86 assembly (clang, -O0):
<minus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minus>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @minus(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 LNET_MKNET(__u32 type, __u32 num) { return (type << 16) | num; }


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

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

LLVM IR (-O0):
define i32 @LNET_MKNET(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 16
%7 = load i32, i32* %4
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @LNET_MKNET(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = or i32 %3, %1
ret i32 %4
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g(struct S *);
void f(struct S *s) { g(s); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <g@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @f(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = load %struct.S*, %struct.S** %2
%4 = call i32 @g(%struct.S* %3)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @f(%struct.S* %0) {
%2 = tail call i32 @g(%struct.S* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteChar(int);
void iRobot_PowerDown() { SerialWriteChar(133); }


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

x86 assembly (clang, -O2):
<iRobot_PowerDown>:
mov    $0x85,%edi
jmp    1030 <SerialWriteChar@plt>

LLVM IR (-O0):
define void @iRobot_PowerDown() {
%1 = call i32 @SerialWriteChar(i32 133)
ret void
}

LLVM IR (-O2):
define void @iRobot_PowerDown() {
%1 = tail call i32 @SerialWriteChar(i32 133)
ret void
}
void simple_unlink(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<simple_unlink>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_unlink>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.simple_unlink = [14 x i8] c"simple_unlink\00"
define void @simple_unlink() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.simple_unlink, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.simple_unlink = [14 x i8] c"simple_unlink\00"
define void @simple_unlink() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.simple_unlink, i64 0, i64 0))
ret void
}
void update_int_lock() {}


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

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

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

LLVM IR (-O2):
define void @update_int_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: vmo2wav [ -o wav_file ] vmo_file\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: vmo2wav [ -o wav_file ] vmo_file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: vmo2wav [ -o wav_file ] vmo_file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ filter(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[100];
  gets(s);
  filter(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <filter@plt>
lea    -0x70(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <filter@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @filter(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void av_sha_final() {}


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

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

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

LLVM IR (-O2):
define void @av_sha_final() {
ret void
}
int valid_priority(int priority) {
  if ((priority >= -20) && (priority <= 19)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<valid_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffffec,-0x8(%rbp)
jl     1127 <valid_priority+0x27>
cmpl   $0x13,-0x8(%rbp)
jg     1127 <valid_priority+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <valid_priority+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_priority>:
add    $0x14,%edi
xor    %eax,%eax
cmp    $0x28,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @valid_priority(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, -20
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 19
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @valid_priority(i32 %0) {
%2 = add i32 %0, 20
%3 = icmp ult i32 %2, 40
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double big_tau(double const);
double small_tau(double const);
double Self_shlding(double NH2All) {
  const double tau = 1.2e-14 * NH2All / 1.0e0;
  if (tau <= 10e0)
    return small_tau(tau);
  else
    return big_tau(tau);
}


x86 assembly (clang, -O0):
<Self_shlding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xead(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1172 <Self_shlding+0x52>
movsd  -0x18(%rbp),%xmm0
call   1030 <small_tau@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1181 <Self_shlding+0x61>
movsd  -0x18(%rbp),%xmm0
call   1040 <big_tau@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Self_shlding>:
mulsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113b <Self_shlding+0x1b>
jmp    1040 <big_tau@plt>
jmp    1030 <small_tau@plt>

LLVM IR (-O0):
define double @Self_shlding(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fmul double 1.200000e-14, %5
%7 = fdiv double %6, 1.000000e+00
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp ole double %8, 1.000000e+01
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %4
%12 = call double @small_tau(double %11)
store double %12, double* %2
br label %16
13: ; preds = %1
%14 = load double, double* %4
%15 = call double @big_tau(double %14)
store double %15, double* %2
br label %16
16: ; preds = %13, %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @Self_shlding(double %0) {
%2 = fmul double %0, 1.200000e-14
%3 = fcmp ugt double %2, 1.000000e+01
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call double @small_tau(double %2)
br label %8
6: ; preds = %1
%7 = tail call double @big_tau(double %2)
br label %8
8: ; preds = %6, %4
%9 = phi double [ %5, %4 ], [ %7, %6 ]
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
char *makeHourTxt(int ts, char *txt) {
  strftime(txt, 6, "%H:00", localtime((time_t *)&ts));
  return txt;
}


x86 assembly (clang, -O0):
<makeHourTxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x6,%esi
lea    0xeae(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeHourTxt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%H:00\00"
define i8* @makeHourTxt(i32 %0, i8* returned %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @localtime(i32* %3)
%5 = call i32 @strftime(i8* %1, i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ aes_128_encrypt(unsigned char *, unsigned long *);
void regular_ecb_encrypt(unsigned char *reg, unsigned long long reg_len,
                         unsigned long expanded_key[44]) {
  unsigned long long cur;
  for (cur = 0; cur < reg_len; cur = cur + 16) {
    aes_128_encrypt(&reg[cur], expanded_key);
  }
}


x86 assembly (clang, -O0):
<regular_ecb_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115c <regular_ecb_encrypt+0x4c>
mov    -0x8(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <aes_128_encrypt@plt>
mov    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <regular_ecb_encrypt+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regular_ecb_encrypt>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <regular_ecb_encrypt+0x35>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rbx,1),%rdi
mov    %r14,%rsi
call   1030 <aes_128_encrypt@plt>
add    $0x10,%rbx
cmp    %r12,%rbx
jb     1130 <regular_ecb_encrypt+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @regular_ecb_encrypt(i8* %0, i64 %1, i64* %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @aes_128_encrypt(i8* %7, i64* %2)
%9 = add i64 %6, 16
%10 = icmp ult i64 %9, %1
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enableIMQ(int /*<<< orphan*/);
int /*<<< orphan*/ hwnat_qos_bandwidth_setup(int /*<<< orphan*/);
int /*<<< orphan*/ hwnat_qos_queue_stop();
int /*<<< orphan*/ setupCarChain(int /*<<< orphan*/);
int /*<<< orphan*/ setupCarQdisc(int /*<<< orphan*/);
int /*<<< orphan*/ setupQdisc(int /*<<< orphan*/);
int /*<<< orphan*/ setupQosRuleChain(int /*<<< orphan*/);
int stopIPQ(void) {
  setupQosRuleChain(0);
  setupQdisc(0);
  enableIMQ(0);
  setupCarChain(0);
  setupCarQdisc(0);
  hwnat_qos_queue_stop();
  hwnat_qos_bandwidth_setup(0);
  return 0;
}


x86 assembly (clang, -O0):
<stopIPQ>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1060 <setupQosRuleChain@plt>
xor    %edi,%edi
call   1080 <setupQdisc@plt>
xor    %edi,%edi
call   1090 <enableIMQ@plt>
xor    %edi,%edi
call   1030 <setupCarChain@plt>
xor    %edi,%edi
call   1070 <setupCarQdisc@plt>
mov    $0x0,%al
call   1050 <hwnat_qos_queue_stop@plt>
xor    %edi,%edi
call   1040 <hwnat_qos_bandwidth_setup@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopIPQ>:
push   %rax
xor    %edi,%edi
call   1060 <setupQosRuleChain@plt>
xor    %edi,%edi
call   1080 <setupQdisc@plt>
xor    %edi,%edi
call   1090 <enableIMQ@plt>
xor    %edi,%edi
call   1030 <setupCarChain@plt>
xor    %edi,%edi
call   1070 <setupCarQdisc@plt>
xor    %eax,%eax
call   1050 <hwnat_qos_queue_stop@plt>
xor    %edi,%edi
call   1040 <hwnat_qos_bandwidth_setup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stopIPQ() {
%1 = call i32 @setupQosRuleChain(i32 0)
%2 = call i32 @setupQdisc(i32 0)
%3 = call i32 @enableIMQ(i32 0)
%4 = call i32 @setupCarChain(i32 0)
%5 = call i32 @setupCarQdisc(i32 0)
%6 = call i32 (...) @hwnat_qos_queue_stop()
%7 = call i32 @hwnat_qos_bandwidth_setup(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @stopIPQ() {
%1 = tail call i32 @setupQosRuleChain(i32 0)
%2 = tail call i32 @setupQdisc(i32 0)
%3 = tail call i32 @enableIMQ(i32 0)
%4 = tail call i32 @setupCarChain(i32 0)
%5 = tail call i32 @setupCarQdisc(i32 0)
%6 = tail call i32 (...) @hwnat_qos_queue_stop()
%7 = tail call i32 @hwnat_qos_bandwidth_setup(i32 0)
ret i32 0
}
const char *isns_authmethod_help(void) {
  return "comma separated list, including of KRB5, SPKM1, SPKM2, SRP, CHAP, "
         "none";
}


x86 assembly (clang, -O0):
<isns_authmethod_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [71 x i8] c"comma separated list, including of KRB5, SPKM1, SPKM2, SRP, CHAP, none\00"
define i8* @isns_authmethod_help() {
ret i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [71 x i8] c"comma separated list, including of KRB5, SPKM1, SPKM2, SRP, CHAP, none\00"
define i8* @isns_authmethod_help() {
ret i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
int /*<<< orphan*/ reset_shell_mode();
void cmd_reset_shell_mode(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(reset_shell_mode());
}


x86 assembly (clang, -O0):
<cmd_reset_shell_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_reset_shell_mode+0x27>
jmp    117f <cmd_reset_shell_mode+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <reset_shell_mode@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_reset_shell_mode>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_reset_shell_mode+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <reset_shell_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_reset_shell_mode(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @reset_shell_mode()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_reset_shell_mode(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @reset_shell_mode()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
char *setlocale(int category, const char *locale) { return ((void *)0); }


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @setlocale(i32 %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT32_MAX;
uint32_t rotr32(uint32_t x, int n) {
  return ((x >> n) | (x << (32 - n))) & UINT32_MAX;
}


x86 assembly (clang, -O0):
<rotr32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    0x2ece(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr32>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
mov    0x2ee5(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@UINT32_MAX = global i32 0
define i32 @rotr32(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
%13 = load i32, i32* @UINT32_MAX
%14 = and i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@UINT32_MAX = global i32 0
define i32 @rotr32(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
%7 = load i32, i32* @UINT32_MAX
%8 = and i32 %7, %6
ret i32 %8
}
/* Variables and functions */
double asum(double *, int);
int /*<<< orphan*/ fatalx(char *);
int /*<<< orphan*/ vst(double *, double *, double, int);
double bal1(double *a, int n) {
  double y;
  y = asum(a, n);
  if (y <= 0.0)
    fatalx("bad bal1\n");
  vst(a, a, 1.0 / y, n);
  return y;
}


x86 assembly (clang, -O0):
<bal1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <asum@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     116a <bal1+0x3a>
lea    0xea3(%rip),%rdi
call   1040 <fatalx@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movsd  0xe86(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
mov    -0xc(%rbp),%edx
call   1030 <vst@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bal1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <asum@plt>
xorpd  %xmm1,%xmm1
movsd  %xmm0,(%rsp)
ucomisd %xmm0,%xmm1
jb     1158 <bal1+0x28>
lea    0xeb5(%rip),%rdi
call   1040 <fatalx@plt>
movsd  0xea0(%rip),%xmm0
divsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <vst@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"bad bal1\0A\00"
define double @bal1(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = load i32, i32* %4
%8 = call double @asum(double* %6, i32 %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @fatalx(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load double*, double** %3
%15 = load double*, double** %3
%16 = load double, double* %5
%17 = fdiv double 1.000000e+00, %16
%18 = load i32, i32* %4
%19 = call i32 @vst(double* %14, double* %15, double %17, i32 %18)
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
@.str = [10 x i8] c"bad bal1\0A\00"
define double @bal1(double* %0, i32 %1) {
%3 = tail call double @asum(double* %0, i32 %1)
%4 = fcmp ugt double %3, 0.000000e+00
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fatalx(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = fdiv double 1.000000e+00, %3
%9 = tail call i32 @vst(double* %0, double* %0, double %8, i32 %1)
ret double %3
}
char color_label(int color) {
  int c = '0' + color;
  if (c > '9') {
    c = c - '9' + 'a' - 1;
  }
  if (c > 'z') {
    c = c - 'z' + 'A' - 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<color_label>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x39,-0x8(%rbp)
jle    1129 <color_label+0x29>
mov    -0x8(%rbp),%eax
sub    $0x39,%eax
add    $0x61,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x7a,-0x8(%rbp)
jle    1142 <color_label+0x42>
mov    -0x8(%rbp),%eax
sub    $0x7a,%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_label>:
lea    0x30(%rdi),%eax
lea    0x57(%rdi),%ecx
cmp    $0xa,%edi
cmovl  %eax,%ecx
lea    -0x3a(%rcx),%eax
cmp    $0x7b,%ecx
movzbl %al,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @color_label(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 48, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 57
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 57
%11 = add nsw i32 %10, 97
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %3
br label %13
13: ; preds = %8, %1
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 122
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 122
%19 = add nsw i32 %18, 65
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %16, %13
%22 = load i32, i32* %3
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @color_label(i32 %0) {
%2 = icmp sgt i32 %0, 9
%3 = select i1 %2, i32 87, i32 48
%4 = add nsw i32 %3, %0
%5 = icmp sgt i32 %4, 122
%6 = add i32 %4, 198
%7 = select i1 %5, i32 %6, i32 %4
%8 = trunc i32 %7 to i8
ret i8 %8
}
unsigned int bkdr(value)
unsigned int value;
{
  unsigned int seed = 131;
  unsigned int hash = 0;
  hash = (hash * seed) + ((value >> 0) & 0xFF);
  hash = (hash * seed) + ((value >> 8) & 0xFF);
  hash = (hash * seed) + ((value >> 16) & 0xFF);
  hash = (hash * seed) + ((value >> 24) & 0xFF);
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<bkdr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x83,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x0,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bkdr>:
mov    %edi,%ecx
movzbl %cl,%eax
imul   $0x83,%eax,%eax
movzbl %ch,%edx
add    %eax,%edx
imul   $0x83,%edx,%eax
mov    %edi,%edx
shr    $0x10,%edx
movzbl %dl,%edx
add    %eax,%edx
imul   $0x83,%edx,%eax
shr    $0x18,%ecx
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bkdr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 131, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %5, %6
%8 = load i32, i32* %2
%9 = lshr i32 %8, 0
%10 = and i32 %9, 255
%11 = add i32 %7, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = mul i32 %12, %13
%15 = load i32, i32* %2
%16 = lshr i32 %15, 8
%17 = and i32 %16, 255
%18 = add i32 %14, %17
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = mul i32 %19, %20
%22 = load i32, i32* %2
%23 = lshr i32 %22, 16
%24 = and i32 %23, 255
%25 = add i32 %21, %24
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = mul i32 %26, %27
%29 = load i32, i32* %2
%30 = lshr i32 %29, 24
%31 = and i32 %30, 255
%32 = add i32 %28, %31
store i32 %32, i32* %4
%33 = load i32, i32* %4
%34 = and i32 %33, 2147483647
ret i32 %34
}

LLVM IR (-O2):
define i32 @bkdr(i32 %0) {
%2 = and i32 %0, 255
%3 = mul nuw nsw i32 %2, 131
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = add nuw nsw i32 %3, %5
%7 = mul nuw nsw i32 %6, 131
%8 = lshr i32 %0, 16
%9 = and i32 %8, 255
%10 = add nuw nsw i32 %7, %9
%11 = mul nuw nsw i32 %10, 131
%12 = lshr i32 %0, 24
%13 = add nuw nsw i32 %11, %12
ret i32 %13
}
int fcmpun(float a, float b) { return __builtin_isunordered(a, b); }


x86 assembly (clang, -O0):
<fcmpun>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmpun>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @fcmpun(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp uno float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fcmpun(float %0, float %1) {
%3 = fcmp uno float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *threadFun1(void *arg) {
  while (1) {
    sleep((int)(arg));
    printf("sleptTime = %d\n", (int)(arg));
  }
}


x86 assembly (clang, -O0):
<threadFun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <threadFun1+0xc>

x86 assembly (clang, -O2):
<threadFun1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    %ebx,%edi
call   1040 <sleep@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <threadFun1+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"sleptTime = %d\0A\00"
define i8* @threadFun1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @sleep(i32 %5)
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"sleptTime = %d\0A\00"
define noalias i8* @threadFun1(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
br label %4
4: ; preds = %1, %4
%5 = tail call i32 @sleep(i32 %3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ setError(char *);
void malformed(void) {
  setError("malformed mem: path (use <start> or <start>+<len>)");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"malformed mem: path (use <start> or <start>+<len>)\00"
define void @malformed() {
%1 = call i32 @setError(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"malformed mem: path (use <start> or <start>+<len>)\00"
define void @malformed() {
%1 = tail call i32 @setError(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}
double opr_G(struct lifo *stack) { return 6.67259E-11; }


x86 assembly (clang, -O0):
<opr_G>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<opr_G>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.lifo = type opaque
define double @opr_G(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
ret double 6.672590e-11
}

LLVM IR (-O2):
%struct.lifo = type opaque
define double @opr_G(%struct.lifo* nocapture readnone %0) {
ret double 6.672590e-11
}
int ld_bgt_cr2(long double a1) { return !(__builtin_isgreater(100, a1)); }


x86 assembly (clang, -O0):
<ld_bgt_cr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_cr2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_bgt_cr2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ogt x86_fp80 0xK4005C800000000000000, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ld_bgt_cr2(x86_fp80 %0) {
%2 = fcmp uge x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_blocks;
};
typedef int /*<<< orphan*/ blkcnt_t;

/* Variables and functions */
blkcnt_t posix_stat_st_blocks(const struct stat *st) { return st->st_blocks; }


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

x86 assembly (clang, -O2):
<posix_stat_st_blocks>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_blocks(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_blocks(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ nomem();
void *realloc(void *, size_t);
void *xrealloc(void *w, size_t n) {
  void *v;
  v = realloc(w, n);
  if (n != 0 && !v)
    nomem();
  return v;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xrealloc+0x3e>
cmpq   $0x0,-0x18(%rbp)
jne    115e <xrealloc+0x3e>
mov    $0x0,%al
call   1030 <nomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <xrealloc+0x20>
test   %r14,%r14
jne    1140 <xrealloc+0x20>
xor    %eax,%eax
call   1030 <nomem@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i64 %1, 0
%5 = icmp ne i8* %3, null
%6 = or i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @nomem()
br label %9
9: ; preds = %7, %2
ret i8* %3
}
int GetLess(int x, int y) {
  int l;
  if (x < y)
    l = y;
  else
    l = x;
  return l;
}


x86 assembly (clang, -O0):
<GetLess>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <GetLess+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <GetLess+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLess>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @GetLess(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int socket_connect() {
  int ern, rc;
  ern = 0;
  return ern;
}


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

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

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

LLVM IR (-O2):
define i32 @socket_connect() {
ret i32 0
}