xunge/DecIR huggingface dataset:
int main(void) {
  int i = 7;
  int tamano, direc;
  tamano = sizeof(int);
  direc = &i;
  printf("i: %d\n", i);
  printf("tamano: %d\n", tamano);
  printf("direc: %d\n", direc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x7,0xc(%rsp)
lea    0xc(%rsp),%rbx
lea    0xed7(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"i: %d\0A\00"
@.str.1 = [12 x i8] c"tamano: %d\0A\00"
@.str.2 = [11 x i8] c"direc: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
store i32 4, i32* %3
%5 = ptrtoint i32* %2 to i32
store i32 %5, i32* %4
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"i: %d\0A\00"
@.str.1 = [12 x i8] c"tamano: %d\0A\00"
@.str.2 = [11 x i8] c"direc: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 7, i32* %1
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 7)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}
int iscommentchar(int c) { return ((c == '#') || (c == '%')); }


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

x86 assembly (clang, -O2):
<iscommentchar>:
add    $0xffffffdd,%edi
xor    %eax,%eax
test   $0xfffffffd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @iscommentchar(i32 %0) {
%2 = icmp eq i32 %0, 35
%3 = icmp eq i32 %0, 37
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ setenv(char *, char *, int);
int main(int argc, char *argv[], char *envp[]) {
  setenv("OLDPWD", getenv("PWD"), 1);
  setenv("PWD", argv[1], 1);
  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    0xec2(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeb0(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xed5(%rip),%r14
mov    %r14,%rdi
call   1030 <getenv@plt>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    0x8(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"OLDPWD\00"
@.str.1 = [4 x i8] c"PWD\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 i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @setenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8, i32 1)
%10 = load i8**, i8*** %6
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @setenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"OLDPWD\00"
@.str.1 = [4 x i8] c"PWD\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @setenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i32 1)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @setenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 1)
ret i32 0
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
struct bitmask *numa_bitmask_alloc(int);
int numa_max_possible_node_v2_int();
struct bitmask *numa_allocate_nodemask(void) {
  struct bitmask *bmp;
  int nnodes = numa_max_possible_node_v2_int() + 1;
  bmp = numa_bitmask_alloc(nnodes);
  return bmp;
}


x86 assembly (clang, -O0):
<numa_allocate_nodemask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <numa_max_possible_node_v2_int@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <numa_bitmask_alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numa_allocate_nodemask>:
push   %rax
xor    %eax,%eax
call   1030 <numa_max_possible_node_v2_int@plt>
lea    0x1(%rax),%edi
pop    %rax
jmp    1040 <numa_bitmask_alloc@plt>

LLVM IR (-O0):
%struct.bitmask = type { i32 }
define %struct.bitmask* @numa_allocate_nodemask() {
%1 = alloca %struct.bitmask*
%2 = alloca i32
%3 = call i32 (...) @numa_max_possible_node_v2_int()
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call %struct.bitmask* @numa_bitmask_alloc(i32 %5)
store %struct.bitmask* %6, %struct.bitmask** %1
%7 = load %struct.bitmask*, %struct.bitmask** %1
ret %struct.bitmask* %7
}

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define %struct.bitmask* @numa_allocate_nodemask() {
%1 = tail call i32 (...) @numa_max_possible_node_v2_int()
%2 = add nsw i32 %1, 1
%3 = tail call %struct.bitmask* @numa_bitmask_alloc(i32 %2)
ret %struct.bitmask* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool ts_validate(const uint8_t *p_ts) { return p_ts[0] == 0x47; }


x86 assembly (clang, -O0):
<ts_validate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x47,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_validate>:
xor    %eax,%eax
cmpl   $0x47,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @ts_validate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 71
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ts_validate(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 71
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int bcm2835_read(int);
int32_t pl011_uart_getc_noblock(void) {
  if (bcm2835_read((0 + 0x201000 + 0x18)) & (1 << 4)) {
    return -1;
  }
  return (bcm2835_read((0 + 0x201000 + 0x00))) & 0xff;
}


x86 assembly (clang, -O0):
<pl011_uart_getc_noblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x201018,%edi
call   1030 <bcm2835_read@plt>
and    $0x10,%eax
cmp    $0x0,%eax
je     113a <pl011_uart_getc_noblock+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <pl011_uart_getc_noblock+0x3c>
mov    $0x201000,%edi
call   1030 <bcm2835_read@plt>
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl011_uart_getc_noblock>:
push   %rax
mov    $0x201018,%edi
call   1030 <bcm2835_read@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   $0x10,%cl
jne    1134 <pl011_uart_getc_noblock+0x24>
mov    $0x201000,%edi
call   1030 <bcm2835_read@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pl011_uart_getc_noblock() {
%1 = alloca i32
%2 = call i32 @bcm2835_read(i32 2101272)
%3 = and i32 %2, 16
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %9
6: ; preds = %0
%7 = call i32 @bcm2835_read(i32 2101248)
%8 = and i32 %7, 255
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @pl011_uart_getc_noblock() {
%1 = tail call i32 @bcm2835_read(i32 2101272)
%2 = and i32 %1, 16
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @bcm2835_read(i32 2101248)
%6 = and i32 %5, 255
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ %6, %4 ], [ -1, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello  a world\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [16 x i8] c"hello a world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"hello a world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ disp_str(char *);
int /*<<< orphan*/ milli_delay(int);
void TestA() {
  int i = 0;
  while (1) {
    disp_str("A.");
    milli_delay(300);
  }
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0x12c,%edi
call   1040 <milli_delay@plt>
jmp    112f <TestA+0xf>

x86 assembly (clang, -O2):
<TestA>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <disp_str@plt>
mov    $0x12c,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestA+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 300)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @milli_delay(i32 300)
br label %1
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
struct termios *ft_get_termios(void) {
  static struct termios term;
  return (&term);
}


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
@ft_get_termios.term = internal global %struct.termios zeroinitializer
define %struct.termios* @ft_get_termios() {
ret %struct.termios* @ft_get_termios.term
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@ft_get_termios.term = internal global %struct.termios zeroinitializer
define %struct.termios* @ft_get_termios() {
ret %struct.termios* @ft_get_termios.term
}
/* Variables and functions */
int /*<<< orphan*/ motor(int, int);
void turdro() {
  motor(0, 70);
  motor(1, 0);
}


x86 assembly (clang, -O0):
<turdro>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x46,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <motor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<turdro>:
push   %rax
xor    %edi,%edi
mov    $0x46,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <motor@plt>

LLVM IR (-O0):
define void @turdro() {
%1 = call i32 @motor(i32 0, i32 70)
%2 = call i32 @motor(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @turdro() {
%1 = tail call i32 @motor(i32 0, i32 70)
%2 = tail call i32 @motor(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "webtest [-cht]... URL\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"webtest [-cht]... URL\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"webtest [-cht]... URL\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int camsys_gpio_get(unsigned char *io_name) {
  unsigned int gpio;
  unsigned int group;
  unsigned int group_pin;
  return gpio;
}


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

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

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

LLVM IR (-O2):
define i32 @camsys_gpio_get(i8* nocapture readnone %0) {
ret i32 undef
}
void multiError(char *buf) {
  buf[0] = 's';
  buf[2] = 's';
  buf[1] = 's';
}


x86 assembly (clang, -O0):
<multiError>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x73,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x73,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x73,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiError>:
movw   $0x7373,(%rdi)
movb   $0x73,0x2(%rdi)
ret

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

LLVM IR (-O2):
define void @multiError(i8* nocapture writeonly %0) {
store i8 115, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 2
store i8 115, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 115, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void prv_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<prv_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @prv_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  int a = 10;
  assert(a > 11);
  fprintf(stderr, "a is too small\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"a is too small\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 11
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"a is too small\0A\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sys_defs_free();
int /*<<< orphan*/ sys_defs_init();
int /*<<< orphan*/ testParseCstring();
int /*<<< orphan*/ testParseIf();
void testParse() {
  sys_defs_init();
  testParseIf();
  testParseCstring();
  sys_defs_free();
}


x86 assembly (clang, -O0):
<testParse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sys_defs_init@plt>
mov    $0x0,%al
call   1040 <testParseIf@plt>
mov    $0x0,%al
call   1060 <testParseCstring@plt>
mov    $0x0,%al
call   1030 <sys_defs_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testParse>:
push   %rax
xor    %eax,%eax
call   1050 <sys_defs_init@plt>
xor    %eax,%eax
call   1040 <testParseIf@plt>
xor    %eax,%eax
call   1060 <testParseCstring@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <sys_defs_free@plt>

LLVM IR (-O0):
define void @testParse() {
%1 = call i32 (...) @sys_defs_init()
%2 = call i32 (...) @testParseIf()
%3 = call i32 (...) @testParseCstring()
%4 = call i32 (...) @sys_defs_free()
ret void
}

LLVM IR (-O2):
define void @testParse() {
%1 = tail call i32 (...) @sys_defs_init()
%2 = tail call i32 (...) @testParseIf()
%3 = tail call i32 (...) @testParseCstring()
%4 = tail call i32 (...) @sys_defs_free()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float _div(float operando1, float operando2) {
  if (operando2 == 0) {
    printf("Impossivel dividir por 0.\n");
    exit(EXIT_FAILURE);
  }
  return operando1 / operando2;
}


x86 assembly (clang, -O0):
<_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1163 <_div+0x43>
jp     1163 <_div+0x43>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_div>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    112a <_div+0xa>
jnp    112f <_div+0xf>
divss  %xmm1,%xmm0
ret
push   %rax
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Impossivel dividir por 0.\0A\00"
@EXIT_FAILURE = global i32 0
define float @_div(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fcmp oeq float %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fdiv float %12, %13
ret float %14
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [26 x i8] c"Impossivel dividir por 0.\00"
define float @_div(float %0, float %1) {
%3 = fcmp oeq float %1, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
%9 = fdiv float %0, %1
ret float %9
}
int get_dot(char Dots[], int Hgt, int Wid, int x, int y) {
  int retval = 0;
  if ((x >= 0) && (x < Wid) && (y >= 0) && (y < Hgt)) {
    if (Dots[(y * Wid) + x] == '1') {
      retval = 1;
    }
  }
  return retval;
}


x86 assembly (clang, -O0):
<get_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1172 <get_dot+0x72>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1172 <get_dot+0x72>
cmpl   $0x0,-0x18(%rbp)
jl     1172 <get_dot+0x72>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1172 <get_dot+0x72>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    116d <get_dot+0x6d>
movl   $0x1,-0x1c(%rbp)
jmp    1172 <get_dot+0x72>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dot>:
xor    %eax,%eax
test   %ecx,%ecx
js     1127 <get_dot+0x27>
cmp    %esi,%r8d
jge    1127 <get_dot+0x27>
cmp    %edx,%ecx
jge    1127 <get_dot+0x27>
test   %r8d,%r8d
js     1127 <get_dot+0x27>
imul   %edx,%r8d
add    %ecx,%r8d
movslq %r8d,%rcx
xor    %eax,%eax
cmpb   $0x31,(%rdi,%rcx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @get_dot(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 0, i32* %11
%12 = load i32, i32* %9
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %39
14: ; preds = %5
%15 = load i32, i32* %9
%16 = load i32, i32* %8
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %39
18: ; preds = %14
%19 = load i32, i32* %10
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %39
21: ; preds = %18
%22 = load i32, i32* %10
%23 = load i32, i32* %7
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %39
25: ; preds = %21
%26 = load i8*, i8** %6
%27 = load i32, i32* %10
%28 = load i32, i32* %8
%29 = mul nsw i32 %27, %28
%30 = load i32, i32* %9
%31 = add nsw i32 %29, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %26, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 49
br i1 %36, label %37, label %38
37: ; preds = %25
store i32 1, i32* %11
br label %38
38: ; preds = %37, %25
br label %39
39: ; preds = %38, %21, %18, %14, %5
%40 = load i32, i32* %11
ret i32 %40
}

LLVM IR (-O2):
define i32 @get_dot(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %3, -1
br i1 %6, label %7, label %21
7: ; preds = %5
%8 = icmp slt i32 %3, %2
%9 = icmp sgt i32 %4, -1
%10 = and i1 %8, %9
%11 = icmp slt i32 %4, %1
%12 = and i1 %11, %10
br i1 %12, label %13, label %21
13: ; preds = %7
%14 = mul nsw i32 %4, %2
%15 = add nsw i32 %14, %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 49
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %13, %7, %5
%22 = phi i32 [ 0, %7 ], [ 0, %5 ], [ %20, %13 ]
ret i32 %22
}
__attribute__((used)) int _lseek(int file, int ptr, int dir) { return 0; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i32, i32)* @_lseek to i8*)], section "llvm.metadata"
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i32, i32)* @_lseek to i8*)], section "llvm.metadata"
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ROOT();
int /*<<< orphan*/ ROOTINIT();
int /*<<< orphan*/ init_rts(int, char **);
int /*<<< orphan*/ pruneStaticHeap();
int /*<<< orphan*/ sleep_rts();
int main(int argc, char **argv) {
  init_rts(argc, argv);
  ROOTINIT();
  pruneStaticHeap();
  ROOT();
  sleep_rts();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <init_rts@plt>
mov    $0x0,%al
call   1060 <ROOTINIT@plt>
mov    $0x0,%al
call   1070 <pruneStaticHeap@plt>
mov    $0x0,%al
call   1030 <ROOT@plt>
mov    $0x0,%al
call   1050 <sleep_rts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init_rts@plt>
xor    %eax,%eax
call   1060 <ROOTINIT@plt>
xor    %eax,%eax
call   1070 <pruneStaticHeap@plt>
xor    %eax,%eax
call   1030 <ROOT@plt>
xor    %eax,%eax
call   1050 <sleep_rts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @init_rts(i32 %5, i8** %6)
%8 = call i32 (...) @ROOTINIT()
%9 = call i32 (...) @pruneStaticHeap()
%10 = call i32 (...) @ROOT()
%11 = call i32 (...) @sleep_rts()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init_rts(i32 %0, i8** %1)
%4 = tail call i32 (...) @ROOTINIT()
%5 = tail call i32 (...) @pruneStaticHeap()
%6 = tail call i32 (...) @ROOT()
%7 = tail call i32 (...) @sleep_rts()
ret i32 0
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
unsigned int mput2l(unsigned int value, uint8_t *data) {
  data[0] = value & 0xff;
  data[1] = (value >> 8) & 0xff;
  return data[1];
}


x86 assembly (clang, -O0):
<mput2l>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mput2l>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define i32 @mput2l(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @mput2l(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
ret i32 %5
}
double scale_dh23(double x, double y, double z) { return 0.0; }


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

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

LLVM IR (-O0):
define double @scale_dh23(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @scale_dh23(double %0, double %1, double %2) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ fred();
int /*<<< orphan*/ henry();
int /*<<< orphan*/ joe();
int main() {
  fred();
  joe();
  henry();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fred()
%2 = tail call i32 (...) @joe()
%3 = tail call i32 (...) @henry()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ locksvc_1(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *host;
  if (argc < 2) {
    printf("usage: %s server_host\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  locksvc_1(host);
  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   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <locksvc_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114f <main+0x1f>
mov    (%rsi),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <locksvc_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = call i32 @locksvc_1(i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @locksvc_1(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}
void _ZTVN5javax8security4auth5login13ConfigurationE(void) {}


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

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

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

LLVM IR (-O2):
define void @_ZTVN5javax8security4auth5login13ConfigurationE() {
ret void
}
int LongSwap(int i) {
  unsigned char b1, b2, b3, b4;
  b1 = i & 255;
  b2 = (i >> 8) & 255;
  b3 = (i >> 16) & 255;
  b4 = (i >> 24) & 255;
  return ((int)b1 << 24) + ((int)b2 << 16) + ((int)b3 << 8) + b4;
}


x86 assembly (clang, -O0):
<LongSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x18,%eax
movzbl -0x6(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
movzbl -0x7(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzbl -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LongSwap>:
mov    %edi,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @LongSwap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int strncmp(char const *, char const *, int /*<<< orphan*/);
int strcmp(const char *s1, const char *s2) {
  return strncmp(s1, s2, strlen(s1));
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
void RTTimeDbgBad(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeDbgBad() {
ret void
}
/* Variables and functions */
int prctl(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
          int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return prctl(0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <prctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <prctl@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @prctl(i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ckd_free_2d(void **ptr) {
  {
    free(*(ptr + 0));
    free((void *)ptr);
    return;
  }
}


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

x86 assembly (clang, -O2):
<ckd_free_2d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ckd_free_2d(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
%4 = bitcast i8** %0 to i8*
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  printf("%d\n", rand() % 30);
  printf("%d", rand() % 1025);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x401,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x4,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rsi
imul   $0x7fe007ff,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x29,%rax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0xa,%ecx
add    %eax,%ecx
sub    %ecx,%esi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 30
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 1025
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 30
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 1025
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ rand_r(unsigned int *);
uint32_t generate_random() {
  struct timeval t;
  gettimeofday(&t, NULL);
  uint32_t r = rand_r((unsigned int *)&(t.tv_usec));
  return r;
}


x86 assembly (clang, -O0):
<generate_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
lea    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @generate_random() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = call i32 @rand_r(i32* %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @generate_random() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = call i32 @rand_r(i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ kmem_check_leak();
int /*<<< orphan*/ kmem_check_start();
int /*<<< orphan*/ kmem_check_stop();
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ test_echo_server();
int main() {
  mtrace();
  kmem_check_start();
  test_echo_server();
  getchar();
  kmem_check_leak();
  getchar();
  kmem_check_stop();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <mtrace@plt>
mov    $0x0,%al
call   1070 <kmem_check_start@plt>
mov    $0x0,%al
call   1050 <test_echo_server@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1030 <kmem_check_leak@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1040 <kmem_check_stop@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <mtrace@plt>
xor    %eax,%eax
call   1070 <kmem_check_start@plt>
xor    %eax,%eax
call   1050 <test_echo_server@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1030 <kmem_check_leak@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1040 <kmem_check_stop@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mtrace()
%3 = call i32 (...) @kmem_check_start()
%4 = call i32 (...) @test_echo_server()
%5 = call i32 (...) @getchar()
%6 = call i32 (...) @kmem_check_leak()
%7 = call i32 (...) @getchar()
%8 = call i32 (...) @kmem_check_stop()
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mtrace()
%2 = tail call i32 (...) @kmem_check_start()
%3 = tail call i32 (...) @test_echo_server()
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 (...) @kmem_check_leak()
%6 = tail call i32 (...) @getchar()
%7 = tail call i32 (...) @kmem_check_stop()
%8 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int EphemeralSecretAgreement_A_extended(unsigned char const *,
                                        unsigned char const *, unsigned char *,
                                        int /*<<< orphan*/);
int EphemeralSecretAgreement_A(const unsigned char *PrivateKeyA,
                               const unsigned char *PKB,
                               unsigned char *SharedSecretA) {
  return EphemeralSecretAgreement_A_extended(PrivateKeyA, PKB, SharedSecretA,
                                             0);
}


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

x86 assembly (clang, -O2):
<EphemeralSecretAgreement_A>:
xor    %ecx,%ecx
jmp    1030 <EphemeralSecretAgreement_A_extended@plt>

LLVM IR (-O0):
define i32 @EphemeralSecretAgreement_A(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
%10 = call i32 @EphemeralSecretAgreement_A_extended(i8* %7, i8* %8, i8* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @EphemeralSecretAgreement_A(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @EphemeralSecretAgreement_A_extended(i8* %0, i8* %1, i8* %2, i32 0)
ret i32 %4
}