xunge/DecIR huggingface dataset:
int test_imm_C0uint16_mem(unsigned short *val) {
  return ((*val) & (-0xC0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C0uint16_mem>:
movzwl (%rdi),%eax
test   $0xff40,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C0uint16_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, -192
%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_C0uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -192
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int killchar();
int md_killchar() { return (killchar()); }


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

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

LLVM IR (-O0):
define i32 @md_killchar() {
%1 = call i32 (...) @killchar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @md_killchar() {
%1 = tail call i32 (...) @killchar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void convert_fahrenheit(float fahrenheit) {
  float celsius = 0.0;
  celsius = ((fahrenheit - 32.0) / 9.0) * 5.0;
  printf("%.2f\n", celsius);
  return;
}


x86 assembly (clang, -O0):
<convert_fahrenheit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_fahrenheit>:
cvtss2sd %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
divsd  0xee4(%rip),%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define void @convert_fahrenheit(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 3.200000e+01
%7 = fdiv double %6, 9.000000e+00
%8 = fmul double %7, 5.000000e+00
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define void @convert_fahrenheit(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fdiv double %3, 9.000000e+00
%5 = fmul double %4, 5.000000e+00
%6 = fptrunc double %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %6)
ret void
}
/* Variables and functions */
int func1();
int func2();
int main(int argc, char **argv) { return func1() - func2(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <func1@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <func2@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <func1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <func2@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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 (...) @func1()
%7 = call i32 (...) @func2()
%8 = sub nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func1()
%4 = tail call i32 (...) @func2()
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ swab(char *, char *, int);
int main() {
  char src[] = "abcdefg";
  char dst[10] = {0};
  swab(src, dst, 5);
  printf("before: %s\n", src);
  printf("after: %s\n", dst);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0x16(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
lea    -0xc(%rbp),%rdi
lea    -0x16(%rbp),%rsi
mov    $0x5,%edx
call   1030 <swab@plt>
lea    -0xc(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    -0x16(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x67666564636261,%rax
mov    %rax,0x10(%rsp)
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1030 <swab@plt>
lea    0xe9c(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe99(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"before: %s\0A\00"
@.str.1 = [11 x i8] c"after: %s\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [10 x i8]
%3 = bitcast i64* %1 to i8*
store i64 29104508263162465, i64* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @swab(i8* %3, i8* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ *OPENSSL_malloc(size_t);
uint8_t *bridge_openssl_malloc(size_t num) { return OPENSSL_malloc(num); }


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

x86 assembly (clang, -O2):
<bridge_openssl_malloc>:
jmp    1030 <OPENSSL_malloc@plt>

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

LLVM IR (-O2):
define i32* @bridge_openssl_malloc(i64 %0) {
%2 = tail call i32* @OPENSSL_malloc(i64 %0)
ret i32* %2
}
void msdelay(unsigned long ms) {
  unsigned long delay;
  delay = ms * 16000;
  for (; delay > 0; delay--)
    ;
}


x86 assembly (clang, -O0):
<msdelay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x3e80,-0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1135 <msdelay+0x35>
jmp    1124 <msdelay+0x24>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <msdelay+0x14>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @msdelay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 16000
store i64 %5, i64* %3
br label %6
6: ; preds = %10, %1
%7 = load i64, i64* %3
%8 = icmp ugt i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i64, i64* %3
%12 = add i64 %11, -1
store i64 %12, i64* %3
br label %6
13: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @msdelay(i64 %0) {
ret void
}
void RTAvlroGCPhysGetRight(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPhysGetRight() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ find_map(int /*<<< orphan*/);
int /*<<< orphan*/ init_map();
int /*<<< orphan*/ print_map();
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  init_map();
  find_map(stdin);
  print_map();
  exit(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 <init_map@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <find_map@plt>
mov    $0x0,%al
call   1040 <print_map@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_map@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <find_map@plt>
xor    %eax,%eax
call   1040 <print_map@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
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 (...) @init_map()
%7 = load i32, i32* @stdin
%8 = call i32 @find_map(i32 %7)
%9 = call i32 (...) @print_map()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_map()
%4 = load i32, i32* @stdin
%5 = tail call i32 @find_map(i32 %4)
%6 = tail call i32 (...) @print_map()
%7 = tail call i32 @exit(i32 0)
unreachable
}
float debuginator__ceil(float v) {
  if ((int)v == v) {
    return v;
  }
  return (float)((int)v) + 1;
}


x86 assembly (clang, -O0):
<debuginator__ceil>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1131 <debuginator__ceil+0x31>
jp     1131 <debuginator__ceil+0x31>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114b <debuginator__ceil+0x4b>
cvttss2si -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  0xebe(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<debuginator__ceil>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
movss  0xef1(%rip),%xmm2
addss  %xmm1,%xmm2
cmpeqss %xmm0,%xmm1
andps  %xmm1,%xmm0
andnps %xmm2,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @debuginator__ceil(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
%6 = sitofp i32 %5 to float
%7 = load float, float* %3
%8 = fcmp oeq float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %16
11: ; preds = %1
%12 = load float, float* %3
%13 = fptosi float %12 to i32
%14 = sitofp i32 %13 to float
%15 = fadd float %14, 1.000000e+00
store float %15, float* %2
br label %16
16: ; preds = %11, %9
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @debuginator__ceil(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp oeq float %3, %0
%5 = fadd float %3, 1.000000e+00
%6 = select i1 %4, float %0, float %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, v, c;
  a = 120;
  v = 135;
  c = v != a;
  printf("%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x78,-0x8(%rbp)
movl   $0x87,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb8(%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
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list_link {
  int dummy;
};
struct clause_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_head(struct genlist const *);
struct clause_list_link *clause_list_head(const struct clause_list *tthis) {
  return (struct clause_list_link *)genlist_head((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<clause_list_head>:
jmp    1030 <genlist_head@plt>

LLVM IR (-O0):
%struct.clause_list_link = type { i32 }
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.clause_list_link* @clause_list_head(%struct.clause_list* %0) {
%2 = alloca %struct.clause_list*
store %struct.clause_list* %0, %struct.clause_list** %2
%3 = load %struct.clause_list*, %struct.clause_list** %2
%4 = bitcast %struct.clause_list* %3 to %struct.genlist*
%5 = call i64 @genlist_head(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.clause_list_link*
ret %struct.clause_list_link* %6
}

LLVM IR (-O2):
%struct.clause_list_link = type { i32 }
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.clause_list_link* @clause_list_head(%struct.clause_list* %0) {
%2 = bitcast %struct.clause_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_head(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.clause_list_link*
ret %struct.clause_list_link* %4
}
/* Variables and functions */
int /*<<< orphan*/ g_free(void *);
void ssl_sha1_info_delete(void *sha1_info) { g_free(sha1_info); }


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

x86 assembly (clang, -O2):
<ssl_sha1_info_delete>:
jmp    1030 <g_free@plt>

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

LLVM IR (-O2):
define void @ssl_sha1_info_delete(i8* %0) {
%2 = tail call i32 @g_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
unsigned short func_13(int p_14) {
  unsigned char l_15 = 0x58L;
  step_hash(2);
  return l_15;
}


x86 assembly (clang, -O0):
<func_13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x58,-0x5(%rbp)
mov    $0x2,%edi
call   1030 <step_hash@plt>
movzbl -0x5(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_13>:
push   %rax
mov    $0x2,%edi
call   1030 <step_hash@plt>
mov    $0x58,%ax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @func_13(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 88, i8* %3
%4 = call i32 @step_hash(i32 2)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @func_13(i32 %0) {
%2 = tail call i32 @step_hash(i32 2)
ret i16 88
}
void gdk_event_send_client_message() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_send_client_message() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, float, int, float);
main() {
  int num1 = 10;
  float num2 = 2.5;
  float num3;
  int num4;
  float num5;
  num3 = num1 / num2;
  num4 = num1 / num2;
  num5 = num1 / 4.0;
  printf("num3 is %f, num4 is %d, num5 is %f", num3, num4, num5);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%esi
movss  -0x14(%rbp),%xmm1
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
movss  0xed0(%rip),%xmm0
movss  0xecc(%rip),%xmm1
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"num3 is %f, num4 is %d, num5 is %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store i32 10, i32* %1
store float 2.500000e+00, float* %2
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = fdiv float %7, %8
store float %9, float* %3
%10 = load i32, i32* %1
%11 = sitofp i32 %10 to float
%12 = load float, float* %2
%13 = fdiv float %11, %12
%14 = fptosi float %13 to i32
store i32 %14, i32* %4
%15 = load i32, i32* %1
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 4.000000e+00
%18 = fptrunc double %17 to float
store float %18, float* %5
%19 = load float, float* %3
%20 = load i32, i32* %4
%21 = load float, float* %5
%22 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float %19, i32 %20, float %21)
%23 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"num3 is %f, num4 is %d, num5 is %f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float 4.000000e+00, i32 4, float 2.500000e+00)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calculateFMinMax();
int /*<<< orphan*/ findSolution();
int main(void) {
  calculateFMinMax();
  findSolution();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @calculateFMinMax()
%2 = tail call i32 (...) @findSolution()
ret i32 0
}
/* Variables and functions */
int CHAR_BIT;
int /*<<< orphan*/ printf(char *, int);
int hlp_wordsize(void) {
  printf("%zu\n", CHAR_BIT * sizeof(void *));
  return 0;
}


x86 assembly (clang, -O0):
<hlp_wordsize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_wordsize>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
shl    $0x3,%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%zu\0A\00"
@CHAR_BIT = global i32 0
define i32 @hlp_wordsize() {
%1 = load i32, i32* @CHAR_BIT
%2 = sext i32 %1 to i64
%3 = mul i64 %2, 8
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%zu\0A\00"
@CHAR_BIT = global i32 0
define i32 @hlp_wordsize() {
%1 = load i32, i32* @CHAR_BIT
%2 = shl i32 %1, 3
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *CallocMe(int nelem, int size) {
  void *ptr = calloc(nelem, size);
  if (!ptr) {
    perror("tcl_cruncher");
    exit(6);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<CallocMe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <CallocMe+0x3e>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x6,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CallocMe>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <CallocMe+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x6,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"tcl_cruncher\00"
define noalias i8* @CallocMe(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 6)
unreachable
8: ; preds = %2
ret i8* %3
}
main() {
  int *x = (__typeof(x))2;
  __typeof(*x) i;
  i = (__typeof(int))x;
  assert(i == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 2 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = ptrtoint i32* %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
char *basename(const char *path) {
  char *ptr = strrchr(path, '\\');
  return ptr ? ptr + 1 : (char *)path;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 92)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ ActivateMostDistantPoint();
int main() { ActivateMostDistantPoint(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ActivateMostDistantPoint@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @ActivateMostDistantPoint()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ActivateMostDistantPoint()
ret i32 0
}
void printf_begin(void) {}


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

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

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

LLVM IR (-O2):
define void @printf_begin() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *);
int MIME_init_hexconv(void) {
  syslog(1, "MIME_init_hexconv(): WARNING - Using a deprecated function. "
            "Please remove from your code.");
  return 0;
}


x86 assembly (clang, -O0):
<MIME_init_hexconv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIME_init_hexconv>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [90 x i8] c"MIME_init_hexconv(): WARNING - Using a deprecated function. Please remove from your code.\00"
define i32 @MIME_init_hexconv() {
%1 = call i32 @syslog(i32 1, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [90 x i8] c"MIME_init_hexconv(): WARNING - Using a deprecated function. Please remove from your code.\00"
define i32 @MIME_init_hexconv() {
%1 = tail call i32 @syslog(i32 1, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
char *rev_w(const char w[]) {
  char a[100];
  gets(a);
  reverse(a, 0, strlen(a) - 1);
  printf("%s\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<rev_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <reverse@plt>
lea    -0x70(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_w>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <reverse@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i8* @rev_w(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i64 @strlen(i8* %7)
%9 = sub nsw i64 %8, 1
%10 = call i32 @reverse(i8* %6, i32 0, i64 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i8* null
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define noalias i8* @rev_w(i8* nocapture readnone %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = call i64 @strlen(i8* %3)
%6 = add nsw i64 %5, -1
%7 = call i32 @reverse(i8* %3, i32 0, i64 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* null
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSCA(const char *the_title) { return any_decrqss(the_title, "\"q"); }


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

x86 assembly (clang, -O2):
<rpt_DECSCA>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\22q\00"
define i32 @rpt_DECSCA(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"\22q\00"
define i32 @rpt_DECSCA(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned int *);
void refstr_put(const char *r) {
  unsigned int *ref;
  if (r) {
    ref = (unsigned int *)r - 1;
    if (!--*ref)
      free(ref);
  }
}


x86 assembly (clang, -O0):
<refstr_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <refstr_put+0x45>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0xffffffff,%eax
mov    %eax,(%rcx)
cmp    $0x0,%eax
jne    1150 <refstr_put+0x40>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1155 <refstr_put+0x45>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refstr_put>:
test   %rdi,%rdi
je     111b <refstr_put+0xb>
addl   $0xffffffff,-0x4(%rdi)
je     111c <refstr_put+0xc>
ret
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @refstr_put(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add i32 %6, -1
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 @free(i32* %5)
br label %11
11: ; preds = %3, %9, %1
ret void
}
int addstring(s, cnt, machine)
register char *s;
struct state **machine;
{
  if (!s || !*s) {
    return -1;
  }
  return addtomach(s, cnt, machine);
}


x86 assembly (clang, -O0):
<addstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113b <addstring+0x2b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <addstring+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <addstring+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <addtomach@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addstring>:
test   %rdi,%rdi
je     1121 <addstring+0x11>
cmpb   $0x0,(%rdi)
je     1121 <addstring+0x11>
xor    %eax,%eax
jmp    1030 <addtomach@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.state = type opaque
define i32 @addstring(i8* %0, i32 %1, %struct.state** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.state**
store i8* %0, i8** %5
store i32 %1, i32* %6
store %struct.state** %2, %struct.state*** %7
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10, %3
store i32 -1, i32* %4
br label %20
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = load %struct.state**, %struct.state*** %7
%19 = call i32 (i8*, i32, %struct.state**, ...) bitcast (i32 (...)* @addtomach to i32 (i8*, i32, %struct.state**, ...)*)(i8* %16, i32 %17, %struct.state** %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %15, %14
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
%struct.state = type opaque
define i32 @addstring(i8* %0, i32 %1, %struct.state** %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (i8*, i32, %struct.state**, ...) bitcast (i32 (...)* @addtomach to i32 (i8*, i32, %struct.state**, ...)*)(i8* %0, i32 %1, %struct.state** %2)
br label %10
10: ; preds = %3, %5, %8
%11 = phi i32 [ %9, %8 ], [ -1, %5 ], [ -1, %3 ]
ret i32 %11
}
int nlm_irq_to_irt(int irq) {
  if ((((irq) >= 8) && ((irq) <= (8 + (31)))) == 0)
    return -1;
  return ((irq)-8);
}


x86 assembly (clang, -O0):
<nlm_irq_to_irt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1120 <nlm_irq_to_irt+0x20>
cmpl   $0x27,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    113d <nlm_irq_to_irt+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <nlm_irq_to_irt+0x46>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlm_irq_to_irt>:
lea    -0x28(%rdi),%eax
lea    -0x8(%rdi),%ecx
cmp    $0xffffffe0,%eax
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nlm_irq_to_irt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 8
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 39
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 -1, i32* %2
br label %17
14: ; preds = %9
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 8
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @nlm_irq_to_irt(i32 %0) {
%2 = add i32 %0, -40
%3 = icmp ult i32 %2, -32
%4 = add nsw i32 %0, -8
%5 = select i1 %3, i32 -1, i32 %4
ret i32 %5
}
void UYVYToUV422Row_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToUV422Row_SSE2() {
ret void
}
/* Variables and functions */
int sv_stop(int);
int vox_stop(int slot) { return sv_stop(slot); }


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

x86 assembly (clang, -O2):
<vox_stop>:
jmp    1030 <sv_stop@plt>

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

LLVM IR (-O2):
define i32 @vox_stop(i32 %0) {
%2 = tail call i32 @sv_stop(i32 %0)
ret i32 %2
}
void foo(int x, char *y) {
  if (x != 0)
    __builtin_snprintf(y, 0, "foo");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <foo+0x2f>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define void @foo(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %8, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIO2_Combined_0_15_DriverIRQHandler();
__attribute__((weak)) void GPIO2_Combined_0_15_IRQHandler(void) {
  GPIO2_Combined_0_15_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO2_Combined_0_15_IRQHandler() {
%1 = call i32 (...) @GPIO2_Combined_0_15_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO2_Combined_0_15_IRQHandler() {
%1 = tail call i32 (...) @GPIO2_Combined_0_15_DriverIRQHandler()
ret void
}
void av_timecode_init_from_string() {}


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

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

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

LLVM IR (-O2):
define void @av_timecode_init_from_string() {
ret void
}
float _abs(float a) { return a < 0 ? -a : a; }


x86 assembly (clang, -O0):
<_abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <_abs+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <_abs+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_abs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_abs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @_abs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
float my_random_float() {
  int x, exp, mant;
  union {
    float f;
    int i;
  } b;
  x = random();
  asm("bsfl %1, %0" : "=r"(exp) : "r"(x));
  exp = 126 - exp;
  mant = x >> 8;
  b.i = (exp << 23) | mant;
  return b.f;
}


x86 assembly (clang, -O0):
<my_random_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsf    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7e,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x17,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_random_float>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
bsf    %eax,%ecx
sar    $0x8,%eax
shl    $0x17,%ecx
mov    $0x3f000000,%edx
sub    %ecx,%edx
or     %eax,%edx
movd   %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @my_random_float() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.anon
%5 = call i32 (...) @random()
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 asm "bsfl $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = sub nsw i32 126, %8
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = ashr i32 %10, 8
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 %12, 23
%14 = load i32, i32* %3
%15 = or i32 %13, %14
%16 = bitcast %union.anon* %4 to i32*
store i32 %15, i32* %16
%17 = bitcast %union.anon* %4 to float*
%18 = load float, float* %17
ret float %18
}

LLVM IR (-O2):
define float @my_random_float() {
%1 = tail call i32 (...) @random()
%2 = tail call i32 asm "bsfl $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %1)
%3 = ashr i32 %1, 8
%4 = mul i32 %2, -8388608
%5 = add i32 %4, 1056964608
%6 = or i32 %5, %3
%7 = bitcast i32 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void SaveCursorPosition() { printf("\e[s"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[s\00"
define void @SaveCursorPosition() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[s\00"
define void @SaveCursorPosition() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float wrnoise_2d_fancy(float, float, int, int /*<<< orphan*/,
                       int /*<<< orphan*/, float *, float *, int);
float fancy_smooth_worley_noise(float x, float y) {
  float dontcare;
  return wrnoise_2d_fancy(x, y, 117, 0, 0, &dontcare, &dontcare, 0x0000008);
}


x86 assembly (clang, -O0):
<fancy_smooth_worley_noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mov    $0x75,%edi
xor    %edx,%edx
lea    -0xc(%rbp),%r8
mov    $0x8,%r9d
mov    %edx,%esi
mov    %r8,%rcx
call   1030 <wrnoise_2d_fancy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fancy_smooth_worley_noise>:
push   %rax
lea    0x4(%rsp),%rcx
mov    $0x75,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    %rcx,%r8
mov    $0x8,%r9d
call   1030 <wrnoise_2d_fancy@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @fancy_smooth_worley_noise(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @wrnoise_2d_fancy(float %6, float %7, i32 117, i32 0, i32 0, float* %5, float* %5, i32 8)
ret float %8
}

LLVM IR (-O2):
define float @fancy_smooth_worley_noise(float %0, float %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call float @wrnoise_2d_fancy(float %0, float %1, i32 117, i32 0, i32 0, float* %3, float* %3, i32 8)
ret float %5
}
/* Type definitions */
typedef int GLdouble;

/* Variables and functions */
void scalarmult(GLdouble s, GLdouble v[3], GLdouble vout[3]) {
  vout[0] = v[0] * s;
  vout[1] = v[1] * s;
  vout[2] = v[2] * s;
}


x86 assembly (clang, -O0):
<scalarmult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
imul   -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
imul   -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
imul   -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalarmult>:
mov    (%rsi),%eax
imul   %edi,%eax
mov    %eax,(%rdx)
mov    0x4(%rsi),%eax
imul   %edi,%eax
mov    %eax,0x4(%rdx)
imul   0x8(%rsi),%edi
mov    %edi,0x8(%rdx)
ret

LLVM IR (-O0):
define void @scalarmult(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 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = load i32*, i32** %6
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = load i32, i32* %4
%18 = mul nsw i32 %16, %17
%19 = load i32*, i32** %6
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 %18, i32* %20
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = load i32, i32* %4
%25 = mul nsw i32 %23, %24
%26 = load i32*, i32** %6
%27 = getelementptr inbounds i32, i32* %26, i64 2
store i32 %25, i32* %27
ret void
}

LLVM IR (-O2):
define void @scalarmult(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %0
store i32 %5, i32* %2
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, %0
%9 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %8, i32* %9
%10 = getelementptr inbounds i32, i32* %1, i64 2
%11 = load i32, i32* %10
%12 = mul nsw i32 %11, %0
%13 = getelementptr inbounds i32, i32* %2, i64 2
store i32 %12, i32* %13
ret void
}