xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strlen(char *);
int main(void) {
  char *s = malloc(500);
  *s = '\0';
  printf("strlen of a zero-length string = [%d]\n", (int)strlen(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1f4,%edi
call   1050 <malloc@plt>
movb   $0x0,(%rax)
mov    %rax,%rdi
call   1030 <strlen@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"strlen of a zero-length string = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 500)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
store i8 0, i8* %4
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"strlen of a zero-length string = [%d]\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(500) i8* @malloc(i32 500)
store i8 0, i8* %1
%2 = tail call i64 @strlen(i8* %1)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int getnetmaskbyaddr(const struct in_addr addr, struct in_addr *mask) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<getnetmaskbyaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnetmaskbyaddr>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@ENOSYS = global i32 0
define i32 @getnetmaskbyaddr(i32 %0, %struct.in_addr* %1) {
%3 = alloca %struct.in_addr
%4 = alloca %struct.in_addr*
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %0, i32* %5
store %struct.in_addr* %1, %struct.in_addr** %4
%6 = load i32, i32* @ENOSYS
%7 = call i32 @__set_errno(i32 %6)
ret i32 -1
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@ENOSYS = global i32 0
define i32 @getnetmaskbyaddr(i32 %0, %struct.in_addr* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
void test_many_lines(void) {}


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

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

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

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

/* Variables and functions */
int Cyc_AssnDef_logicvar_in_term(void *, void *);
int Cyc_AssnDef_logicvar_in_map_internal(void *lvar,
                                         struct Cyc_Absyn_Vardecl *dummy,
                                         void *value, int in_map) {
  int _T0;
  int _T1;
  _T1 = in_map;
  if (!_T1)
    goto _TL2D9;
  _T0 = 1;
  goto _TL2DA;
_TL2D9:
  _T0 = Cyc_AssnDef_logicvar_in_term(lvar, value);
_TL2DA:
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_AssnDef_logicvar_in_map_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    113c <Cyc_AssnDef_logicvar_in_map_internal+0x2c>
jmp    1148 <Cyc_AssnDef_logicvar_in_map_internal+0x38>
movl   $0x1,-0x20(%rbp)
jmp    1158 <Cyc_AssnDef_logicvar_in_map_internal+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Cyc_AssnDef_logicvar_in_term@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_AssnDef_logicvar_in_map_internal>:
test   %ecx,%ecx
je     111a <Cyc_AssnDef_logicvar_in_map_internal+0xa>
mov    $0x1,%eax
ret
mov    %rdx,%rsi
jmp    1030 <Cyc_AssnDef_logicvar_in_term@plt>

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

LLVM IR (-O2):
%struct.Cyc_Absyn_Vardecl = type { i32 }
define i32 @Cyc_AssnDef_logicvar_in_map_internal(i8* %0, %struct.Cyc_Absyn_Vardecl* nocapture readnone %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @Cyc_AssnDef_logicvar_in_term(i8* %0, i8* %2)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
void FreeMatrixInt(int **in) {
  free(in[0]);
  free(in);
}


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

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

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

LLVM IR (-O2):
define void @FreeMatrixInt(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i32** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_POLYGON;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2f(double, double);
void draw_colon_square(void) {
  glBegin(GL_POLYGON);
  glVertex2f(0, 0);
  glVertex2f(0, 0.12);
  glVertex2f(0.12, 0.12);
  glVertex2f(0.12, 0);
  glEnd();
}


x86 assembly (clang, -O0):
<draw_colon_square>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex2f@plt>
xorps  %xmm0,%xmm0
movsd  0xea8(%rip),%xmm1
call   1040 <glVertex2f@plt>
movsd  0xe9b(%rip),%xmm1
movaps %xmm1,%xmm0
call   1040 <glVertex2f@plt>
movsd  0xe8b(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1040 <glVertex2f@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_colon_square>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1040 <glVertex2f@plt>
movsd  0xeae(%rip),%xmm1
xorps  %xmm0,%xmm0
call   1040 <glVertex2f@plt>
movsd  0xe9e(%rip),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex2f@plt>
xorps  %xmm1,%xmm1
movsd  0xe8b(%rip),%xmm0
call   1040 <glVertex2f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_POLYGON = global i32 0
define void @draw_colon_square() {
%1 = load i32, i32* @GL_POLYGON
%2 = call i32 @glBegin(i32 %1)
%3 = call i32 @glVertex2f(double 0.000000e+00, double 0.000000e+00)
%4 = call i32 @glVertex2f(double 0.000000e+00, double 1.200000e-01)
%5 = call i32 @glVertex2f(double 1.200000e-01, double 1.200000e-01)
%6 = call i32 @glVertex2f(double 1.200000e-01, double 0.000000e+00)
%7 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_POLYGON = global i32 0
define void @draw_colon_square() {
%1 = load i32, i32* @GL_POLYGON
%2 = tail call i32 @glBegin(i32 %1)
%3 = tail call i32 @glVertex2f(double 0.000000e+00, double 0.000000e+00)
%4 = tail call i32 @glVertex2f(double 0.000000e+00, double 1.200000e-01)
%5 = tail call i32 @glVertex2f(double 1.200000e-01, double 1.200000e-01)
%6 = tail call i32 @glVertex2f(double 1.200000e-01, double 0.000000e+00)
%7 = tail call i32 (...) @glEnd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x7f() {
  Assert_real((isgraph(127) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              640, ("isgraph should be 0 for 0x7f"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x7f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x280,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x280,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x7f\00"
define void @t_isgraph_0x7f() {
%1 = call i64 @isgraph(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x7f\00"
define void @t_isgraph_0x7f() {
%1 = tail call i64 @isgraph(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pluscconlyla(unsigned long a, unsigned long b) {
  unsigned long sum = a + b;
  if (sum < a)
    abort();
}


x86 assembly (clang, -O0):
<pluscconlyla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1141 <pluscconlyla+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscconlyla>:
add    %rsi,%rdi
jb     1116 <pluscconlyla+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pluscconlyla(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* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pluscconlyla(i64 %0, i64 %1) {
%3 = xor i64 %0, -1
%4 = icmp ult i64 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
int f8(int x, int y) {
  if (y >= -13 && y <= 15)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xfffffff3,-0x8(%rbp)
jl     111e <f8+0x1e>
cmpl   $0xf,-0x8(%rbp)
jg     111e <f8+0x1e>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
mov    %edi,%eax
neg    %esi
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f8(i32 %0, i32 %1) {
%3 = add i32 %1, -16
%4 = icmp ult i32 %3, -29
tail call void @llvm.assume(i1 %4)
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
ret i32 %6
}
void _nanosMainLoop() {}


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

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

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

LLVM IR (-O2):
define void @_nanosMainLoop() {
ret void
}
void vec2_mix(const float a[2], const float b[2], float t, float out[2]) {
  out[0] = a[0] * (1 - t) + b[0] * t;
  out[1] = a[1] * (1 - t) + b[1] * t;
}


x86 assembly (clang, -O0):
<vec2_mix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  0xedb(%rip),%xmm2
subss  -0x14(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  0xea8(%rip),%xmm2
subss  -0x14(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_mix>:
movss  0xef8(%rip),%xmm1
subss  %xmm0,%xmm1
movss  (%rsi),%xmm2
mulss  %xmm0,%xmm2
movss  (%rdi),%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  %xmm3,(%rdx)
mulss  0x4(%rsi),%xmm0
mulss  0x4(%rdi),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdx)
ret

LLVM IR (-O0):
define void @vec2_mix(float* %0, float* %1, float %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
%8 = alloca float*
store float* %0, float** %5
store float* %1, float** %6
store float %2, float* %7
store float* %3, float** %8
%9 = load float*, float** %5
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = load float, float* %7
%13 = fsub float 1.000000e+00, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
%16 = load float, float* %15
%17 = load float, float* %7
%18 = fmul float %16, %17
%19 = call float @llvm.fmuladd.f32(float %11, float %13, float %18)
%20 = load float*, float** %8
%21 = getelementptr inbounds float, float* %20, i64 0
store float %19, float* %21
%22 = load float*, float** %5
%23 = getelementptr inbounds float, float* %22, i64 1
%24 = load float, float* %23
%25 = load float, float* %7
%26 = fsub float 1.000000e+00, %25
%27 = load float*, float** %6
%28 = getelementptr inbounds float, float* %27, i64 1
%29 = load float, float* %28
%30 = load float, float* %7
%31 = fmul float %29, %30
%32 = call float @llvm.fmuladd.f32(float %24, float %26, float %31)
%33 = load float*, float** %8
%34 = getelementptr inbounds float, float* %33, i64 1
store float %32, float* %34
ret void
}

LLVM IR (-O2):
define void @vec2_mix(float* nocapture %0, float* nocapture %1, float %2, float* nocapture writeonly %3) {
%5 = load float, float* %0
%6 = fsub float 1.000000e+00, %2
%7 = load float, float* %1
%8 = fmul float %7, %2
%9 = tail call float @llvm.fmuladd.f32(float %5, float %6, float %8)
store float %9, float* %3
%10 = getelementptr inbounds float, float* %0, i64 1
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %1, i64 1
%13 = load float, float* %12
%14 = fmul float %13, %2
%15 = tail call float @llvm.fmuladd.f32(float %11, float %6, float %14)
%16 = getelementptr inbounds float, float* %3, i64 1
store float %15, float* %16
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_size(const char *filename) {
  struct stat file_stat;
  if (stat(filename, &file_stat) != 0) {
    return 1;
  }
  return (int)file_stat.st_size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <file_size+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <file_size+0x36>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1129 <file_size+0x19>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @file_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 %8, i32 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void justquit(int dummy) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @justquit(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
void of_overlay_mutex_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @of_overlay_mutex_unlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void wczytaj_liczbe(int *n) {
  printf("Wpisz liczbę naturalną: ");
  scanf("%d", n);
}


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

x86 assembly (clang, -O2):
<wczytaj_liczbe>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Wpisz liczb\C4\99 naturaln\C4\85: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @wczytaj_liczbe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Wpisz liczb\C4\99 naturaln\C4\85: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @wczytaj_liczbe(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pcap_write_flush();
void sig_flush(int signum) { pcap_write_flush(); }


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

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

LLVM IR (-O0):
define void @sig_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pcap_write_flush()
ret void
}

LLVM IR (-O2):
define void @sig_flush(i32 %0) {
%2 = tail call i32 (...) @pcap_write_flush()
ret void
}
int test_imm_C3uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xC3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C3uint64_midword_reg>:
test   $0xc30000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 195
%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_C3uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12779520
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void kasan_release_vmalloc(unsigned long start, unsigned long end,
                           unsigned long free_region_start,
                           unsigned long free_region_end) {}


x86 assembly (clang, -O0):
<kasan_release_vmalloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @kasan_release_vmalloc(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
define void @kasan_release_vmalloc(i64 %0, i64 %1, i64 %2, i64 %3) {
ret void
}
/* Variables and functions */
scalar_t__ powInt(int, int);
float minFixed(int k, int l) { return (-1.0) * (float)powInt(2, k - 1); }


x86 assembly (clang, -O0):
<minFixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    $0x2,%edi
call   1030 <powInt@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minFixed>:
push   %rax
lea    -0x1(%rdi),%esi
mov    $0x2,%edi
call   1030 <powInt@plt>
cvtsi2ss %rax,%xmm0
xorps  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @minFixed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
%7 = call i64 @powInt(i32 2, i32 %6)
%8 = sitofp i64 %7 to float
%9 = fpext float %8 to double
%10 = fmul double -1.000000e+00, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @minFixed(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i64 @powInt(i32 2, i32 %3)
%5 = sitofp i64 %4 to float
%6 = fneg float %5
ret float %6
}
/* Type definitions */
struct in_addr {
  int s_addr;
};

/* Variables and functions */
int inet_addr(char const *);
int inet_aton(const char *cp, struct in_addr *addr) {
  addr->s_addr = inet_addr(cp);
  return (addr->s_addr == 0xffffffff) ? 0 : 1;
}


x86 assembly (clang, -O0):
<inet_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_aton>:
push   %rbx
mov    %rsi,%rbx
call   1030 <inet_addr@plt>
mov    %eax,(%rbx)
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i8*
%4 = alloca %struct.in_addr*
store i8* %0, i8** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load i8*, i8** %3
%6 = call i32 @inet_addr(i8* %5)
%7 = load %struct.in_addr*, %struct.in_addr** %4
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load %struct.in_addr*, %struct.in_addr** %4
%10 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, -1
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 1
ret i32 %14
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* nocapture writeonly %1) {
%3 = tail call i32 @inet_addr(i8* %0)
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = icmp ne i32 %3, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
unsigned long reg_read(int);
int gpio_get(int gpio) {
  unsigned long dr;
  gpio -= 96;
  if (gpio > 31) {
    gpio -= 32;
    dr = reg_read(0x20AC000);
  } else {
    dr = reg_read(0x20A8000);
  }
  if (dr & (1 << gpio))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<gpio_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x60,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jle    114a <gpio_get+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    $0x20ac000,%edi
call   1030 <reg_read@plt>
mov    %rax,-0x10(%rbp)
jmp    1158 <gpio_get+0x48>
mov    $0x20a8000,%edi
call   1030 <reg_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1184 <gpio_get+0x74>
movl   $0x1,-0x4(%rbp)
jmp    118b <gpio_get+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_get>:
push   %rbx
xor    %eax,%eax
xor    %ebx,%ebx
cmp    $0x7f,%edi
setg   %al
setle  %bl
shl    $0x5,%ebx
add    %edi,%ebx
shl    $0xe,%eax
or     $0x20a8000,%eax
mov    %eax,%edi
call   1030 <reg_read@plt>
mov    $0x1,%edx
mov    %ebx,%ecx
shl    %cl,%edx
movslq %edx,%rdx
xor    %ecx,%ecx
test   %rdx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gpio_get(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 96
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 31
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %3
%12 = call i64 @reg_read(i32 34258944)
store i64 %12, i64* %4
br label %15
13: ; preds = %1
%14 = call i64 @reg_read(i32 34242560)
store i64 %14, i64* %4
br label %15
15: ; preds = %13, %9
%16 = load i64, i64* %4
%17 = load i32, i32* %3
%18 = shl i32 1, %17
%19 = sext i32 %18 to i64
%20 = and i64 %16, %19
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %15
store i32 1, i32* %2
br label %24
23: ; preds = %15
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @gpio_get(i32 %0) {
%2 = icmp sgt i32 %0, 127
%3 = select i1 %2, i32 -128, i32 -96
%4 = select i1 %2, i32 34258944, i32 34242560
%5 = add nsw i32 %3, %0
%6 = tail call i64 @reg_read(i32 %4)
%7 = shl nuw i32 1, %5
%8 = sext i32 %7 to i64
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
int fun922() { return 922; }


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

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

LLVM IR (-O0):
define i32 @fun922() {
ret i32 922
}

LLVM IR (-O2):
define i32 @fun922() {
ret i32 922
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void this_function_should_not_be_called(void) {
  printf("If it is, something is wrong\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"If it is, something is wrong\0A\00"
define void @this_function_should_not_be_called() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"If it is, something is wrong\00"
define void @this_function_should_not_be_called() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doubler(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int salary = 20000;
  printf("SalarY: %d\n", salary);
  doubler(&salary);
  printf("SalarY: %d\n", salary);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4e20,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <doubler@plt>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4e20,0xc(%rsp)
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4e20,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
call   1040 <doubler@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"SalarY: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 20000, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 20000)
%4 = call i32 @doubler(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void remove_filename(char *url) {
  while (*url)
    url++;
  while (*url != '/')
    --url;
  *url = '\0';
}


x86 assembly (clang, -O0):
<remove_filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1126 <remove_filename+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <remove_filename+0x8>
jmp    112b <remove_filename+0x2b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     114c <remove_filename+0x4c>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    112b <remove_filename+0x2b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_filename>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <remove_filename+0x10>
nopw   0x0(%rax,%rax,1)
cmpb   $0x2f,-0x1(%rdi)
lea    -0x1(%rdi),%rdi
jne    1120 <remove_filename+0x20>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_filename(i8* nocapture %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, %7
%8 = phi i8* [ %9, %7 ], [ %3, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 47
br i1 %11, label %12, label %7
12: ; preds = %7
store i8 0, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void _gdb_expr(void) { foo(); }


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

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

LLVM IR (-O0):
define void @_gdb_expr() {
%1 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @_gdb_expr() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sub_nr_running(struct rq *, int);
void dequeue_task_stop(struct rq *rq, struct task_struct *p, int flags) {
  sub_nr_running(rq, 1);
}


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

x86 assembly (clang, -O2):
<dequeue_task_stop>:
mov    $0x1,%esi
jmp    1030 <sub_nr_running@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @dequeue_task_stop(%struct.rq* %0, %struct.task_struct* %1, i32 %2) {
%4 = alloca %struct.rq*
%5 = alloca %struct.task_struct*
%6 = alloca i32
store %struct.rq* %0, %struct.rq** %4
store %struct.task_struct* %1, %struct.task_struct** %5
store i32 %2, i32* %6
%7 = load %struct.rq*, %struct.rq** %4
%8 = call i32 @sub_nr_running(%struct.rq* %7, i32 1)
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @dequeue_task_stop(%struct.rq* %0, %struct.task_struct* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @sub_nr_running(%struct.rq* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ restore_terminal();
int /*<<< orphan*/ termnoecho(int);
int getch() {
  int key;
  termnoecho(1);
  key = getch();
  restore_terminal();
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <termnoecho@plt>
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <restore_terminal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rax
mov    $0x1,%edi
call   1030 <termnoecho@plt>
call   1040 <getch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <restore_terminal@plt>

LLVM IR (-O0):
define i32 @getch() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @termnoecho(i32 1)
%4 = call i32 @getch()
store i32 %4, i32* %2
%5 = call i32 (...) @restore_terminal()
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @getch() {
%1 = tail call i32 @termnoecho(i32 1)
%2 = tail call i32 @getch()
%3 = tail call i32 (...) @restore_terminal()
ret i32 undef
}
int NFDi_IsFilterSegmentChar(char ch) {
  return (ch == ',' || ch == ';' || ch == '\0');
}


x86 assembly (clang, -O0):
<NFDi_IsFilterSegmentChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     113b <NFDi_IsFilterSegmentChar+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3b,%ecx
mov    %al,-0x2(%rbp)
je     113b <NFDi_IsFilterSegmentChar+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NFDi_IsFilterSegmentChar>:
mov    $0x1,%eax
cmp    $0x2c,%dil
je     1111 <NFDi_IsFilterSegmentChar+0x11>
cmp    $0x3b,%dil
jne    1112 <NFDi_IsFilterSegmentChar+0x12>
ret
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @NFDi_IsFilterSegmentChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 44
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 59
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @NFDi_IsFilterSegmentChar(i8 signext %0) {
switch i8 %0, label %2 [
i8 59, label %5
i8 44, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printData(int *pData, int count) {
  int i;
  for (i = 0; i < count; i++) {
    printf("data[%d] = %d\n", i, pData[i]);
  }
}


x86 assembly (clang, -O0):
<printData>:
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    115a <printData+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printData+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"data[%d] = %d\0A\00"
define void @printData(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int quick_usage(const char *path) {
  fprintf(stderr, "Try \"%s -h\" for more information.\n", path);
  return 2;
}


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

x86 assembly (clang, -O2):
<quick_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Try \22%s -h\22 for more information.\0A\00"
define i32 @quick_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Try \22%s -h\22 for more information.\0A\00"
define i32 @quick_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void uint32Copy(uint32_t *dst, const uint32_t *src) {
  assert(dst != NULL);
  assert(src != NULL);
  *dst = *src;
}


x86 assembly (clang, -O0):
<uint32Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32Copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @uint32Copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @uint32Copy(i32* writeonly %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBDevConnect(uint32_t ui32Base) {
  ;
  (*((volatile unsigned char *)(ui32Base + 0x00000001))) |= 0x00000040;
}


x86 assembly (clang, -O0):
<USBDevConnect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
movzbl %cl,%ecx
or     $0x40,%ecx
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevConnect>:
orb    $0x40,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBDevConnect(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %7, 64
%9 = trunc i32 %8 to i8
store volatile i8 %9, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBDevConnect(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
%5 = or i8 %4, 64
store volatile i8 %5, i8* %3
ret void
}
int lower_one_mask(int n) {
  int w = sizeof(int) << 3;
  return (unsigned)-1 >> (w - n);
}


x86 assembly (clang, -O0):
<lower_one_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_one_mask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @lower_one_mask(i32 %0) {
%2 = sub nsw i32 32, %0
%3 = lshr i32 -1, %2
ret i32 %3
}
int test_imm_83int16_reg(short val) {
  return ((val) & (0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x83,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_83int16_reg(i16 signext %0) {
%2 = and i16 %0, 131
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_peer_to_string() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_peer_to_string"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_peer_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [42 x i8] c"NOT IMPLEMENTED:pa_socket_peer_to_string\0A\00"
define i32 @pa_socket_peer_to_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_socket_peer_to_string\00"
define i32 @pa_socket_peer_to_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}