xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ matmul(char *, int, int, int, double, double *,
                          double const *, double, double *);
int /*<<< orphan*/ xyz2enu(double const *, double *);
extern void enu2ecef(const double *pos, const double *e, double *r) {
  double E[9];
  xyz2enu(pos, E);
  matmul("TN", 3, 1, 3, 1.0, E, e, 0.0, r);
}


x86 assembly (clang, -O0):
<enu2ecef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <xyz2enu@plt>
lea    -0x60(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
lea    0xeb4(%rip),%rdi
mov    $0x3,%ecx
mov    $0x1,%edx
movsd  0xe9a(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    %ecx,%esi
mov    %rax,(%rsp)
call   1040 <matmul@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enu2ecef>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
lea    0x10(%rsp),%r15
mov    %r15,%rsi
call   1030 <xyz2enu@plt>
mov    %rbx,(%rsp)
lea    0xec1(%rip),%rdi
movsd  0xeb1(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <matmul@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"TN\00"
define void @enu2ecef(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [9 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%10 = call i32 @xyz2enu(double* %8, double* %9)
%11 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%12 = load double*, double** %5
%13 = load double*, double** %6
%14 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3, i32 1, i32 3, double 1.000000e+00, double* %11, double* %12, double 0.000000e+00, double* %13)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"TN\00"
define void @enu2ecef(double* %0, double* %1, double* %2) {
%4 = alloca [9 x double]
%5 = bitcast [9 x double]* %4 to i8*
%6 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%7 = call i32 @xyz2enu(double* %0, double* %6)
%8 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3, i32 1, i32 3, double 1.000000e+00, double* %6, double* %1, double 0.000000e+00, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushbooleanarray(char *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 4));
}


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

x86 assembly (clang, -O2):
<pushbooleanarray>:
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushbooleanarray(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 = mul nsw i32 %6, 4
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushbooleanarray(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int *a, *b, *c, *d;
  int p, q, r;
  a = &p;
  c = &r;
  d = b;
  b = &q;
  d = a;
  printf("%d %d", *b, *d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x24(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    -0x2c(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef)
ret i32 0
}
void __DELETE_java_util_StringTokenizer(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_util_StringTokenizer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_util_StringTokenizer(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int sum(int x, int y) {
  int t = x + y;
  return t;
}


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

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int test_imm_5Aint8_reg(signed char val) {
  return ((val) & (0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Aint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x5a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Aint8_reg>:
test   $0x5a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Aint8_reg(i8 signext %0) {
%2 = and i8 %0, 90
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, unsigned int *,
               int);
void set_rcvbuf(int fd, unsigned int size) {
  int err;
  err = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
  if (err) {
    perror("set SO_RCVBUF");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<set_rcvbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1185 <set_rcvbuf+0x55>
lea    0xe8a(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_rcvbuf>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %eax,%eax
jne    115d <set_rcvbuf+0x2d>
pop    %rax
ret
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
@.str = [14 x i8] c"set SO_RCVBUF\00"
define void @set_rcvbuf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_RCVBUF
%9 = call i32 @setsockopt(i32 %6, i32 %7, i32 %8, i32* %4, i32 4)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
@.str = [14 x i8] c"set SO_RCVBUF\00"
define void @set_rcvbuf(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_RCVBUF
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %3, i32 4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminal_clear_screen();
void terminal_action_clear_screen(int c, void (*process_line)(char *line)) {
  terminal_clear_screen();
}


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

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

LLVM IR (-O0):
define void @terminal_action_clear_screen(i32 %0, void (i8*)* %1) {
%3 = alloca i32
%4 = alloca void (i8*)*
store i32 %0, i32* %3
store void (i8*)* %1, void (i8*)** %4
%5 = call i32 (...) @terminal_clear_screen()
ret void
}

LLVM IR (-O2):
define void @terminal_action_clear_screen(i32 %0, void (i8*)* nocapture readnone %1) {
%3 = tail call i32 (...) @terminal_clear_screen()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glVertex3fv(int /*<<< orphan*/ *);
void Vertex3fv(GLfloat v[3]) { glVertex3fv(v); }


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

x86 assembly (clang, -O2):
<Vertex3fv>:
jmp    1030 <glVertex3fv@plt>

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

LLVM IR (-O2):
define void @Vertex3fv(i32* %0) {
%2 = tail call i32 @glVertex3fv(i32* %0)
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
void *zcalloc(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<zcalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @zcalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
int get_max_bit(int x) {
  int max_bit = -1;
  while (x) {
    x = x >> 1;
    max_bit++;
  }
  return max_bit;
}


x86 assembly (clang, -O0):
<get_max_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <get_max_bit+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <get_max_bit+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_bit>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111c <get_max_bit+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <get_max_bit+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_max_bit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void exit(int code) { _exit(code); }


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

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
int sl_select_fuse(int fd, int msec) { return 1; }


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

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

LLVM IR (-O0):
define i32 @sl_select_fuse(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @sl_select_fuse(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Jack\nDaniels\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [14 x i8] c"Jack\0ADaniels\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Jack\0ADaniels\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ScaleARGBColsUp2_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBColsUp2_SSE2() {
ret void
}
int lw6sys_false() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lw6sys_false() {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_wall_time_in_usec() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec) * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_wall_time_in_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wall_time_in_usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, double }
define double @get_wall_time_in_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, double }
define double @get_wall_time_in_usec() {
%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 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fadd double %9, %7
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sem_unlink(char *);
int /*<<< orphan*/ shm_unlink(char *);
void handler(int signal) {
  sem_unlink("/thesemaphore");
  shm_unlink("/theshm");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xec0(%rip),%rdi
call   1040 <shm_unlink@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xeca(%rip),%rdi
call   1040 <shm_unlink@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"/thesemaphore\00"
@.str.1 = [8 x i8] c"/theshm\00"
@EXIT_SUCCESS = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sem_unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @shm_unlink(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"/thesemaphore\00"
@.str.1 = [8 x i8] c"/theshm\00"
@EXIT_SUCCESS = global i32 0
define void @handler(i32 %0) {
%2 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgincglob(char *i, char *s, int v) {
  ngen("%s\tcx,%d", "mov", v);
  sgen("%s\t%s,cx", i, s);
}


x86 assembly (clang, -O0):
<cgincglob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edx
lea    0xec3(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1030 <ngen@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rdi
call   1040 <sgen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincglob>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <ngen@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sgen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s\09cx,%d\00"
@.str.1 = [4 x i8] c"mov\00"
@.str.2 = [9 x i8] c"%s\09%s,cx\00"
define void @cgincglob(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @sgen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s\09cx,%d\00"
@.str.1 = [4 x i8] c"mov\00"
@.str.2 = [9 x i8] c"%s\09%s,cx\00"
define void @cgincglob(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%5 = tail call i32 @sgen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR6E_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMR6E_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork(char *);
int /*<<< orphan*/ leak();
int main(int argc, char *argv[]) {
  while (1) {
    leak();
    fork(argv[0]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <leak@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <fork@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <leak@plt>
mov    (%rbx),%rdi
call   1040 <fork@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @leak()
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @fork(i8* %10)
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @leak()
%5 = load i8*, i8** %1
%6 = tail call i32 @fork(i8* %5)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(int argc, char *argv[]) { exit(1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ffi_free_(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<ffi_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):
<ffi_free_>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ffi_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 @ffi_free_(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void setleu16(uint8_t *bu, uint32_t value, int offset) {
  bu[offset + 0] = value;
  bu[offset + 1] = value >> 8;
}


x86 assembly (clang, -O0):
<setleu16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%edx
sar    $0x8,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setleu16>:
movslq %edx,%rax
mov    %esi,(%rdi,%rax,4)
sar    $0x8,%esi
mov    %esi,0x4(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @setleu16(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
%7 = load i32, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 0
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
store i32 %7, i32* %12
%13 = load i32, i32* %5
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %15, i64 %18
store i32 %14, i32* %19
ret void
}

LLVM IR (-O2):
define void @setleu16(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %1, i32* %5
%6 = ashr i32 %1, 8
%7 = add nsw i32 %2, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %6, i32* %9
ret void
}
/* Variables and functions */
double pow(double, double);
double func(double u, double exponent) { return pow(u, exponent); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @func(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @func(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutInit(int *, char **);
void glutInit(int *argcp, char **argv) { fn_glutInit(argcp, argv); }


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

x86 assembly (clang, -O2):
<glutInit>:
jmp    1030 <fn_glutInit@plt>

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

LLVM IR (-O2):
define void @glutInit(i32* %0, i8** %1) {
%3 = tail call i32 @fn_glutInit(i32* %0, i8** %1)
ret void
}
void av_dict_copy() {}


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

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

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

LLVM IR (-O2):
define void @av_dict_copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_clrdtr();
int /*<<< orphan*/ waitms(int);
void clrdtr(void) {
  waitms(50);
  serial_clrdtr();
  waitms(50);
}


x86 assembly (clang, -O0):
<clrdtr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1030 <waitms@plt>
mov    $0x0,%al
call   1040 <serial_clrdtr@plt>
mov    $0x32,%edi
call   1030 <waitms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrdtr>:
push   %rax
mov    $0x32,%edi
call   1030 <waitms@plt>
xor    %eax,%eax
call   1040 <serial_clrdtr@plt>
mov    $0x32,%edi
pop    %rax
jmp    1030 <waitms@plt>

LLVM IR (-O0):
define void @clrdtr() {
%1 = call i32 @waitms(i32 50)
%2 = call i32 (...) @serial_clrdtr()
%3 = call i32 @waitms(i32 50)
ret void
}

LLVM IR (-O2):
define void @clrdtr() {
%1 = tail call i32 @waitms(i32 50)
%2 = tail call i32 (...) @serial_clrdtr()
%3 = tail call i32 @waitms(i32 50)
ret void
}
void XAllocColor() {}


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

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

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

LLVM IR (-O2):
define void @XAllocColor() {
ret void
}
int appf_platform_runtime_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @appf_platform_runtime_init() {
ret i32 0
}
void av_audio_fifo_size() {}


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

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

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

LLVM IR (-O2):
define void @av_audio_fifo_size() {
ret void
}
/* Variables and functions */
int i2c_smbus_read_byte(int);
int bananapiI2CRead(int fd) { return i2c_smbus_read_byte(fd); }


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

x86 assembly (clang, -O2):
<bananapiI2CRead>:
jmp    1030 <i2c_smbus_read_byte@plt>

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

LLVM IR (-O2):
define i32 @bananapiI2CRead(i32 %0) {
%2 = tail call i32 @i2c_smbus_read_byte(i32 %0)
ret i32 %2
}
/* Type definitions */
struct lastlog {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int ll_count() {
  FILE *fp = fopen("/var/log/lastlog", "rb");
  fseek(fp, 0, SEEK_END);
  signed int size = ftell(fp) / sizeof(struct lastlog);
  fclose(fp);
  return size;
}


x86 assembly (clang, -O0):
<ll_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
cltq
shr    $0x2,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"/var/log/lastlog\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @ll_count() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %1
%8 = call i32 @ftell(i32* %7)
%9 = sext i32 %8 to i64
%10 = udiv i64 %9, 4
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
%12 = load i32*, i32** %1
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"/var/log/lastlog\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @ll_count() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %1, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %1)
%5 = ashr i32 %4, 2
%6 = tail call i32 @fclose(i32* %1)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct sha3_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cryptonite_sha3_update(struct sha3_ctx *,
                                          int /*<<< orphan*/ *,
                                          int /*<<< orphan*/);
void cryptonite_keccak_update(struct sha3_ctx *ctx, uint8_t *data,
                              uint32_t len) {
  cryptonite_sha3_update(ctx, data, len);
}


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

x86 assembly (clang, -O2):
<cryptonite_keccak_update>:
jmp    1030 <cryptonite_sha3_update@plt>

LLVM IR (-O0):
%struct.sha3_ctx = type { i32 }
define void @cryptonite_keccak_update(%struct.sha3_ctx* %0, i32* %1, i32 %2) {
%4 = alloca %struct.sha3_ctx*
%5 = alloca i32*
%6 = alloca i32
store %struct.sha3_ctx* %0, %struct.sha3_ctx** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load %struct.sha3_ctx*, %struct.sha3_ctx** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @cryptonite_sha3_update(%struct.sha3_ctx* %7, i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.sha3_ctx = type { i32 }
define void @cryptonite_keccak_update(%struct.sha3_ctx* %0, i32* %1, i32 %2) {
%4 = tail call i32 @cryptonite_sha3_update(%struct.sha3_ctx* %0, i32* %1, i32 %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ state;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned get_XEvent_xbutton_state(void *_p) {
  return (unsigned)((XEvent *)_p)->xbutton.state;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define i32 @get_XEvent_xbutton_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEvent_xbutton_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
long int lr(double x) { return __builtin_lround(x); }


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

x86 assembly (clang, -O2):
<lr>:
jmp    1030 <lround@plt>

LLVM IR (-O0):
define i64 @lr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @lround(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @lr(double %0) {
%2 = tail call i64 @lround(double %0)
ret i64 %2
}
/* Variables and functions */
unsigned int __raw_readl(unsigned int);
int /*<<< orphan*/ __raw_writel(unsigned int, unsigned int);
void __raw_bits_or(unsigned int v, unsigned int a) {
  __raw_writel((__raw_readl(a) | v), a);
}


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

x86 assembly (clang, -O2):
<__raw_bits_or>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <__raw_readl@plt>
or     %eax,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__raw_writel@plt>

LLVM IR (-O0):
define void @__raw_bits_or(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @__raw_readl(i32 %5)
%7 = load i32, i32* %3
%8 = or i32 %6, %7
%9 = load i32, i32* %4
%10 = call i32 @__raw_writel(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @__raw_bits_or(i32 %0, i32 %1) {
%3 = tail call i32 @__raw_readl(i32 %1)
%4 = or i32 %3, %0
%5 = tail call i32 @__raw_writel(i32 %4, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void put_int32(char *buff, int32_t ival) { *(int32_t *)buff = ival; }


x86 assembly (clang, -O0):
<put_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_int32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @put_int32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int GetEventFlag(int efnum) {
  int indx;
  int num;
  unsigned long tmp;
  indx = efnum % 32;
  num = efnum / 32;
  tmp = ({
    unsigned long __v = (*(volatile unsigned long *)((0x01800000 + (num * 4))));
    __v;
  });
  if (tmp & (1 << indx))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<GetEventFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
add    $0x1800000,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1173 <GetEventFlag+0x73>
movl   $0x1,-0x4(%rbp)
jmp    117a <GetEventFlag+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEventFlag>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x5,%eax
movslq %eax,%rdx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
xor    %eax,%eax
and    0x1800000(,%rdx,4),%rcx
01
setne  %al
ret

LLVM IR (-O0):
define i32 @GetEventFlag(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %3
%9 = load i32, i32* %3
%10 = srem i32 %9, 32
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 4
%15 = add nsw i32 25165824, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
store i64 %18, i64* %7
%19 = load i64, i64* %7
store i64 %19, i64* %8
%20 = load i64, i64* %8
store i64 %20, i64* %6
%21 = load i64, i64* %6
%22 = load i32, i32* %4
%23 = shl i32 1, %22
%24 = sext i32 %23 to i64
%25 = and i64 %21, %24
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %1
store i32 1, i32* %2
br label %29
28: ; preds = %1
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @GetEventFlag(i32 %0) {
%2 = sdiv i32 %0, 32
%3 = shl nsw i32 %2, 2
%4 = add nsw i32 %3, 25165824
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i32 %0, 31
%9 = shl nuw i32 1, %8
%10 = sext i32 %9 to i64
%11 = and i64 %7, %10
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
int /*<<< orphan*/ SSIBaseValid(unsigned long);
unsigned long SSIIntNumberGet(unsigned long);
void SSIIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  unsigned long ulInt;
  DEBUG_ASSERT(SSIBaseValid(ulBase));
  ulInt = SSIIntNumberGet(ulBase);
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<SSIIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <SSIBaseValid@plt>
mov    %eax,%edi
call   1060 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1040 <SSIIntNumberGet@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1070 <SSIBaseValid@plt>
mov    %eax,%edi
call   1060 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1040 <SSIIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <IntRegister@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @SSIIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
%5 = alloca i64
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%6 = load i64, i64* %3
%7 = call i32 @SSIBaseValid(i64 %6)
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %3
%10 = call i64 @SSIIntNumberGet(i64 %9)
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load void ()*, void ()** %4
%13 = bitcast void ()* %12 to void (...)*
%14 = call i32 @IntRegister(i64 %11, void (...)* %13)
%15 = load i64, i64* %5
%16 = call i32 @IntEnable(i64 %15)
ret void
}

LLVM IR (-O2):
define void @SSIIntRegister(i64 %0, void ()* %1) {
%3 = tail call i32 @SSIBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = tail call i64 @SSIIntNumberGet(i64 %0)
%6 = bitcast void ()* %1 to void (...)*
%7 = tail call i32 @IntRegister(i64 %5, void (...)* %6)
%8 = tail call i32 @IntEnable(i64 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int func2(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int func3(jmp_buf *env, int x) {
  if (x == 0)
    longjmp(*env, 3);
  return func2(env, x - 1) + 1;
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <func3+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x3,%esi
call   1040 <longjmp@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <func2@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3>:
push   %rax
test   %esi,%esi
je     1132 <func3+0x12>
add    $0xffffffff,%esi
call   1030 <func2@plt>
add    $0x1,%eax
pop    %rcx
ret
mov    (%rdi),%edi
mov    $0x3,%esi
call   1040 <longjmp@plt>

LLVM IR (-O0):
define i32 @func3(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @longjmp(i32 %9, i32 3)
unreachable
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = call i32 @func2(i32* %12, i32 %14)
%16 = add nsw i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @func3(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* %0
%6 = tail call i32 @longjmp(i32 %5, i32 3)
unreachable
7: ; preds = %2
%8 = add nsw i32 %1, -1
%9 = tail call i32 @func2(i32* %0, i32 %8)
%10 = add nsw i32 %9, 1
ret i32 %10
}
void putrest() {}


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

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

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

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