xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isnumeric(unsigned char const);
unsigned long numrun(unsigned const char *p) {
  unsigned const char *q = p;
  while (*q && isnumeric(*q))
    q++;
  return q - p;
}


x86 assembly (clang, -O0):
<numrun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114f <numrun+0x3f>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isnumeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <numrun+0x4f>
jmp    1170 <numrun+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <numrun+0x14>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numrun>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
mov    %rdi,%rbx
test   %al,%al
je     1149 <numrun+0x39>
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl %al,%edi
call   1030 <isnumeric@plt>
test   %rax,%rax
je     1149 <numrun+0x39>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <numrun+0x20>
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @numrun(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isnumeric(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
%15 = ptrtoint i8* %14 to i64
%16 = ptrtoint i8* %0 to i64
%17 = sub i64 %15, %16
ret i64 %17
}
/* Type definitions */
struct Symbol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Symbol *);
void deleteSymbol(struct Symbol *symbol) {
  if (symbol != NULL)
    free(symbol);
  return;
}


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

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

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

LLVM IR (-O2):
%struct.Symbol = type { i32 }
define void @deleteSymbol(%struct.Symbol* %0) {
%2 = icmp eq %struct.Symbol* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.Symbol* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void gdk_x11_register_standard_event_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_register_standard_event_type() {
ret void
}
int GetEndian(void) {
  long val;
  char *valp;
  val = 1;
  valp = (char *)&val;
  if (valp[0] == 1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<GetEndian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    1130 <GetEndian+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <GetEndian+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @GetEndian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ history_clear();
int /*<<< orphan*/ kill_clear();
void prompt_free(void) {
  history_clear();
  kill_clear();
}


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

x86 assembly (clang, -O2):
<prompt_free>:
push   %rax
xor    %eax,%eax
call   1030 <history_clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <kill_clear@plt>

LLVM IR (-O0):
define void @prompt_free() {
%1 = call i32 (...) @history_clear()
%2 = call i32 (...) @kill_clear()
ret void
}

LLVM IR (-O2):
define void @prompt_free() {
%1 = tail call i32 (...) @history_clear()
%2 = tail call i32 (...) @kill_clear()
ret void
}
/* Variables and functions */
int *calloc(int, int);
int /*<<< orphan*/ free(int *);
int main() {
  int *mem = calloc(3, sizeof(char));
  mem[0] = 100;
  mem[1] = 200;
  mem[2] = 300;
  free(mem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xc8,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x12c,0x8(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
movabs $0xc800000064,%rcx
mov    %rcx,(%rax)
movl   $0x12c,0x8(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @calloc(i32 3, i32 1)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 100, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 200, i32* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 300, i32* %9
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @calloc(i32 3, i32 1)
store i32 100, i32* %1
%2 = getelementptr inbounds i32, i32* %1, i64 1
store i32 200, i32* %2
%3 = getelementptr inbounds i32, i32* %1, i64 2
store i32 300, i32* %3
%4 = tail call i32 @free(i32* %1)
ret i32 0
}
void test45_Test7_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test45_Test7_targetInit__I() {
ret void
}
/* Type definitions */
typedef scalar_t__ __u16;

/* Variables and functions */
int modGT65536(__u16 x, __u16 y) {
  __u16 z;
  z = y + (__u16)0x8000;
  if (z > y)
    return ((x > y) && (x <= z));
  else
    return ((x > y) || (x <= z));
}


x86 assembly (clang, -O0):
<modGT65536>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8000,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1159 <modGT65536+0x59>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x21(%rbp)
jle    1149 <modGT65536+0x49>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
setle  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <modGT65536+0x85>
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
cmp    -0x18(%rbp),%rcx
mov    %al,-0x22(%rbp)
jg     117a <modGT65536+0x7a>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
setle  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modGT65536>:
cmp    %rsi,%rdi
setg   %al
add    $0x8000,%rsi
cmp    %rdi,%rsi
setge  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @modGT65536(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = add nsw i64 %7, 32768
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = icmp sgt i64 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i64, i64* %4
%18 = load i64, i64* %6
%19 = icmp sle i64 %17, %18
br label %20
20: ; preds = %16, %12
%21 = phi i1 [ false, %12 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %34
23: ; preds = %2
%24 = load i64, i64* %4
%25 = load i64, i64* %5
%26 = icmp sgt i64 %24, %25
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i64, i64* %4
%29 = load i64, i64* %6
%30 = icmp sle i64 %28, %29
br label %31
31: ; preds = %27, %23
%32 = phi i1 [ true, %23 ], [ %30, %27 ]
%33 = zext i1 %32 to i32
store i32 %33, i32* %3
br label %34
34: ; preds = %31, %20
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @modGT65536(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = add nsw i64 %1, 32768
%5 = icmp sge i64 %4, %0
%6 = select i1 %3, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void exit_usage() {
  fprintf(
      stderr,
      "Usage: ssdv [-e|-d] [-n] [-t <percentage>] [-c <callsign>] [-i <id>] "
      "[-q <level>] [<in file>] [<out file>]\n"
      "\n"
      "  -e Encode JPEG to SSDV packets.\n"
      "  -d Decode SSDV packets to JPEG.\n"
      "\n"
      "  -n Encode packets with no FEC.\n"
      "  -t For testing, drops the specified percentage of packets while "
      "decoding.\n"
      "  -c Set the callign. Accepts A-Z 0-9 and space, up to 6 characters.\n"
      "  -i Set the image ID (0-255).\n"
      "  -q Set the JPEG quality level (0 to 7, defaults to 4).\n"
      "  -v Print data for each packet decoded.\n"
      "\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [486 x i8] c"Usage: ssdv [-e|-d] [-n] [-t <percentage>] [-c <callsign>] [-i <id>] [-q <level>] [<in file>] [<out file>]\0A\0A -e Encode JPEG to SSDV packets.\0A -d Decode SSDV packets to JPEG.\0A\0A -n Encode packets with no FEC.\0A -t For testing, drops the specified percentage of packets while decoding.\0A -c Set the callign. Accepts A-Z 0-9 and space, up to 6 characters.\0A -i Set the image ID (0-255).\0A -q Set the JPEG quality level (0 to 7, defaults to 4).\0A -v Print data for each packet decoded.\0A\0A\00"
define void @exit_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([486 x i8], [486 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [486 x i8] c"Usage: ssdv [-e|-d] [-n] [-t <percentage>] [-c <callsign>] [-i <id>] [-q <level>] [<in file>] [<out file>]\0A\0A -e Encode JPEG to SSDV packets.\0A -d Decode SSDV packets to JPEG.\0A\0A -n Encode packets with no FEC.\0A -t For testing, drops the specified percentage of packets while decoding.\0A -c Set the callign. Accepts A-Z 0-9 and space, up to 6 characters.\0A -i Set the image ID (0-255).\0A -q Set the JPEG quality level (0 to 7, defaults to 4).\0A -v Print data for each packet decoded.\0A\0A\00"
define void @exit_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([486 x i8], [486 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int test_imm_25uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x25,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25uint64_highword_reg>:
movabs $0x2500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_25uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 158913789952
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void XtVaCreateWidget() {}


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

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

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

LLVM IR (-O2):
define void @XtVaCreateWidget() {
ret void
}
int modulo_signed(int a, int b) { return a % b; }


x86 assembly (clang, -O0):
<modulo_signed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo_signed>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modulo_signed(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @modulo_signed(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
unsigned long long cpu_stats_get_value_with_pattern(char *, int);
unsigned long long cpu_stats_get_intr() {
  return cpu_stats_get_value_with_pattern("intr ", 1);
}


x86 assembly (clang, -O0):
<cpu_stats_get_intr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <cpu_stats_get_value_with_pattern@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_stats_get_intr>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <cpu_stats_get_value_with_pattern@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"intr \00"
define i64 @cpu_stats_get_intr() {
%1 = call i64 @cpu_stats_get_value_with_pattern(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
ret i64 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"intr \00"
define i64 @cpu_stats_get_intr() {
%1 = tail call i64 @cpu_stats_get_value_with_pattern(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
ret i64 %1
}
unsigned long insert_bat(unsigned long insn, long value __attribute__((unused)),
                         int dialect __attribute__((unused)),
                         const char **errmsg __attribute__((unused))) {
  return insn | (((insn >> 21) & 0x1f) << 16);
}


x86 assembly (clang, -O0):
<insert_bat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x15,%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bat>:
mov    %rdi,%rax
shr    $0x5,%rax
and    $0x1f0000,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @insert_bat(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i64, i64* %5
%10 = load i64, i64* %5
%11 = lshr i64 %10, 21
%12 = and i64 %11, 31
%13 = shl i64 %12, 16
%14 = or i64 %9, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @insert_bat(i64 %0, i64 %1, i32 %2, i8** nocapture readnone %3) {
%5 = lshr i64 %0, 5
%6 = and i64 %5, 2031616
%7 = or i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ SendSynPacket(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("send syn packet start\n");
  SendSynPacket(10000000);
  printf("finish syn packet end\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x989680,%edi
call   1040 <SendSynPacket@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x989680,%edi
call   1040 <SendSynPacket@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"send syn packet start\0A\00"
@.str.1 = [23 x i8] c"finish syn packet end\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @SendSynPacket(i32 10000000)
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"send syn packet start\00"
@str.2 = [22 x i8] c"finish syn packet end\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @SendSynPacket(i32 10000000)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef char *uint8_t;

/* Variables and functions */
uint8_t in8(unsigned long port) {
  uint8_t tmp;
  __asm__ __volatile__("inb %w1, %b0" : "=a"(tmp) : "Nd"(port));
  return tmp;
}


x86 assembly (clang, -O0):
<in8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in8>:
mov    %rdi,%rdx
in     (%dx),%al
ret

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

LLVM IR (-O2):
define i8* @in8(i64 %0) {
%2 = tail call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() { printf("\E[1;11mUsage:\E[0;11m main --path FILE\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"\1B[1;11mUsage:\1B[0;11m main --path FILE\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"\1B[1;11mUsage:\1B[0;11m main --path FILE\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
int execute_chown() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_chown() {
ret i32 0
}
unsigned long tcfg_to_divisor(unsigned long tcfg1) { return 1 << tcfg1; }


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

x86 assembly (clang, -O2):
<tcfg_to_divisor>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

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

LLVM IR (-O2):
define i64 @tcfg_to_divisor(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
void handler() { signal(SIGALRM, handler); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rsi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rsi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @handler() {
%1 = load i32, i32* @SIGALRM
%2 = call i32 @signal(i32 %1, void (...)* bitcast (void ()* @handler to void (...)*))
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @handler() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @signal(i32 %1, void (...)* bitcast (void ()* @handler to void (...)*))
ret void
}
char *cryptpw(const char *clear) { return "foo"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i8* @cryptpw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @cryptpw(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ shr_logic(int /*<<< orphan*/, unsigned int);
bool bitpack_fitsu(uint64_t n, unsigned width) {
  assert(width <= 64);
  assert(width > 0);
  return shr_logic(n, width) == 0;
}


x86 assembly (clang, -O0):
<bitpack_fitsu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <shr_logic@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitpack_fitsu>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x41,%esi
setb   %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1030 <assert@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <shr_logic@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bitpack_fitsu(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 = icmp ule i32 %5, 64
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp ugt i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i64 @shr_logic(i32 %13, i32 %14)
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @bitpack_fitsu(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 65
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32 %1, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i64 @shr_logic(i32 %0, i32 %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
long strtol(char const *, char **, int);
long matoi(const char *str) {
  char *ptr;
  long ret = strtol(str, &ptr, 10);
  if (str == ptr)
    errno = EINVAL;
  return ret;
}


x86 assembly (clang, -O0):
<matoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1152 <matoi+0x42>
mov    0x2e91(%rip),%rax
mov    (%rax),%ecx
mov    0x2e90(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matoi>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    %rbx,0x8(%rsp)
jne    1140 <matoi+0x30>
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2ea2(%rip),%rdx
mov    %ecx,(%rdx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i64 @matoi(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %1
ret i64 %4
}
void foo477() {}


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

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

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

LLVM IR (-O2):
define void @foo477() {
ret void
}
/* Type definitions */
struct ln_rst_time {
  int dummy;
};
struct ln_lnlat_posn {
  int dummy;
};
struct ln_ell_orbit {
  int dummy;
};

/* Variables and functions */
int ln_get_ell_body_next_rst_horizon(double, struct ln_lnlat_posn *,
                                     struct ln_ell_orbit *, double,
                                     struct ln_rst_time *);
int ln_get_ell_body_next_rst(double JD, struct ln_lnlat_posn *observer,
                             struct ln_ell_orbit *orbit,
                             struct ln_rst_time *rst) {
  return ln_get_ell_body_next_rst_horizon(JD, observer, orbit, -0.5667, rst);
}


x86 assembly (clang, -O0):
<ln_get_ell_body_next_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movsd  0xebe(%rip),%xmm1
call   1030 <ln_get_ell_body_next_rst_horizon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_ell_body_next_rst>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <ln_get_ell_body_next_rst_horizon@plt>

LLVM IR (-O0):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_ell_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_ell_body_next_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_ell_orbit* %2, %struct.ln_rst_time* %3) {
%5 = alloca double
%6 = alloca %struct.ln_lnlat_posn*
%7 = alloca %struct.ln_ell_orbit*
%8 = alloca %struct.ln_rst_time*
store double %0, double* %5
store %struct.ln_lnlat_posn* %1, %struct.ln_lnlat_posn** %6
store %struct.ln_ell_orbit* %2, %struct.ln_ell_orbit** %7
store %struct.ln_rst_time* %3, %struct.ln_rst_time** %8
%9 = load double, double* %5
%10 = load %struct.ln_lnlat_posn*, %struct.ln_lnlat_posn** %6
%11 = load %struct.ln_ell_orbit*, %struct.ln_ell_orbit** %7
%12 = load %struct.ln_rst_time*, %struct.ln_rst_time** %8
%13 = call i32 @ln_get_ell_body_next_rst_horizon(double %9, %struct.ln_lnlat_posn* %10, %struct.ln_ell_orbit* %11, double -5.667000e-01, %struct.ln_rst_time* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_ell_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_ell_body_next_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_ell_orbit* %2, %struct.ln_rst_time* %3) {
%5 = tail call i32 @ln_get_ell_body_next_rst_horizon(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_ell_orbit* %2, double -5.667000e-01, %struct.ln_rst_time* %3)
ret i32 %5
}
int char_chr(char c, char *chr) {
  int i;
  i = 0;
  while (chr[i]) {
    if (c == chr[i])
      return (i);
    ++i;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<char_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1158 <char_chr+0x58>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114a <char_chr+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <char_chr+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <char_chr+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_chr>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <char_chr+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,%dl
je     1123 <char_chr+0x23>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <char_chr+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @char_chr(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
unsigned long FlashUsecGet(void) {
  return ((*((volatile unsigned long *)(0x400FE140))) + 1);
}


x86 assembly (clang, -O0):
<FlashUsecGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe140,%eax
mov    (%rax),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUsecGet>:
mov    0x400fe140,%rax
40
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @FlashUsecGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782528 to i64*)
%2 = add i64 %1, 1
ret i64 %2
}

LLVM IR (-O2):
define i64 @FlashUsecGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782528 to i64*)
%2 = add i64 %1, 1
ret i64 %2
}
void csv_emit_field_empty(void *ctx, const char *field, const char *end) {
  (void)ctx;
  (void)field;
  (void)end;
}


x86 assembly (clang, -O0):
<csv_emit_field_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @csv_emit_field_empty(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int test_imm_FAuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xfa,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FAuint64_midword_reg>:
test   $0xfa0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FAuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16384000
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
};

/* Variables and functions */
int sigaction(int const, struct sigaction *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int set_signal(const int signum, void (*handler)(int)) {
  struct sigaction new_action;
  new_action.sa_handler = handler;
  sigemptyset(&new_action.sa_mask);
  new_action.sa_flags = 0;
  return sigaction(signum, &new_action, 0);
}


x86 assembly (clang, -O0):
<set_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x10,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_signal>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
lea    0x18(%rsp),%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)*, i64, i32 }
define i32 @set_signal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = load void (i32)*, void (i32)** %4
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %6, void (i32)** %7
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 2
%9 = call i32 @sigemptyset(i32* %8)
%10 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %3
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %5, i32 0)
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i64, i32 }
define i32 @set_signal(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
%7 = call i32 @sigemptyset(i32* %6)
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
store i64 0, i64* %8
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32 0)
ret i32 %9
}
void new_dir(char *name) {}


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

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

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

LLVM IR (-O2):
define void @new_dir(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XA_ATOM;
int x_get_property_nr(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int, int /*<<< orphan*/ *, int);
int x_get_atom_property_nr(Window window, Atom property, Atom *prop_ret,
                           int nr) {
  return x_get_property_nr(window, XA_ATOM, property, sizeof(Atom), prop_ret,
                           nr);
}


x86 assembly (clang, -O0):
<x_get_atom_property_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x4,%ecx
call   1030 <x_get_property_nr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_get_atom_property_nr>:
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%edx
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%ecx
jmp    1030 <x_get_property_nr@plt>

LLVM IR (-O0):
@XA_ATOM = global i32 0
define i32 @x_get_atom_property_nr(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* @XA_ATOM
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @x_get_property_nr(i32 %9, i32 %10, i32 %11, i32 4, i32* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@XA_ATOM = global i32 0
define i32 @x_get_atom_property_nr(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = load i32, i32* @XA_ATOM
%6 = tail call i32 @x_get_property_nr(i32 %0, i32 %5, i32 %1, i32 4, i32* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy_len_Good(int);
void call_memcpy_len1_Good() { memcpy_len_Good(40); }


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

x86 assembly (clang, -O2):
<call_memcpy_len1_Good>:
mov    $0x28,%edi
jmp    1030 <memcpy_len_Good@plt>

LLVM IR (-O0):
define void @call_memcpy_len1_Good() {
%1 = call i32 @memcpy_len_Good(i32 40)
ret void
}

LLVM IR (-O2):
define void @call_memcpy_len1_Good() {
%1 = tail call i32 @memcpy_len_Good(i32 40)
ret void
}
/* Variables and functions */
scalar_t__ global_done();
int /*<<< orphan*/ global_shift();
int /*<<< orphan*/ step_begin();
scalar_t__ step_done();
int coll_done(void) {
  if (global_done())
    return 1;
  if (step_done()) {
    global_shift();
    if (global_done())
      return 1;
    step_begin();
  }
  return 0;
}


x86 assembly (clang, -O0):
<coll_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <global_done@plt>
cmp    $0x0,%rax
je     1165 <coll_done+0x25>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <coll_done+0x68>
mov    $0x0,%al
call   1060 <step_done@plt>
cmp    $0x0,%rax
je     11a1 <coll_done+0x61>
mov    $0x0,%al
call   1050 <global_shift@plt>
mov    $0x0,%al
call   1040 <global_done@plt>
cmp    $0x0,%rax
je     119a <coll_done+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <coll_done+0x68>
mov    $0x0,%al
call   1030 <step_begin@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coll_done>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <global_done@plt>
test   %rax,%rax
je     1158 <coll_done+0x18>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1060 <step_done@plt>
test   %rax,%rax
je     1154 <coll_done+0x14>
xor    %eax,%eax
call   1050 <global_shift@plt>
xor    %eax,%eax
call   1040 <global_done@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1154 <coll_done+0x14>
xor    %eax,%eax
call   1030 <step_begin@plt>
xor    %ebx,%ebx
jmp    1154 <coll_done+0x14>

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

LLVM IR (-O2):
define i32 @coll_done() {
%1 = tail call i64 (...) @global_done()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = tail call i64 (...) @step_done()
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i32 (...) @global_shift()
%8 = tail call i64 (...) @global_done()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 (...) @step_begin()
br label %12
12: ; preds = %3, %10, %6, %0
%13 = phi i32 [ 1, %0 ], [ 1, %6 ], [ 0, %10 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR3E_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMR3E_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 <U_WMRNOTIMPLEMENTED_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMR3E_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR3E_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int INT_MIN;
int f(int a) {
  if (a != INT_MIN) {
    a = a > 0 ? a : -a;
    if (a < 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
je     1157 <f+0x57>
cmpl   $0x0,-0x8(%rbp)
jle    112e <f+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <f+0x36>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1152 <f+0x52>
movl   $0x1,-0x4(%rbp)
jmp    115e <f+0x5e>
jmp    1157 <f+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @INT_MIN
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %21
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32, i32* %3
br label %15
12: ; preds = %7
%13 = load i32, i32* %3
%14 = sub nsw i32 0, %13
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ %11, %10 ], [ %14, %12 ]
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %2
br label %22
20: ; preds = %15
br label %21
21: ; preds = %20, %1
store i32 0, i32* %2
br label %22
22: ; preds = %21, %19
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @f(i32 %0) {
ret i32 0
}
int ToLower(int iChar) {
  return ((iChar >= 'A') && (iChar <= 'Z')) ? ('a' + (iChar - 'A')) : iChar;
}


x86 assembly (clang, -O0):
<ToLower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <ToLower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <ToLower+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <ToLower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToLower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ToLower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 97, %10
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @ToLower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}