xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *prg) {
  fprintf(stderr,
          "Usage: %s [Options]\n"
          "Options:\n"
          " -i, --infile=FILE      input file\n"
          " -o  --outfile=FILE     outputfile\n"
          " -m  --memctrl=REG      Memory Control register value\n"
          " -s, --sdramctrl=REG    SDRAM Control regster value\n"
          " -t, --sdramtimctrl=REG SDRAM Timing Control regster value\n"
          " -e, --entrypoint=ADR   Application entrypoint\n"
          " -c, --cookie=BITS      Cookie to use (8|16|32)\n"
          " -h, --help            this help\n",
          prg);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [393 x i8] c"Usage: %s [Options]\0AOptions:\0A -i, --infile=FILE input file\0A -o --outfile=FILE outputfile\0A -m --memctrl=REG Memory Control register value\0A -s, --sdramctrl=REG SDRAM Control regster value\0A -t, --sdramtimctrl=REG SDRAM Timing Control regster value\0A -e, --entrypoint=ADR Application entrypoint\0A -c, --cookie=BITS Cookie to use (8|16|32)\0A -h, --help this help\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([393 x i8], [393 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [393 x i8] c"Usage: %s [Options]\0AOptions:\0A -i, --infile=FILE input file\0A -o --outfile=FILE outputfile\0A -m --memctrl=REG Memory Control register value\0A -s, --sdramctrl=REG SDRAM Control regster value\0A -t, --sdramtimctrl=REG SDRAM Timing Control regster value\0A -e, --entrypoint=ADR Application entrypoint\0A -c, --cookie=BITS Cookie to use (8|16|32)\0A -h, --help this help\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([393 x i8], [393 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Eat me\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Eat me\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Eat me\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
void *js_malloc(size_t size) {
  void *mem = malloc(size);
  if (mem == NULL) {
    exit(1);
  }
  return mem;
}


x86 assembly (clang, -O0):
<js_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <js_malloc+0x2e>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<js_malloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <js_malloc+0xd>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @js_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @js_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ I2C_Put(int, int /*<<< orphan*/, unsigned char);
void radio_set_pa_volume(unsigned char val) {
  unsigned int tmp;
  tmp = val * 255 / 100;
  I2C_Put(0x5A, 0, (unsigned char)tmp);
  I2C_Put(0x58, 0, (unsigned char)tmp);
}


x86 assembly (clang, -O0):
<radio_set_pa_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0xff,%eax,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5a,%edi
xor    %esi,%esi
movzbl %al,%edx
call   1030 <I2C_Put@plt>
mov    -0x8(%rbp),%eax
mov    $0x58,%edi
xor    %esi,%esi
movzbl %al,%edx
call   1030 <I2C_Put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radio_set_pa_volume>:
push   %rbx
mov    %edi,%eax
shl    $0x8,%eax
sub    %edi,%eax
shr    $0x2,%eax
imul   $0x147b,%eax,%eax
shr    $0x11,%eax
movzbl %al,%ebx
mov    $0x5a,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <I2C_Put@plt>
mov    $0x58,%edi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <I2C_Put@plt>

LLVM IR (-O0):
define void @radio_set_pa_volume(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = mul nsw i32 %5, 255
%7 = sdiv i32 %6, 100
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
%10 = call i32 @I2C_Put(i32 90, i32 0, i8 zeroext %9)
%11 = load i32, i32* %3
%12 = trunc i32 %11 to i8
%13 = call i32 @I2C_Put(i32 88, i32 0, i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @radio_set_pa_volume(i8 zeroext %0) {
%2 = zext i8 %0 to i16
%3 = mul nuw i16 %2, 255
%4 = udiv i16 %3, 100
%5 = trunc i16 %4 to i8
%6 = tail call i32 @I2C_Put(i32 90, i32 0, i8 zeroext %5)
%7 = tail call i32 @I2C_Put(i32 88, i32 0, i8 zeroext %5)
ret void
}
SP_CASE(imacro, imetamacro_stringify) { "abc"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @SP_CASE(i32 %0, i32 %1) {
ret i32 undef
}
void INT_Excep_PERIB_INTB167(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB167() {
ret void
}
hoc_menu_cleanup() {}


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

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

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

LLVM IR (-O2):
define i32 @hoc_menu_cleanup() {
ret i32 undef
}
int max(int a, int b) { return ((a > b) * a) + ((a <= b) * b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
imul   -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
%14 = zext i1 %13 to i32
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = add nsw i32 %10, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned char bcd_to_dec(unsigned char bcd) {
  return ((((bcd & 0xf0) >> 4) * 10) + (bcd & 0x0f));
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @bcd_to_dec(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = mul nuw i8 %2, 10
%4 = and i8 %0, 15
%5 = add nuw i8 %3, %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ expr0();
int rvalue(int /*<<< orphan*/);
int expr() { return (rvalue(expr0())); }


x86 assembly (clang, -O0):
<expr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <expr0@plt>
mov    %eax,%edi
call   1030 <rvalue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr>:
push   %rax
xor    %eax,%eax
call   1040 <expr0@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <rvalue@plt>

LLVM IR (-O0):
define i32 @expr() {
%1 = call i32 (...) @expr0()
%2 = call i32 @rvalue(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @expr() {
%1 = tail call i32 (...) @expr0()
%2 = tail call i32 @rvalue(i32 %1)
ret i32 %2
}
/* Variables and functions */
int array();
int j;
main() {
  static j = 2;
  unsigned i = 5;
  int k = 3;
  int l, m, n;
  (int)k;
  (int *)&k;
  return array();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    $0x0,%al
call   1030 <array@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.j = internal global i32 2
@j = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 3, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (...) @array()
ret i32 %8
}

LLVM IR (-O2):
@j = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @array()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ do_return(int /*<<< orphan*/);
int /*<<< orphan*/ pop_stack();
void zret_popped(void) { do_return(pop_stack()); }


x86 assembly (clang, -O0):
<zret_popped>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pop_stack@plt>
mov    %eax,%edi
call   1030 <do_return@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zret_popped>:
push   %rax
xor    %eax,%eax
call   1040 <pop_stack@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <do_return@plt>

LLVM IR (-O0):
define void @zret_popped() {
%1 = call i32 (...) @pop_stack()
%2 = call i32 @do_return(i32 %1)
ret void
}

LLVM IR (-O2):
define void @zret_popped() {
%1 = tail call i32 (...) @pop_stack()
%2 = tail call i32 @do_return(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(const void *x) {
  if (x)
    free((void *)x);
}


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

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

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int rev(int xi, int y, int z) {
  unsigned x = xi;
  x = (x & 0x55555555) << 1 | ((x >> 1) & 0x55555555);
  x = (x & 0x33333333) << 2 | ((x >> 2) & 0x33333333);
  x = (x & 0x0F0F0F0F) << 4 | ((x >> 4) & 0x0F0F0F0F);
  x = (x << 24) | ((x & 0xFF00) << 8) | ((x >> 8) & 0xFF00) | (x >> 24);
  return x;
}


x86 assembly (clang, -O0):
<rev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x55555555,%eax
shl    $0x1,%eax
mov    -0x10(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x33333333,%eax
shl    $0x2,%eax
mov    -0x10(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
mov    -0x10(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

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

LLVM IR (-O2):
define i32 @rev(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ TCPecho(char *, int);
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  char *destination;
  int portN;
  if (argc == 3) {
    destination = argv[1];
    portN = atoi(argv[2]);
  } else
    usage(argv[0]);
  TCPecho(destination, portN);
  exit(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)
cmpl   $0x3,-0x8(%rbp)
jne    1181 <main+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    118d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <TCPecho@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jne    1164 <main+0x24>
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rdi
call   1050 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <TCPecho@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    (%rsi),%rdi
call   1040 <usage@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @TCPecho(i8* %6, i32 %9)
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 @usage(i8* %13)
unreachable
}
/* Variables and functions */
void *heap_alloc_page_frames(int);
void *liballoc_alloc(int pages) { return heap_alloc_page_frames(pages); }


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

x86 assembly (clang, -O2):
<liballoc_alloc>:
jmp    1030 <heap_alloc_page_frames@plt>

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

LLVM IR (-O2):
define i8* @liballoc_alloc(i32 %0) {
%2 = tail call i8* @heap_alloc_page_frames(i32 %0)
ret i8* %2
}
/* Variables and functions */
unsigned long *reg_map(unsigned long);
unsigned long VpuReadReg(unsigned long addr) {
  unsigned long *reg_addr = reg_map(addr);
  return *(volatile unsigned long *)reg_addr;
}


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

x86 assembly (clang, -O2):
<VpuReadReg>:
push   %rax
call   1030 <reg_map@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @VpuReadReg(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64* @reg_map(i64 %4)
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @VpuReadReg(i64 %0) {
%2 = tail call i64* @reg_map(i64 %0)
%3 = load volatile i64, i64* %2
ret i64 %3
}
unsigned rightmost_one(unsigned x) { return x & ~(x - 1); }


x86 assembly (clang, -O0):
<rightmost_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightmost_one>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rightmost_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rightmost_one(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
ret i32 %3
}
/* Type definitions */
struct glide64_file {
  int dummy;
};

/* Variables and functions */
int EPERM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int normalize_image_p8(struct glide64_file *file __attribute__((unused))) {
  fprintf(stderr, "Unsupported format GR_TEXFMT_P_8\n");
  return -EPERM;
}


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

x86 assembly (clang, -O2):
<normalize_image_p8>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea3(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.glide64_file = type { i32 }
@stderr = global i32 0
@.str = [34 x i8] c"Unsupported format GR_TEXFMT_P_8\0A\00"
@EPERM = global i32 0
define i32 @normalize_image_p8(%struct.glide64_file* %0) {
%2 = alloca %struct.glide64_file*
store %struct.glide64_file* %0, %struct.glide64_file** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EPERM
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.glide64_file = type { i32 }
@stderr = global i32 0
@.str = [34 x i8] c"Unsupported format GR_TEXFMT_P_8\0A\00"
@EPERM = global i32 0
define i32 @normalize_image_p8(%struct.glide64_file* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EPERM
%5 = sub nsw i32 0, %4
ret i32 %5
}
float sqrtf(float x) { return 0; }


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ SYS_pkey_free;
int syscall(int /*<<< orphan*/, unsigned long);
int pkey_free(unsigned long pkey) { return syscall(SYS_pkey_free, pkey); }


x86 assembly (clang, -O0):
<pkey_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkey_free>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_pkey_free = global i32 0
define i32 @pkey_free(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @SYS_pkey_free
%4 = load i64, i64* %2
%5 = call i32 @syscall(i32 %3, i64 %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_pkey_free = global i32 0
define i32 @pkey_free(i64 %0) {
%2 = load i32, i32* @SYS_pkey_free
%3 = tail call i32 @syscall(i32 %2, i64 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getPass(char *);
int /*<<< orphan*/ processPass(char *);
int main() {
  char pass[100];
  getPass(pass);
  processPass(pass);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <getPass@plt>
mov    %rbx,%rdi
call   1040 <processPass@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @getPass(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @processPass(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @getPass(i8* %2)
%4 = call i32 @processPass(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ brsh_teardown();
int /*<<< orphan*/ exit(int);
void brsh_shutdown(int in_exit_status) {
  brsh_teardown();
  exit(in_exit_status);
}


x86 assembly (clang, -O0):
<brsh_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <brsh_teardown@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<brsh_shutdown>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <brsh_teardown@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @brsh_shutdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @brsh_teardown()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @brsh_shutdown(i32 %0) {
%2 = tail call i32 (...) @brsh_teardown()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
double premier(double a, double b) {
  if (a == 0) {
    puts("Erreur");
  } else {
    return (-b / a);
  }
}


x86 assembly (clang, -O0):
<premier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114b <premier+0x3b>
jp     114b <premier+0x3b>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
jmp    1171 <premier+0x61>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<premier>:
push   %rax
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    112b <premier+0x1b>
jp     112b <premier+0x1b>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
jmp    1137 <premier+0x27>
xorpd  0xecd(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Erreur\00"
define double @premier(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %15
10: ; preds = %2
%11 = load double, double* %5
%12 = fneg double %11
%13 = load double, double* %4
%14 = fdiv double %12, %13
store double %14, double* %3
br label %15
15: ; preds = %10, %8
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"Erreur\00"
define double @premier(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = fneg double %1
%8 = fdiv double %7, %0
br label %9
9: ; preds = %6, %4
%10 = phi double [ undef, %4 ], [ %8, %6 ]
ret double %10
}
/* Type definitions */
struct AST_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void AST_tree_error(struct AST_tree *self, char *msg) {
  printf("runtime error : \"%s\"\n", msg);
  return;
}


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

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

LLVM IR (-O0):
%struct.AST_tree = type { i32 }
@.str = [22 x i8] c"runtime error : \22%s\22\0A\00"
define void @AST_tree_error(%struct.AST_tree* %0, i8* %1) {
%3 = alloca %struct.AST_tree*
%4 = alloca i8*
store %struct.AST_tree* %0, %struct.AST_tree** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
%struct.AST_tree = type { i32 }
@.str = [22 x i8] c"runtime error : \22%s\22\0A\00"
define void @AST_tree_error(%struct.AST_tree* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ go_func();
void c_call_go(int n) {
  int i;
  for (i = 0; i < n; i++) {
    go_func();
  }
}


x86 assembly (clang, -O0):
<c_call_go>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <c_call_go+0x33>
mov    $0x0,%al
call   1030 <go_func@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <c_call_go+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_call_go>:
push   %rbx
test   %edi,%edi
jle    112c <c_call_go+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <go_func@plt>
add    $0xffffffff,%ebx
jne    1120 <c_call_go+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @c_call_go(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @go_func()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a = __VERIFIER_nondet_int();
  int b = __VERIFIER_nondet_int();
  if (a == b) {
    return 0;
  } else {
  ERROR:
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    114b <main+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1157 <main+0x47>
jmp    1150 <main+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp ne i32 %1, %2
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ XSelectionRequestEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XSelectionRequestEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XSelectionRequestEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XSelectionRequestEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XSelectionRequestEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XSelectionRequestEvent>:
test   %rdi,%rdi
je     112a <free_XSelectionRequestEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XSelectionRequestEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XSelectionRequestEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ pthread_self();
void *main_thread(void *arg) {
  int argument;
  argument = *((int *)arg);
  printf("tid, getpid(), pthread_self() = "
         "%d, %ju, %ju\n",
         argument, (uintmax_t)getpid(), (uintmax_t)pthread_self());
  return NULL;
}


x86 assembly (clang, -O0):
<main_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_thread>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb3(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"tid, getpid(), pthread_self() = %d, %ju, %ju\0A\00"
define i8* @main_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i64 (...) @getpid()
%9 = trunc i64 %8 to i32
%10 = call i64 (...) @pthread_self()
%11 = trunc i64 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11)
ret i8* null
}

LLVM IR (-O2):
@.str = [46 x i8] c"tid, getpid(), pthread_self() = %d, %ju, %ju\0A\00"
define noalias i8* @main_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i64 (...) @getpid()
%5 = trunc i64 %4 to i32
%6 = tail call i64 (...) @pthread_self()
%7 = trunc i64 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ShareCalculation();
int /*<<< orphan*/ lr_save_string(char *, char *);
Action() {
  lr_save_string("1380", "FundAmount");
  lr_save_string("484", "OptionPriceInt");
  lr_save_string("05253284", "OptionPriceDec");
  ShareCalculation();
  return 0;
}


x86 assembly (clang, -O0):
<Action>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1040 <lr_save_string@plt>
lea    0xed2(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1040 <lr_save_string@plt>
lea    0xed2(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <lr_save_string@plt>
mov    $0x0,%al
call   1030 <ShareCalculation@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Action>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <lr_save_string@plt>
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <lr_save_string@plt>
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1040 <lr_save_string@plt>
xor    %eax,%eax
call   1030 <ShareCalculation@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"1380\00"
@.str.1 = [11 x i8] c"FundAmount\00"
@.str.2 = [4 x i8] c"484\00"
@.str.3 = [15 x i8] c"OptionPriceInt\00"
@.str.4 = [9 x i8] c"05253284\00"
@.str.5 = [15 x i8] c"OptionPriceDec\00"
define i32 @Action() {
%1 = call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @lr_save_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%4 = call i32 (...) @ShareCalculation()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"1380\00"
@.str.1 = [11 x i8] c"FundAmount\00"
@.str.2 = [4 x i8] c"484\00"
@.str.3 = [15 x i8] c"OptionPriceInt\00"
@.str.4 = [9 x i8] c"05253284\00"
@.str.5 = [15 x i8] c"OptionPriceDec\00"
define i32 @Action() {
%1 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 (...) @ShareCalculation()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void sys_error(const char *s) { perror(s); }


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

x86 assembly (clang, -O2):
<sys_error>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @sys_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int notifysendPresent(void) {
  static int lNotifysendPresent = -1;
  if (lNotifysendPresent < 0) {
    lNotifysendPresent = detectPresence("notify-send");
  }
  return lNotifysendPresent && graphicMode();
}


x86 assembly (clang, -O0):
<notifysendPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <notifysendPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <notifysendPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notifysendPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <notifysendPresent+0x23>
test   %eax,%eax
je     1159 <notifysendPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <notifysendPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@notifysendPresent.lNotifysendPresent = internal global i32 -1
@.str = [12 x i8] c"notify-send\00"
define i32 @notifysendPresent() {
%1 = load i32, i32* @notifysendPresent.lNotifysendPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @notifysendPresent.lNotifysendPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @notifysendPresent.lNotifysendPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@notifysendPresent.lNotifysendPresent = internal unnamed_addr global i32 -1
@.str = [12 x i8] c"notify-send\00"
define i32 @notifysendPresent() {
%1 = load i32, i32* @notifysendPresent.lNotifysendPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @notifysendPresent.lNotifysendPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ llib_file_access(char const *, int);
__attribute__((unused)) int access(const char *path, int mode) {
  return llib_file_access(path, mode) ? 0 : -1;
}


x86 assembly (clang, -O0):
<access>:
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 <llib_file_access@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access>:
push   %rax
call   1030 <llib_file_access@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @access(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 i64 @llib_file_access(i8* %5, i32 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @access(i8* %0, i32 %1) {
%3 = tail call i64 @llib_file_access(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ recvbuf;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int read(int, char *, int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ write(int, char *, int);
void receive_message(int conn) {
  char recvbuf[1024];
  while (1) {
    memset(recvbuf, 0, sizeof(recvbuf));
    int ret = read(conn, recvbuf, sizeof(recvbuf));
    fputs(recvbuf, stdout);
    write(conn, recvbuf, ret);
  }
}


x86 assembly (clang, -O0):
<receive_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1060 <read@plt>
mov    %eax,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2e57(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
call   1030 <write@plt>
jmp    114e <receive_message+0xe>

x86 assembly (clang, -O2):
<receive_message>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edi,%r14d
mov    %rsp,%rbx
mov    0x2e86(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1060 <read@plt>
mov    %eax,%ebp
mov    (%r15),%esi
mov    %rbx,%rdi
call   1040 <fputs@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
jmp    1160 <receive_message+0x20>

LLVM IR (-O0):
@stdout = global i32 0
define void @receive_message(i32 %0) {
%2 = alloca i32
%3 = alloca [1024 x i8]
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %1, %5
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 1024)
%8 = load i32, i32* %2
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 1024)
store i32 %10, i32* %4
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = load i32, i32* @stdout
%13 = call i32 @fputs(i8* %11, i32 %12)
%14 = load i32, i32* %2
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%16 = load i32, i32* %4
%17 = call i32 @write(i32 %14, i8* %15, i32 %16)
br label %5
}

LLVM IR (-O2):
@stdout = global i32 0
define void @receive_message(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i32 @memset(i8* %3, i32 0, i32 1024)
%6 = call i32 @read(i32 %0, i8* %3, i32 1024)
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* %3, i32 %7)
%9 = call i32 @write(i32 %0, i8* %3, i32 %6)
br label %4
}
void *test2() { return __builtin_frame_address(0); }


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

x86 assembly (clang, -O2):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %rbp,%rax
pop    %rbp
ret

LLVM IR (-O0):
define i8* @test2() {
%1 = call i8* @llvm.frameaddress.p0i8(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @test2() {
%1 = tail call i8* @llvm.frameaddress.p0i8(i32 0)
ret i8* %1
}