xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *append(char *x, char *y) {
  char *buf = malloc((strlen(x) + strlen(y)) * sizeof(char));
  strcpy(buf, x);
  strcat(buf, y);
  return buf;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @append(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 1
%13 = trunc i64 %12 to i32
%14 = call i8* @malloc(i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %4
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @append(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i8* @malloc(i32 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
%8 = tail call i32 @strcat(i8* %6, i8* %1)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(int argc, const char *argv[]) {
  foo(3);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 3)
ret i32 0
}
/* Variables and functions */
char *create_string(size_t const);
int /*<<< orphan*/ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *,
                            double);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *create_string_from2(double v) {
  const size_t len = (size_t)snprintf(NULL, 0, "%lf", v);
  char *res = create_string(len);
  sprintf(res, "%lf", v);
  return res;
}


x86 assembly (clang, -O0):
<create_string_from2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeb1(%rip),%rdx
call   1030 <snprintf@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <create_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xe89(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_string_from2>:
push   %r14
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec0(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <snprintf@plt>
movslq %eax,%rdi
call   1040 <create_string@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
movsd  (%rsp),%xmm0
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i8* @create_string_from2(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca i8*
store double %0, double* %2
%5 = load double, double* %2
%6 = call i32 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i8* @create_string(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load double, double* %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i8* @create_string_from2(double %0) {
%2 = tail call i32 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
%3 = sext i32 %2 to i64
%4 = tail call i8* @create_string(i64 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %4
}
unsigned xrop3_148_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = T | S;
  stk3 = D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_148_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i8 %1, %0
%8 = zext i8 %7 to i32
%9 = xor i32 %4, %8
%10 = xor i32 %9, %6
%11 = xor i32 %4, -1
%12 = and i32 %10, %11
%13 = or i32 %12, %3
ret i32 %13
}
void iges_Psect(Pstat, numsec, ligne) int *Pstat;
int numsec;
char ligne[80];
{
  int dnum;
  dnum = atoi(&ligne[65]);
  ligne[64] = '\0';
  iges_curpart(numsec, dnum);
}


x86 assembly (clang, -O0):
<iges_Psect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x41,%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,0x40(%rax)
mov    -0xc(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <iges_curpart@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iges_Psect>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
lea    0x41(%rdx),%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
movb   $0x0,0x40(%rbx)
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <iges_curpart@plt>

LLVM IR (-O0):
define void @iges_Psect(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = getelementptr inbounds i8, i8* %8, i64 65
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %9)
store i32 %10, i32* %7
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 64
store i8 0, i8* %12
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iges_curpart to i32 (i32, i32, ...)*)(i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @iges_Psect(i32* nocapture readnone %0, i32 %1, i8* %2) {
%4 = getelementptr inbounds i8, i8* %2, i64 65
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %4)
%6 = getelementptr inbounds i8, i8* %2, i64 64
store i8 0, i8* %6
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iges_curpart to i32 (i32, i32, ...)*)(i32 %1, i32 %5)
ret void
}
int rsn_preauth_in_progress(struct wpa_sm *sm) { return 0; }


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

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

LLVM IR (-O0):
%struct.wpa_sm = type opaque
define i32 @rsn_preauth_in_progress(%struct.wpa_sm* %0) {
%2 = alloca %struct.wpa_sm*
store %struct.wpa_sm* %0, %struct.wpa_sm** %2
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_sm = type opaque
define i32 @rsn_preauth_in_progress(%struct.wpa_sm* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void x_cgo_free(void *p) {
  struct a {
    void *arg;
  } *a = p;
  free(a->arg);
}


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

x86 assembly (clang, -O2):
<x_cgo_free>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @x_cgo_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
int RECOIL_GetR5G5B5Color(int c) {
  c = (c & 31744) << 9 | (c & 992) << 6 | (c & 31) << 3;
  return c | (c >> 5 & 460551);
}


x86 assembly (clang, -O0):
<RECOIL_GetR5G5B5Color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7c00,%eax
shl    $0x9,%eax
mov    -0x4(%rbp),%ecx
and    $0x3e0,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
and    $0x70707,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RECOIL_GetR5G5B5Color>:
mov    %edi,%eax
shl    $0x9,%eax
and    $0xf80000,%eax
mov    %edi,%ecx
shl    $0x6,%ecx
and    $0xf800,%ecx
or     %eax,%ecx
and    $0x1f,%edi
lea    (%rcx,%rdi,8),%ecx
mov    %ecx,%eax
shr    $0x5,%eax
and    $0x70707,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @RECOIL_GetR5G5B5Color(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31744
%5 = shl i32 %4, 9
%6 = load i32, i32* %2
%7 = and i32 %6, 992
%8 = shl i32 %7, 6
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 31
%12 = shl i32 %11, 3
%13 = or i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 5
%17 = and i32 %16, 460551
%18 = or i32 %14, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @RECOIL_GetR5G5B5Color(i32 %0) {
%2 = shl i32 %0, 9
%3 = and i32 %2, 16252928
%4 = shl i32 %0, 6
%5 = and i32 %4, 63488
%6 = or i32 %3, %5
%7 = shl i32 %0, 3
%8 = and i32 %7, 248
%9 = or i32 %6, %8
%10 = lshr i32 %9, 5
%11 = and i32 %10, 460551
%12 = or i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ glmLog3f(float *, float *);
void glmLog3f_(float x[3]) { glmLog3f(x, x); }


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

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

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

LLVM IR (-O2):
define void @glmLog3f_(float* %0) {
%2 = tail call i32 @glmLog3f(float* %0, float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_memory();
int /*<<< orphan*/ test_memory2();
int main(void) {
  if (1)
    test_memory();
  if (1)
    test_memory2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_memory()
%2 = tail call i32 (...) @test_memory2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo(int x) {
  if (x != 2 && x != 3 && x != 10 && x != 11 && x != 17 && x != 18 && x != 23)
    bar();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1168 <foo+0x58>
cmpl   $0x3,-0x4(%rbp)
je     1168 <foo+0x58>
cmpl   $0xa,-0x4(%rbp)
je     1168 <foo+0x58>
cmpl   $0xb,-0x4(%rbp)
je     1168 <foo+0x58>
cmpl   $0x11,-0x4(%rbp)
je     1168 <foo+0x58>
cmpl   $0x12,-0x4(%rbp)
je     1168 <foo+0x58>
cmpl   $0x17,-0x4(%rbp)
je     1168 <foo+0x58>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x17,%edi
ja     1120 <foo+0x10>
mov    $0x860c0c,%eax
bt     %edi,%eax
jae    1120 <foo+0x10>
ret
xor    %eax,%eax
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0) {
switch i32 %0, label %2 [
i32 23, label %4
i32 18, label %4
i32 17, label %4
i32 11, label %4
i32 10, label %4
i32 3, label %4
i32 2, label %4
]
2: ; preds = %1
%3 = tail call i32 (...) @bar()
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
ret void
}
int main() {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef scalar_t__ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ INADDR_BROADCAST;
scalar_t__ htonl(int /*<<< orphan*/);
bool ipv4_is_broadcast(in_addr_t addr) {
  return addr == htonl(INADDR_BROADCAST);
}


x86 assembly (clang, -O0):
<ipv4_is_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <htonl@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_is_broadcast>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <htonl@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INADDR_BROADCAST = global i32 0
define i32 @ipv4_is_broadcast(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @INADDR_BROADCAST
%5 = call i64 @htonl(i32 %4)
%6 = icmp eq i64 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@INADDR_BROADCAST = global i32 0
define i32 @ipv4_is_broadcast(i64 %0) {
%2 = load i32, i32* @INADDR_BROADCAST
%3 = tail call i64 @htonl(i32 %2)
%4 = icmp eq i64 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ orgfx_enable_alpha(unsigned int);
int /*<<< orphan*/ orgfx_set_alpha(unsigned int);
void orgfxplus_alpha(unsigned int alpha, unsigned int enable) {
  orgfx_enable_alpha(enable);
  orgfx_set_alpha(alpha);
}


x86 assembly (clang, -O0):
<orgfxplus_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <orgfx_enable_alpha@plt>
mov    -0x4(%rbp),%edi
call   1040 <orgfx_set_alpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfxplus_alpha>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <orgfx_enable_alpha@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <orgfx_set_alpha@plt>

LLVM IR (-O0):
define void @orgfxplus_alpha(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @orgfx_enable_alpha(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @orgfx_set_alpha(i32 %7)
ret void
}

LLVM IR (-O2):
define void @orgfxplus_alpha(i32 %0, i32 %1) {
%3 = tail call i32 @orgfx_enable_alpha(i32 %1)
%4 = tail call i32 @orgfx_set_alpha(i32 %0)
ret void
}
int isgraph(int c) { return c > ' ' && c < 256; }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1123 <isgraph+0x23>
cmpl   $0x100,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0xdf,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 223
%4 = zext i1 %3 to i32
ret i32 %4
}
int VPo2(int v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<VPo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VPo2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @VPo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @VPo2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ glPushMatrix();
void PushMatrix(void) { glPushMatrix(); }


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

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

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

LLVM IR (-O2):
define void @PushMatrix() {
%1 = tail call i32 (...) @glPushMatrix()
ret void
}
/* Variables and functions */
int al_decode(char **);
int atr_next(char **attrp) {
  if (!*attrp || !**attrp) {
    return 0;
  } else {
    return al_decode(attrp);
  }
}


x86 assembly (clang, -O0):
<atr_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113a <atr_next+0x2a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
jne    1146 <atr_next+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1152 <atr_next+0x42>
mov    -0x10(%rbp),%rdi
call   1030 <al_decode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atr_next>:
mov    (%rdi),%rax
test   %rax,%rax
je     1122 <atr_next+0x12>
cmpb   $0x0,(%rax)
je     1122 <atr_next+0x12>
jmp    1030 <al_decode@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atr_next(i8** %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @al_decode(i8** %0)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
const uint64_t rotl64(uint64_t x, uint8_t n) {
  return (x << n) | (x >> (64 - n));
}


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

x86 assembly (clang, -O2):
<rotl64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl64(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dump_profile_info();
void dump_profile_info_() { dump_profile_info(); }


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

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

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

LLVM IR (-O2):
define void @dump_profile_info_() {
%1 = tail call i32 (...) @dump_profile_info()
ret void
}
/* Variables and functions */
int redislite_page_string_incr_by_key_string(void *, char *, size_t, int,
                                             long long *);
int redislite_page_string_incr_key_string(void *_cs, char *key_name,
                                          size_t key_length,
                                          long long *new_value) {
  return redislite_page_string_incr_by_key_string(_cs, key_name, key_length, 1,
                                                  new_value);
}


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

x86 assembly (clang, -O2):
<redislite_page_string_incr_key_string>:
mov    %rcx,%r8
mov    $0x1,%ecx
jmp    1030 <redislite_page_string_incr_by_key_string@plt>

LLVM IR (-O0):
define i32 @redislite_page_string_incr_key_string(i8* %0, i8* %1, i64 %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64* %3, i64** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64*, i64** %8
%13 = call i32 @redislite_page_string_incr_by_key_string(i8* %9, i8* %10, i64 %11, i32 1, i64* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @redislite_page_string_incr_key_string(i8* %0, i8* %1, i64 %2, i64* %3) {
%5 = tail call i32 @redislite_page_string_incr_by_key_string(i8* %0, i8* %1, i64 %2, i32 1, i64* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ outch(char);
void output(char *start) {
  if (start != 0) {
    int i = 0;
    for (i = 0; start[i] != 0; i++) {
      outch(start[i]);
    }
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <output+0x5e>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1169 <output+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <outch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <output+0x25>
jmp    116e <output+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbx
test   %rdi,%rdi
je     1143 <output+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <output+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <outch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <output+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @output(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8 [ %12, %6 ], [ %4, %3 ]
%9 = tail call i32 @outch(i8 signext %8)
%10 = add nuw i64 %7, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int itervalrnd(int, int, int *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int a, b, r;
  a = 30;
  b = 60;
  r = 3;
  printf("\nThe number is :");
  printf("%d", itervalrnd(a, b, &r));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1e,-0x4(%rbp)
movl   $0x3c,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
call   1050 <itervalrnd@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
mov    $0x1e,%edi
mov    $0x3c,%esi
call   1050 <itervalrnd@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0AThe number is :\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 30, i32* %1
store i32 60, i32* %2
store i32 3, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @itervalrnd(i32 %5, i32 %6, i32* %3)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0AThe number is :\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @itervalrnd(i32 30, i32 60, i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getch()
ret i32 0
}
int utime(const char *__file, const struct utimbuf *__times) { return -1; }


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.utimbuf = type opaque
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = alloca i8*
%4 = alloca %struct.utimbuf*
store i8* %0, i8** %3
store %struct.utimbuf* %1, %struct.utimbuf** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.utimbuf = type opaque
define i32 @utime(i8* nocapture readnone %0, %struct.utimbuf* nocapture readnone %1) {
ret i32 -1
}
void gf_multby_one(void *src, void *dest, unsigned bytes, int xor) {
  if (xor) {
    galois_region_xor(src, dest, dest, bytes);
  } else {
    memcpy(dest, src, bytes);
  }
}


x86 assembly (clang, -O0):
<gf_multby_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     115b <gf_multby_one+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x0,%al
call   1040 <galois_region_xor@plt>
jmp    116d <gf_multby_one+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_multby_one>:
mov    %edx,%r8d
mov    %rdi,%rax
test   %ecx,%ecx
je     113a <gf_multby_one+0x1a>
mov    %rax,%rdi
mov    %rsi,%rdx
mov    %r8d,%ecx
xor    %eax,%eax
jmp    1040 <galois_region_xor@plt>
mov    %r8d,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @gf_multby_one(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @galois_region_xor to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i8* %1, i32 %2)
br label %10
8: ; preds = %4
%9 = zext i32 %2 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %0, i64 %9, i1 false)
br label %10
10: ; preds = %8, %6
ret void
}
void uwsgi_alarm_init_log(struct uwsgi_alarm_instance *uai) {}


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

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

LLVM IR (-O0):
%struct.uwsgi_alarm_instance = type opaque
define void @uwsgi_alarm_init_log(%struct.uwsgi_alarm_instance* %0) {
%2 = alloca %struct.uwsgi_alarm_instance*
store %struct.uwsgi_alarm_instance* %0, %struct.uwsgi_alarm_instance** %2
ret void
}

LLVM IR (-O2):
%struct.uwsgi_alarm_instance = type opaque
define void @uwsgi_alarm_init_log(%struct.uwsgi_alarm_instance* nocapture %0) {
ret void
}
void test2_BlinkMilli2_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test2_BlinkMilli2_targetInit__I() {
ret void
}
/* Variables and functions */
int nc_abort(int);
int /*<<< orphan*/ nc_advise(char *, int const, char *, int);
int ncabort(int ncid) {
  const int status = nc_abort(ncid);
  if (status != 0) {
    nc_advise("ncabort", status, "ncid %d", ncid);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ncabort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <nc_abort@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1165 <ncabort+0x45>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xeb3(%rip),%rdi
lea    0xeb4(%rip),%rdx
call   1040 <nc_advise@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <ncabort+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncabort>:
push   %rbx
mov    %edi,%ebx
call   1030 <nc_abort@plt>
test   %eax,%eax
je     114a <ncabort+0x2a>
lea    0xecd(%rip),%rdi
lea    0xece(%rip),%rdx
mov    %eax,%esi
mov    %ebx,%ecx
call   1040 <nc_advise@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"ncabort\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncabort(i32 %0) {
%2 = tail call i32 @nc_abort(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @nc_advise(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ core3_swap(char *, int);
void U_EMRSELECTPALETTE_swap(char *record, int torev) {
  core3_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRSELECTPALETTE_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRSELECTPALETTE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct RNAup_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RNAup_cmdline_parser_release(struct RNAup_args_info *);
void RNAup_cmdline_parser_free(struct RNAup_args_info *args_info) {
  RNAup_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<RNAup_cmdline_parser_free>:
jmp    1030 <RNAup_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.RNAup_args_info = type { i32 }
define void @RNAup_cmdline_parser_free(%struct.RNAup_args_info* %0) {
%2 = tail call i32 @RNAup_cmdline_parser_release(%struct.RNAup_args_info* %0)
ret void
}
/* Variables and functions */
int height(int);
int right(int x) {
  int h = height(x);
  return x + (1 << (h - 1));
}


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <height@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
push   %rbx
mov    %edi,%ebx
call   1030 <height@plt>
lea    -0x1(%rax),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @right(i32 %0) {
%2 = tail call i32 @height(i32 %0)
%3 = add nsw i32 %2, -1
%4 = shl nuw i32 1, %3
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int fcmp(double const, double const);
int compare_keys(double const *a, double const *b) {
  int diff;
  diff = fcmp(a[0], b[0]);
  if (diff != 0)
    return diff;
  return fcmp(a[1], b[1]);
}


x86 assembly (clang, -O0):
<compare_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
call   1030 <fcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114d <compare_keys+0x3d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <compare_keys+0x57>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
call   1030 <fcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_keys>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
call   1030 <fcmp@plt>
test   %eax,%eax
je     1133 <compare_keys+0x23>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movsd  0x8(%rbx),%xmm0
movsd  0x8(%r14),%xmm1
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_keys(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call i32 @fcmp(double %3, double %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = tail call i32 @fcmp(double %9, double %11)
br label %13
13: ; preds = %2, %7
%14 = phi i32 [ %12, %7 ], [ %5, %2 ]
ret i32 %14
}