xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int CalculateLog2(unsigned int);
unsigned int CalculateBitsNeeded(unsigned int n) {
  unsigned int shift = CalculateLog2(n);
  shift += ((1 << shift) - n) >> 31;
  return shift;
}


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

x86 assembly (clang, -O2):
<CalculateBitsNeeded>:
push   %rbx
mov    %edi,%ebx
call   1030 <CalculateLog2@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
sub    %ebx,%edx
shr    $0x1f,%edx
add    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CalculateBitsNeeded(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @CalculateLog2(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = load i32, i32* %2
%9 = sub i32 %7, %8
%10 = lshr i32 %9, 31
%11 = load i32, i32* %3
%12 = add i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @CalculateBitsNeeded(i32 %0) {
%2 = tail call i32 @CalculateLog2(i32 %0)
%3 = shl nuw i32 1, %2
%4 = sub i32 %3, %0
%5 = lshr i32 %4, 31
%6 = add i32 %5, %2
ret i32 %6
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_reverse(struct genlist *);
void fileinfo_list_reverse(struct fileinfo_list *tthis) {
  genlist_reverse((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fileinfo_list_reverse>:
jmp    1030 <genlist_reverse@plt>

LLVM IR (-O0):
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define void @fileinfo_list_reverse(%struct.fileinfo_list* %0) {
%2 = alloca %struct.fileinfo_list*
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %2
%3 = load %struct.fileinfo_list*, %struct.fileinfo_list** %2
%4 = bitcast %struct.fileinfo_list* %3 to %struct.genlist*
%5 = call i32 @genlist_reverse(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define void @fileinfo_list_reverse(%struct.fileinfo_list* %0) {
%2 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_reverse(%struct.genlist* %2)
ret void
}
unsigned xrop3_134_1_1(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 = D | S;
  stk3 = T & stk4;
  stk2 = S ^ stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_134_1_1>:
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    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%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    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_134_1_1(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* %5
%25 = load i32, i32* %6
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %7
%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* %5
%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* %7
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %6
%45 = and i32 %43, %44
%46 = or i32 %42, %45
%47 = load i32, i32* %5
%48 = load i32, i32* %7
%49 = and i32 %47, %48
%50 = or i32 %46, %49
ret i32 %50
}

LLVM IR (-O2):
define i32 @xrop3_134_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Type definitions */
typedef int u_short;

/* Variables and functions */
int htons(int);
int ntohs(int);
int change_port(u_short *pport) {
  u_short port = ntohs(*pport);
  switch (port) {
    port += 50000;
    *pport = htons(port);
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<change_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_port>:
push   %rax
mov    (%rdi),%edi
call   1030 <ntohs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @change_port(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
switch i32 %7, label %8 [
]
8: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @change_port(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ntohs(i32 %2)
ret i32 0
}
_Complex float test_ctanhf(_Complex float x) { return __builtin_ctanhf(x); }


x86 assembly (clang, -O0):
<test_ctanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <ctanhf@plt>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ctanhf>:
jmp    1030 <ctanhf@plt>

LLVM IR (-O0):
define <2 x float> @test_ctanhf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %8, float* %11
store float %10, float* %12
%13 = bitcast { float, float }* %4 to <2 x float>*
%14 = load <2 x float>, <2 x float>* %13
%15 = call <2 x float> @ctanhf(<2 x float> %14)
%16 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %15, <2 x float>* %16
%17 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%20 = load float, float* %19
%21 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%22 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %18, float* %21
store float %20, float* %22
%23 = bitcast { float, float }* %2 to <2 x float>*
%24 = load <2 x float>, <2 x float>* %23
ret <2 x float> %24
}

LLVM IR (-O2):
define <2 x float> @test_ctanhf(<2 x float> %0) {
%2 = tail call <2 x float> @ctanhf(<2 x float> %0)
ret <2 x float> %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void do_lots_of_stuff(int id) {
  printf("[%d] Doing lots of interesting things!...\n", id);
}


x86 assembly (clang, -O0):
<do_lots_of_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_lots_of_stuff>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"[%d] Doing lots of interesting things!...\0A\00"
define void @do_lots_of_stuff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"[%d] Doing lots of interesting things!...\0A\00"
define void @do_lots_of_stuff(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct pth_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void pth_exit(struct pth_t *pth, void *retval) { pthread_exit(retval); }


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

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

LLVM IR (-O0):
%struct.pth_t = type { i32 }
define void @pth_exit(%struct.pth_t* %0, i8* %1) {
%3 = alloca %struct.pth_t*
%4 = alloca i8*
store %struct.pth_t* %0, %struct.pth_t** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @pthread_exit(i8* %5)
ret void
}

LLVM IR (-O2):
%struct.pth_t = type { i32 }
define void @pth_exit(%struct.pth_t* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @pthread_exit(i8* %1)
ret void
}
void test31_BlinkMsp430_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test31_BlinkMsp430_targetInit__I() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
signed int getSize(char *text) {
  FILE *fp;
  fp = fopen(text, "r");
  fseek(fp, 0L, SEEK_END);
  signed int size = ftell(fp);
  rewind(fp);
  fclose(fp);
  return size;
}


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1060 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1050 <ftell@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
push   %rbp
push   %rbx
push   %rax
lea    0xea6(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <fseek@plt>
mov    %rbx,%rdi
call   1050 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <rewind@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i32 @getSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = call i32 @rewind(i32* %12)
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i32 @getSize(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i64 0, i32 %3)
%5 = tail call i32 @ftell(i32* %2)
%6 = tail call i32 @rewind(i32* %2)
%7 = tail call i32 @fclose(i32* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: dumper [-b]\n"
                  "-b binary dump\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 = [35 x i8] c"Usage: dumper [-b]\0A-b binary dump\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: dumper [-b]\0A-b binary dump\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ rand();
void jsll_rand(uint64_t *n) {
  *n = ((uint64_t)(uint32_t)rand() << 33) ^
       ((uint64_t)(uint32_t)rand() << 16) + (uint32_t)rand();
}


x86 assembly (clang, -O0):
<jsll_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x21,%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x10(%rbp),%ecx
mov    %rax,%rdx
mov    -0xc(%rbp),%eax
add    %edx,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsll_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rand@plt>

LLVM IR (-O0):
define void @jsll_rand(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 33
%6 = call i64 (...) @rand()
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = call i64 (...) @rand()
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %8, %10
%12 = xor i32 %5, %11
%13 = load i32*, i32** %2
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @jsll_rand(i32* nocapture readnone %0) {
%2 = tail call i64 (...) @rand()
%3 = tail call i64 (...) @rand()
%4 = tail call i64 (...) @rand()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cfe_free(void *);
void cfe_free_secure(void *ptr) { cfe_free(ptr); }


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

x86 assembly (clang, -O2):
<cfe_free_secure>:
jmp    1030 <cfe_free@plt>

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

LLVM IR (-O2):
define void @cfe_free_secure(i8* %0) {
%2 = tail call i32 @cfe_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exp(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_exp(void) { lua_pushnumber(exp(luaL_check_number(1))); }


x86 assembly (clang, -O0):
<math_exp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <exp@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_exp>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <exp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_exp() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @exp(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @math_exp() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @exp(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t smpte_fec_get_snbase_ext(const uint8_t *p_fec) { return p_fec[15]; }


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

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

LLVM IR (-O0):
define i32 @smpte_fec_get_snbase_ext(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 15
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @smpte_fec_get_snbase_ext(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 15
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Dequeue();
int /*<<< orphan*/ Enqueue(int);
int /*<<< orphan*/ Print();
int main() {
  Enqueue(2);
  Print();
  Enqueue(4);
  Print();
  Enqueue(6);
  Print();
  Dequeue();
  Print();
  Enqueue(8);
  Print();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <Enqueue@plt>
mov    $0x0,%al
call   1050 <Print@plt>
mov    $0x4,%edi
call   1030 <Enqueue@plt>
mov    $0x0,%al
call   1050 <Print@plt>
mov    $0x6,%edi
call   1030 <Enqueue@plt>
mov    $0x0,%al
call   1050 <Print@plt>
mov    $0x0,%al
call   1040 <Dequeue@plt>
mov    $0x0,%al
call   1050 <Print@plt>
mov    $0x8,%edi
call   1030 <Enqueue@plt>
mov    $0x0,%al
call   1050 <Print@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <Enqueue@plt>
xor    %eax,%eax
call   1050 <Print@plt>
mov    $0x4,%edi
call   1030 <Enqueue@plt>
xor    %eax,%eax
call   1050 <Print@plt>
mov    $0x6,%edi
call   1030 <Enqueue@plt>
xor    %eax,%eax
call   1050 <Print@plt>
xor    %eax,%eax
call   1040 <Dequeue@plt>
xor    %eax,%eax
call   1050 <Print@plt>
mov    $0x8,%edi
call   1030 <Enqueue@plt>
xor    %eax,%eax
call   1050 <Print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @Enqueue(i32 2)
%2 = call i32 (...) @Print()
%3 = call i32 @Enqueue(i32 4)
%4 = call i32 (...) @Print()
%5 = call i32 @Enqueue(i32 6)
%6 = call i32 (...) @Print()
%7 = call i32 (...) @Dequeue()
%8 = call i32 (...) @Print()
%9 = call i32 @Enqueue(i32 8)
%10 = call i32 (...) @Print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Enqueue(i32 2)
%2 = tail call i32 (...) @Print()
%3 = tail call i32 @Enqueue(i32 4)
%4 = tail call i32 (...) @Print()
%5 = tail call i32 @Enqueue(i32 6)
%6 = tail call i32 (...) @Print()
%7 = tail call i32 (...) @Dequeue()
%8 = tail call i32 (...) @Print()
%9 = tail call i32 @Enqueue(i32 8)
%10 = tail call i32 (...) @Print()
ret i32 0
}
/* Type definitions */
struct qserver {
  int dummy;
};

/* Variables and functions */
int get_param_i_value(struct qserver *, char *, int /*<<< orphan*/);
int all_ts3_servers(struct qserver *server) {
  return (1 == get_param_i_value(server, "allservers", 0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<all_ts3_servers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
xor    %edx,%edx
call   1030 <get_param_i_value@plt>
mov    %eax,%edx
mov    $0x1,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_ts3_servers>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edx,%edx
call   1030 <get_param_i_value@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.qserver = type { i32 }
@.str = [11 x i8] c"allservers\00"
define i32 @all_ts3_servers(%struct.qserver* %0) {
%2 = alloca %struct.qserver*
store %struct.qserver* %0, %struct.qserver** %2
%3 = load %struct.qserver*, %struct.qserver** %2
%4 = call i32 @get_param_i_value(%struct.qserver* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = icmp eq i32 1, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
%struct.qserver = type { i32 }
@.str = [11 x i8] c"allservers\00"
define i32 @all_ts3_servers(%struct.qserver* %0) {
%2 = tail call i32 @get_param_i_value(%struct.qserver* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned g2d(unsigned a) {
  a ^= a >> 4;
  a ^= a >> 2;
  a ^= a >> 1;
  return a;
}


x86 assembly (clang, -O0):
<g2d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2d>:
mov    %edi,%eax
shr    $0x4,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @g2d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 1
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @g2d(i32 %0) {
%2 = lshr i32 %0, 4
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 2
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 1
%7 = xor i32 %6, %5
ret i32 %7
}
float test_00(float a, float b) { return a * b + a; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
mulss  %xmm0,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @test_00(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 = load float, float* %3
%8 = call float @llvm.fmuladd.f32(float %5, float %6, float %7)
ret float %8
}

LLVM IR (-O2):
define float @test_00(float %0, float %1) {
%3 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %0)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ spin(char *);
void TestC() {
  spin("TestC");
  while (1) {
    printf("C");
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestC>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <spin@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1140 <TestC+0x10>

x86 assembly (clang, -O2):
<TestC>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <spin@plt>
nopl   (%rax)
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1140 <TestC+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"TestC\00"
@.str.1 = [2 x i8] c"C\00"
define void @TestC() {
%1 = call i32 @spin(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 200)
br label %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"TestC\00"
define void @TestC() {
%1 = tail call i32 @spin(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @putchar(i32 67)
%4 = tail call i32 @milli_delay(i32 200)
br label %2
}
ISR(TIMER3_COMPB_vect) {
  DEBUG("ISR "
        "TIMER3_COMPB"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ISR TIMER3_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [25 x i8] c"ISR TIMER3_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void WatchdogResetDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000008))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<WatchdogResetDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogResetDisable>:
andq   $0xfffffffffffffffd,0x8(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogResetDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -3
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @WatchdogResetDisable(i64 %0) {
%2 = add nsw i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -3
store volatile i64 %5, i64* %3
ret void
}
int is_comment_str(const char *str) {
  if (*str == '#') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_comment_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1124 <is_comment_str+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <is_comment_str+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_comment_str>:
xor    %eax,%eax
cmpb   $0x23,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_comment_str(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 35
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_comment_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = zext i1 %3 to i32
ret i32 %4
}
int main() {
  int a, b, c, d, e, f;
  if (a == 5) {
    b = 7;
  }
  if (b > 0) {
    if (c == 10) {
      d = 40;
    }
  }
  if (e < 0) {
    if (d >= 10) {
      f = 10;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    111c <main+0x1c>
movl   $0x7,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113c <main+0x3c>
cmpl   $0xa,-0x10(%rbp)
jne    1137 <main+0x37>
movl   $0x28,-0x14(%rbp)
jmp    113c <main+0x3c>
cmpl   $0x0,-0x18(%rbp)
jge    115c <main+0x5c>
cmpl   $0xa,-0x14(%rbp)
jl     1157 <main+0x57>
movl   $0xa,-0x1c(%rbp)
jmp    115c <main+0x5c>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 5
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 7, i32* %3
br label %11
11: ; preds = %10, %0
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 40, i32* %5
br label %18
18: ; preds = %17, %14
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %5
%24 = icmp sge i32 %23, 10
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 10, i32* %7
br label %26
26: ; preds = %25, %22
br label %27
27: ; preds = %26, %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t encodeSecondByte(uint32_t a) {
  uint32_t *p_a = &a;
  uint8_t *p_b = (uint8_t *)p_a;
  return *(p_b + 1);
}


x86 assembly (clang, -O0):
<encodeSecondByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @encodeSecondByte(i32 %0) {
ret i32 poison
}
unsigned short swap_16(unsigned short n) { return (n >> 8) | (n << 8); }


x86 assembly (clang, -O0):
<swap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @swap_16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @swap_16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ bcd;

/* Variables and functions */
uint8_t bcd_to_dec(uint8_t bcd) {
  return (uint8_t)(((((bcd) >> 4) & 0x0F) * 10) + (((bcd)&0x0F)));
}


x86 assembly (clang, -O0):
<bcd_to_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
imul   $0xa,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bcd_to_dec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = and i32 %4, 15
%6 = mul nsw i32 %5, 10
%7 = load i32, i32* %2
%8 = and i32 %7, 15
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bcd_to_dec(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = mul nuw nsw i32 %3, 10
%5 = and i32 %0, 15
%6 = add nuw nsw i32 %4, %5
ret i32 %6
}
void uninit_in_loop_goto() {
  int produce(void);
  void consume(int);
  for (int n = 0; n < 100; ++n) {
    goto skip_decl;
    int k;
  skip_decl:
    consume(k);
    k = produce();
  }
}


x86 assembly (clang, -O0):
<uninit_in_loop_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    115c <uninit_in_loop_goto+0x3c>
jmp    113e <uninit_in_loop_goto+0x1e>
mov    -0x8(%rbp),%edi
call   1040 <consume@plt>
call   1030 <produce@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <uninit_in_loop_goto+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @uninit_in_loop_goto() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %13
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = call i32 @produce()
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
/* Variables and functions */
char *no_malloc_number_to_string(long);
int write_string(int, char const *);
int write_long(int fd, long n) {
  const char *str = no_malloc_number_to_string(n);
  return write_string(fd, str);
}


x86 assembly (clang, -O0):
<write_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <no_malloc_number_to_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <write_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_long>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <no_malloc_number_to_string@plt>
mov    %ebx,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <write_string@plt>

LLVM IR (-O0):
define i32 @write_long(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @no_malloc_number_to_string(i64 %6)
store i8* %7, i8** %5
%8 = load i32, i32* %3
%9 = load i8*, i8** %5
%10 = call i32 @write_string(i32 %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_long(i32 %0, i64 %1) {
%3 = tail call i8* @no_malloc_number_to_string(i64 %1)
%4 = tail call i32 @write_string(i32 %0, i8* %3)
ret i32 %4
}
void g_tree_nnodes() {}


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

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

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

LLVM IR (-O2):
define void @g_tree_nnodes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Input(char *, int *);
int main(int argc, char *argv[]) {
  char BUF_NAME[] = {'z', 'h', 'a', 'n', 'g', 's', 'a', 'n', '0', '0',
                     'l', 'i', 's', 'i', '0', '0', '0', '0', '0', '0',
                     'w', 'a', 'n', 'g', 'w', 'u', '0', '0', '0', '0',
                     'x', 'u', 'x', 'i', 'a', 'o', 'h', 'u', 'a', '0'};
  int BUF_SCORE[] = {100, 85, 80, 0, 80, 100, 70, 0,
                     70,  60, 80, 0, 40, 55,  61, 0};
  Input(BUF_NAME, BUF_SCORE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xede(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <Input@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x306175686f616978,%rax
75 61 30
mov    %rax,0x20(%rsp)
movaps 0xf1f(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
call   1030 <Input@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.BUF_NAME = [40 x i8] c"zhangsan00lisi000000wangwu0000xuxiaohua0"
@__const.main.BUF_SCORE = [16 x i32] [i32 100, i32 85, i32 80, i32 0, i32 80, i32 100, i32 70, i32 0, i32 70, i32 60, i32 80, i32 0, i32 40, i32 55, i32 61, i32 0]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [40 x i8]
%6 = alloca [16 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [40 x i8]* %5 to i8*
%8 = bitcast [16 x i32]* %6 to i8*
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%11 = call i32 @Input(i8* %9, i32* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.BUF_NAME = [40 x i8] c"zhangsan00lisi000000wangwu0000xuxiaohua0"
@__const.main.BUF_SCORE = [16 x i32] [i32 100, i32 85, i32 80, i32 0, i32 80, i32 100, i32 70, i32 0, i32 70, i32 60, i32 80, i32 0, i32 40, i32 55, i32 61, i32 0]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [40 x i8]
%4 = alloca [16 x i32]
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%6 = bitcast [16 x i32]* %4 to i8*
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%8 = call i32 @Input(i8* %5, i32* %7)
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *VdsCalloc(size_t nmemb, size_t size) { return calloc(nmemb, size); }


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

x86 assembly (clang, -O2):
<VdsCalloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @VdsCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @VdsCalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
uint64_t rdrand64() {
  uint64_t r;
  int ok;
  asm volatile("1: .byte 0x48,0x0f,0xc7,0xf0\n\t"
               "jc 2f\n\t"
               "dec %0\n\t"
               "jnz 1b\n\t"
               "2:"
               : "=r"(ok), "=a"(r)
               : "0"(10));
  if (!ok) {
    assert(0);
    exit(32);
  }
  return r;
}


x86 assembly (clang, -O0):
<rdrand64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%ecx
rdrand %rax
jb     113f <rdrand64+0x1f>
dec    %ecx
jne    112d <rdrand64+0xd>
mov    %ecx,-0xc(%rbp)
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1161 <rdrand64+0x41>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x20,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdrand64>:
mov    $0xa,%ecx
rdrand %rax
jb     112f <rdrand64+0xf>
dec    %ecx
jne    1125 <rdrand64+0x5>
test   %ecx,%ecx
je     1134 <rdrand64+0x14>
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x20,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @rdrand64() {
%1 = alloca i8*
%2 = alloca i32
%3 = call { i32, i8* } asm sideeffect "1: .byte 0x48,0x0f,0xc7,0xf0\0A\09jc 2f\0A\09dec $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 10)
%4 = extractvalue { i32, i8* } %3, 0
%5 = extractvalue { i32, i8* } %3, 1
store i32 %4, i32* %2
store i8* %5, i8** %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = call i32 @assert(i32 0)
%10 = call i32 @exit(i32 32)
unreachable
11: ; preds = %0
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
define i8* @rdrand64() {
%1 = tail call { i32, i8* } asm sideeffect "1: .byte 0x48,0x0f,0xc7,0xf0\0A\09jc 2f\0A\09dec $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 10)
%2 = extractvalue { i32, i8* } %1, 0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @assert(i32 0)
%6 = tail call i32 @exit(i32 32)
unreachable
7: ; preds = %0
%8 = extractvalue { i32, i8* } %1, 1
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: bridge fdb { add | append | del | replace } ADDR dev "
                  "DEV {self|master} [ temp ]\n"
                  "              [router] [ dst IPADDR] [ vlan VID ]\n"
                  "              [ port PORT] [ vni VNI ] [via DEV]\n");
  fprintf(stderr, "       bridge fdb {show} [ dev DEV ]\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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf72(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [187 x i8] c"Usage: bridge fdb { add | append | del | replace } ADDR dev DEV {self|master} [ temp ]\0A [router] [ dst IPADDR] [ vlan VID ]\0A [ port PORT] [ vni VNI ] [via DEV]\0A\00"
@.str.1 = [38 x i8] c" bridge fdb {show} [ dev DEV ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [187 x i8] c"Usage: bridge fdb { add | append | del | replace } ADDR dev DEV {self|master} [ temp ]\0A [router] [ dst IPADDR] [ vlan VID ]\0A [ port PORT] [ vni VNI ] [via DEV]\0A\00"
@.str.1 = [38 x i8] c" bridge fdb {show} [ dev DEV ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ is_littleendian();
uint64_t print_ID(uint64_t ID) {
  unsigned short i;
  uint64_t result;
  unsigned char *res_p = (unsigned char *)&result, *ID_p = (unsigned char *)&ID;
  if (is_littleendian()) {
    for (i = 0; i < 8; i++)
      res_p[i] = ID_p[7 - i];
  } else {
    result = ID;
  }
  return result;
}


x86 assembly (clang, -O0):
<print_ID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <is_littleendian@plt>
cmp    $0x0,%rax
je     1185 <print_ID+0x75>
movw   $0x0,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x8,%eax
jge    1180 <print_ID+0x70>
mov    -0x20(%rbp),%rax
movzwl -0x6(%rbp),%edx
mov    $0x7,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movzwl -0x6(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x6(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x6(%rbp)
jmp    1142 <print_ID+0x32>
jmp    118b <print_ID+0x7b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ID>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_littleendian@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @print_ID(i32 %0) {
%2 = tail call i64 (...) @is_littleendian()
ret i32 %0
}