xunge/DecIR huggingface dataset:
long strlen(char const *s) {
  char const *tmp;
  for (tmp = s; *s; s++)
    ;
  return (long)(s - tmp);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %5
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ free4(void ****);
void free4float(float ****p) { free4((void ****)p); }


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

x86 assembly (clang, -O2):
<free4float>:
jmp    1030 <free4@plt>

LLVM IR (-O0):
define void @free4float(float**** %0) {
%2 = alloca float****
store float**** %0, float***** %2
%3 = load float****, float***** %2
%4 = bitcast float**** %3 to i8****
%5 = call i32 @free4(i8**** %4)
ret void
}

LLVM IR (-O2):
define void @free4float(float**** %0) {
%2 = bitcast float**** %0 to i8****
%3 = tail call i32 @free4(i8**** %2)
ret void
}
void iwl_tm_gnl_add(struct iwl_trans *trans) {}


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

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

LLVM IR (-O0):
%struct.iwl_trans = type opaque
define void @iwl_tm_gnl_add(%struct.iwl_trans* %0) {
%2 = alloca %struct.iwl_trans*
store %struct.iwl_trans* %0, %struct.iwl_trans** %2
ret void
}

LLVM IR (-O2):
%struct.iwl_trans = type opaque
define void @iwl_tm_gnl_add(%struct.iwl_trans* nocapture %0) {
ret void
}
/* Variables and functions */
int isprint(const char c) { return ((c >= 32) && (c < 127)); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isprint+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
setl   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %8, 127
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isprint(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ev_break(struct ev_loop *, int);
void ev_unloop(struct ev_loop *loop, int how) { ev_break(loop, how); }


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

x86 assembly (clang, -O2):
<ev_unloop>:
jmp    1030 <ev_break@plt>

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define void @ev_unloop(%struct.ev_loop* %0, i32 %1) {
%3 = alloca %struct.ev_loop*
%4 = alloca i32
store %struct.ev_loop* %0, %struct.ev_loop** %3
store i32 %1, i32* %4
%5 = load %struct.ev_loop*, %struct.ev_loop** %3
%6 = load i32, i32* %4
%7 = call i32 @ev_break(%struct.ev_loop* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define void @ev_unloop(%struct.ev_loop* %0, i32 %1) {
%3 = tail call i32 @ev_break(%struct.ev_loop* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex8array(void *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 8));
}


x86 assembly (clang, -O0):
<popcomplex8array>:
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    $0x3,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcomplex8array>:
shl    $0x3,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popcomplex8array(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, 8
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popcomplex8array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
int test_imm_45uint16_mem(unsigned short *val) {
  return ((*val) & (0x45 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_45uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x45,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_45uint16_mem>:
testb  $0x45,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_45uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 69
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void f() {
  int x = 1;
  char big[2048];
  {
  mylabel:
    x++;
    if (x != 3)
      goto mylabel;
  }
  return;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x790,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     112a <f+0x2a>
jmp    1112 <f+0x12>
add    $0x790,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca [2048 x i8]
store i32 1, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input[1000] = {0};
  scanf("%s", input);
  reverse(input);
  printf("%s", input);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rbx
mov    $0x3e8,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe8d(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = bitcast [1000 x i8]* %2 to i8*
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverse(i8* %6)
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
void func2(void *x) {
  int **p;
  p = (int **)malloc(sizeof(int *));
  *p = (int *)malloc(sizeof(int));
  if (*p) {
    **p = 1;
    **p = 10;
  }
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1166 <func2+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0xa,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1136 <func2+0x26>
movl   $0xa,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @func2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32**
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to i32**
store i32** %5, i32*** %3
%6 = call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
%8 = load i32**, i32*** %3
store i32* %7, i32** %8
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32**, i32*** %3
%14 = load i32*, i32** %13
store i32 1, i32* %14
%15 = load i32**, i32*** %3
%16 = load i32*, i32** %15
store i32 10, i32* %16
br label %17
17: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @func2(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32**
%4 = tail call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = icmp eq i64 %4, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 10, i32* %5
br label %8
8: ; preds = %7, %1
ret void
}
void rop3_64_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_64_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_64_0_0>:
mov    (%rdi),%al
not    %al
and    %edx,%esi
and    %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_64_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_64_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %2, %1
%7 = and i8 %6, %5
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
char *getenv(char *);
scalar_t__ strstr(char *, char *);
int logtoterm() {
  char *s = getenv("FLONLOG");
  return s && strstr(s, "term");
}


x86 assembly (clang, -O0):
<logtoterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1162 <logtoterm+0x42>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logtoterm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     114e <logtoterm+0x2e>
lea    0xecf(%rip),%rsi
mov    %rax,%rdi
call   1040 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"FLONLOG\00"
@.str.1 = [5 x i8] c"term\00"
define i32 @logtoterm() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i64 @strstr(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %0
%10 = phi i1 [ false, %0 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"FLONLOG\00"
@.str.1 = [5 x i8] c"term\00"
define i32 @logtoterm() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @strstr(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
double dtor(double deg) { return (deg * 3.14159265358979323846 / 180); }


x86 assembly (clang, -O0):
<dtor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtor>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dtor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @dtor(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char const *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void _reopen_std_fds(const char *fin, const char *fout, const char *ferr) {
  freopen(fin, "r", stdin);
  freopen(fout, "w", stdout);
  freopen(ferr, "w", stderr);
}


x86 assembly (clang, -O0):
<_reopen_std_fds>:
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    0x2eb9(%rip),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rsi
call   1030 <freopen@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rsi
call   1030 <freopen@plt>
mov    -0x18(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
lea    0xe98(%rip),%rsi
call   1030 <freopen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_reopen_std_fds>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
lea    0xed5(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    0xec2(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <freopen@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
@stderr = global i32 0
define void @_reopen_std_fds(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 i32, i32* @stdin
%9 = call i32 @freopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* @stdout
%12 = call i32 @freopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %6
%14 = load i32, i32* @stderr
%15 = call i32 @freopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
@stderr = global i32 0
define void @_reopen_std_fds(i8* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stdin
%5 = tail call i32 @freopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @freopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @freopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}
void deinitvideo() {}


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

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

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

LLVM IR (-O2):
define void @deinitvideo() {
ret void
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bufferevent_free(struct bufferevent *);
void event_cb(struct bufferevent *bev, short events, void *user_data) {
  bufferevent_free(bev);
}


x86 assembly (clang, -O0):
<event_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bufferevent_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_cb>:
jmp    1030 <bufferevent_free@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
define void @event_cb(%struct.bufferevent* %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.bufferevent*
%5 = alloca i16
%6 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load %struct.bufferevent*, %struct.bufferevent** %4
%8 = call i32 @bufferevent_free(%struct.bufferevent* %7)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
define void @event_cb(%struct.bufferevent* %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @bufferevent_free(%struct.bufferevent* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t _generate_iw(uint64_t cw, uint8_t fcnt) {
  uint64_t iw;
  iw = ((fcnt ^ 0xFF) << 8) | fcnt;
  iw |= (iw << 16) | (iw << 32) | (iw << 48);
  return ((iw ^ cw) & (((uint64_t)1 << 60) - 1));
}


x86 assembly (clang, -O0):
<_generate_iw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xff,%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    -0xc(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x4(%rbp),%eax
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_generate_iw(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* %4
%7 = xor i32 %6, 255
%8 = shl i32 %7, 8
%9 = load i32, i32* %4
%10 = or i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = shl i32 %11, 16
%13 = load i32, i32* %5
%14 = shl i32 %13, 32
%15 = or i32 %12, %14
%16 = load i32, i32* %5
%17 = shl i32 %16, 48
%18 = or i32 %15, %17
%19 = load i32, i32* %5
%20 = or i32 %19, %18
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = load i32, i32* %3
%23 = xor i32 %21, %22
%24 = and i32 %23, poison
ret i32 %24
}

LLVM IR (-O2):
define i32 @_generate_iw(i32 %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
int median(int);
int handle(int n) {
  int m, r = n;
  while (n != 0) {
    m = median(n);
    r += n % 10 * m;
    n = (n - (n % 10)) / 10;
  }
  return r;
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1173 <handle+0x63>
mov    -0x4(%rbp),%edi
call   1030 <median@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1121 <handle+0x11>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1157 <handle+0x47>
mov    %edi,%ebp
mov    %edi,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <median@plt>
movslq %ebx,%rcx
imul   $0x66666667,%rcx,%rbx
mov    %rbx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rbx
add    %edx,%ebx
lea    (%rbx,%rbx,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %eax,%esi
add    %esi,%ebp
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <handle+0x10>
jmp    1159 <handle+0x49>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @handle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %4
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32 @median(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = srem i32 %12, 10
%14 = load i32, i32* %3
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = add nsw i32 %16, %15
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = srem i32 %19, 10
%21 = sub nsw i32 %18, %20
%22 = sdiv i32 %21, 10
store i32 %22, i32* %2
br label %6
23: ; preds = %6
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @handle(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = tail call i32 @median(i32 %5)
%7 = srem i32 %5, 10
%8 = mul nsw i32 %6, %7
%9 = add nsw i32 %8, %4
%10 = sdiv i32 %5, 10
%11 = add i32 %5, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ set_cs_creset(int /*<<< orphan*/, int);
void sram_chip_select() { set_cs_creset(0, 1); }


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

x86 assembly (clang, -O2):
<sram_chip_select>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <set_cs_creset@plt>

LLVM IR (-O0):
define void @sram_chip_select() {
%1 = call i32 @set_cs_creset(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @sram_chip_select() {
%1 = tail call i32 @set_cs_creset(i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_function(int);
int main() {
  my_function(123);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
call   1030 <my_function@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @my_function(i32 123)
ret i32 0
}
void cmd_init(unsigned int win) {}


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

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

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

LLVM IR (-O2):
define void @cmd_init(i32 %0) {
ret void
}
/* Variables and functions */
long double expl(long double);
long double sinhl(long double x) { return .5L * (expl(x) - expl(-x)); }


x86 assembly (clang, -O0):
<sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fstpt  -0x1c(%rbp)
fldt   -0x10(%rbp)
fchs
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fldt   -0x1c(%rbp)
fsubp  %st,%st(1)
flds   0xeb8(%rip)
fmulp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinhl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fstpt  0x1c(%rsp)
fldt   0x10(%rsp)
fchs
fstpt  (%rsp)
call   1030 <expl@plt>
fldt   0x1c(%rsp)
fsubp  %st,%st(1)
fmuls  0xebc(%rip)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @expl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = fneg x86_fp80 %5
%7 = call x86_fp80 @expl(x86_fp80 %6)
%8 = fsub x86_fp80 %4, %7
%9 = fmul x86_fp80 0xK3FFE8000000000000000, %8
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @expl(x86_fp80 %0)
%3 = fneg x86_fp80 %0
%4 = tail call x86_fp80 @expl(x86_fp80 %3)
%5 = fsub x86_fp80 %2, %4
%6 = fmul x86_fp80 %5, 0xK3FFE8000000000000000
ret x86_fp80 %6
}
const char *mg_version(void) { return ("2.3"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"2.3\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"2.3\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
signed short signedshort_ignoring_unsignedlonglong(signed short x,
                                                   unsigned long long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_unsignedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_unsignedlonglong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_unsignedlonglong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
char counter$output$output_complete(char success) { return 1; }


x86 assembly (clang, -O0):
<counter$output$output_complete>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter$output$output_complete>:
mov    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @"counter$output$output_complete"(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8 1
}

LLVM IR (-O2):
define signext i8 @"counter$output$output_complete"(i8 signext %0) {
ret i8 1
}
/* Variables and functions */
unsigned int const HZ;
unsigned int msecs_to_jiffies(const unsigned int m) { return (m * HZ) / 1000; }


x86 assembly (clang, -O0):
<msecs_to_jiffies>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
imul   (%rcx),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

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

LLVM IR (-O0):
@HZ = constant i32 0
define i32 @msecs_to_jiffies(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @HZ
%5 = mul i32 %3, %4
%6 = udiv i32 %5, 1000
ret i32 %6
}

LLVM IR (-O2):
@HZ = constant i32 0
define i32 @msecs_to_jiffies(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cycleRowLeft(unsigned char, unsigned char);
void shiftRows() {
  unsigned char row;
  for (row = 1; row < 4; row++)
    cycleRowLeft(row, row);
}


x86 assembly (clang, -O0):
<shiftRows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x4,%eax
jge    1145 <shiftRows+0x35>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x1(%rbp),%esi
call   1030 <cycleRowLeft@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <shiftRows+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftRows>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <cycleRowLeft@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <cycleRowLeft@plt>
mov    $0x3,%edi
mov    $0x3,%esi
pop    %rax
jmp    1030 <cycleRowLeft@plt>

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

LLVM IR (-O2):
define void @shiftRows() {
%1 = tail call i32 @cycleRowLeft(i8 zeroext 1, i8 zeroext 1)
%2 = tail call i32 @cycleRowLeft(i8 zeroext 2, i8 zeroext 2)
%3 = tail call i32 @cycleRowLeft(i8 zeroext 3, i8 zeroext 3)
ret void
}
/* Type definitions */
struct client {
  int dummy;
};
typedef int /*<<< orphan*/ XDestroyWindowEvent;

/* Variables and functions */
int /*<<< orphan*/ cwithdraw(struct client *);
void destroynotify(struct client *c, XDestroyWindowEvent *e) { cwithdraw(c); }


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

x86 assembly (clang, -O2):
<destroynotify>:
jmp    1030 <cwithdraw@plt>

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

LLVM IR (-O2):
%struct.client = type { i32 }
define void @destroynotify(%struct.client* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @cwithdraw(%struct.client* %0)
ret void
}
unsigned xrop3_218_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & D;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_218_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_218_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %edi
and    %edi,%eax
xor    $0xff,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_218_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = and i32 %5, %6
%8 = xor i32 %7, 255
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void print_buffer(char *s, int q) {
  for (int i = 0; i < q; i++)
    printf("%c, %d", s[i], s[i]);
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <print_buffer+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xeb4(%rip),%rdi
movsbl %dl,%esi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_buffer+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <print_buffer+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edx
mov    %r14,%rdi
mov    %edx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_buffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c, %d\00"
define void @print_buffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %25
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %15, i8 signext %20)
br label %22
22: ; preds = %10
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %6
25: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c, %d\00"
define void @print_buffer(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
unsigned long ADCFIFORead(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulOffset;
  ulOffset = 0x00000074 + ulChannel;
  return ((*((volatile unsigned long *)(ulBase + ulOffset))));
}


x86 assembly (clang, -O0):
<ADCFIFORead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x74,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCFIFORead>:
mov    0x74(%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @ADCFIFORead(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 116, %6
store i64 %7, i64* %5
%8 = load i64, i64* %3
%9 = load i64, i64* %5
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ADCFIFORead(i64 %0, i64 %1) {
%3 = add i64 %0, 116
%4 = add i64 %3, %1
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
int test_imm_D6uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xD6 << 0)) ? -20 : -40;
}


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

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

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

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

/* Variables and functions */
int SIG_BLOCK;
int SIG_SETMASK;
int /*<<< orphan*/ check_blocked_sigs();
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main() {
  sigset_t s_set;
  sigfillset(&s_set);
  sigprocmask(SIG_BLOCK | SIG_SETMASK, &s_set, NULL);
  check_blocked_sigs();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <sigfillset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
or     (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    $0x0,%al
call   1040 <check_blocked_sigs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigfillset@plt>
mov    0x2e8f(%rip),%rax
mov    0x2e98(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
call   1040 <check_blocked_sigs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sigfillset(i32* %2)
%4 = load i32, i32* @SIG_BLOCK
%5 = load i32, i32* @SIG_SETMASK
%6 = or i32 %4, %5
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32* null)
%8 = call i32 (...) @check_blocked_sigs()
ret i32 0
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_BLOCK
%5 = load i32, i32* @SIG_SETMASK
%6 = or i32 %5, %4
%7 = call i32 @sigprocmask(i32 %6, i32* %1, i32* null)
%8 = call i32 (...) @check_blocked_sigs()
ret i32 0
}
char *vax_pshort(char *msgp, unsigned short s) {
  msgp[0] = s & 0xFF;
  msgp[1] = s >> 8;
  return (msgp + 2);
}


x86 assembly (clang, -O0):
<vax_pshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vax_pshort>:
mov    %si,(%rdi)
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @vax_pshort(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
ret i8* %18
}

LLVM IR (-O2):
define i8* @vax_pshort(i8* writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
store i8 %3, i8* %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %7
}
int ft_sqrt(int n) {
  int i;
  i = 0;
  while (i * i <= n) {
    if (i * i == n)
      return (i);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1147 <ft_sqrt+0x47>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1139 <ft_sqrt+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <ft_sqrt+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <ft_sqrt+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
test   %edi,%edi
js     1120 <ft_sqrt+0x20>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %edi,%ecx
je     1122 <ft_sqrt+0x22>
add    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
jle    1110 <ft_sqrt+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %9, %7 ], [ 0, %1 ]
%5 = phi i32 [ %8, %7 ], [ 0, %1 ]
%6 = icmp eq i32 %4, %0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %5, 1
%9 = mul nsw i32 %8, %8
%10 = icmp sgt i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %7, %1
%12 = phi i32 [ 0, %1 ], [ 0, %7 ], [ %5, %3 ]
ret i32 %12
}
void debug_object_init(void *addr, struct debug_obj_descr *descr) {}


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

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

LLVM IR (-O0):
%struct.debug_obj_descr = type opaque
define void @debug_object_init(i8* %0, %struct.debug_obj_descr* %1) {
%3 = alloca i8*
%4 = alloca %struct.debug_obj_descr*
store i8* %0, i8** %3
store %struct.debug_obj_descr* %1, %struct.debug_obj_descr** %4
ret void
}

LLVM IR (-O2):
%struct.debug_obj_descr = type opaque
define void @debug_object_init(i8* nocapture %0, %struct.debug_obj_descr* nocapture %1) {
ret void
}