xunge/DecIR huggingface dataset:
char *b32ton(char *data, unsigned int val) {
  data[0] = val >> 24;
  data[1] = val >> 16;
  data[2] = val >> 8;
  data[3] = val & 0xff;
  return data + 4;
}


x86 assembly (clang, -O0):
<b32ton>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b32ton>:
bswap  %esi
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @b32ton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = lshr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 3
store i8 %22, i8* %24
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 4
ret i8* %26
}

LLVM IR (-O2):
define i8* @b32ton(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %13
}
/* Variables and functions */
size_t get_grid_point_double_mesh(int const *, int const *);
size_t kgd_get_dense_grid_point_double_mesh(const int address_double[3],
                                            const int mesh[3]) {
  return get_grid_point_double_mesh(address_double, mesh);
}


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

x86 assembly (clang, -O2):
<kgd_get_dense_grid_point_double_mesh>:
jmp    1030 <get_grid_point_double_mesh@plt>

LLVM IR (-O0):
define i64 @kgd_get_dense_grid_point_double_mesh(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 = load i32*, i32** %4
%7 = call i64 @get_grid_point_double_mesh(i32* %5, i32* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @kgd_get_dense_grid_point_double_mesh(i32* %0, i32* %1) {
%3 = tail call i64 @get_grid_point_double_mesh(i32* %0, i32* %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc4() {
  Assert_real((islower(196) == 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_islower.c",
              985, ("islower should be 0 for 0xc4"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xc4>:
push   %rax
mov    $0xc4,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d9,%edx
pop    %rax
jmp    1040 <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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc4\00"
define void @t_islower_0xc4() {
%1 = call i64 @islower(i32 196)
%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 985, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc4\00"
define void @t_islower_0xc4() {
%1 = tail call i64 @islower(i32 196)
%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 985, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("Type an integer: ");
  scanf("%d", &number);
  printf("The number you typed was %d.\n", number);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Type an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"The number you typed was %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Type an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"The number you typed was %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ displayBits(unsigned int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int /*<<< orphan*/ stdin;
int main() {
  unsigned x;
  printf("Enter an unsigned number: ");
  scanf("%u", &x);
  fflush(stdin);
  displayBits(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%edi
call   1060 <displayBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x4(%rsp),%edi
call   1060 <displayBits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter an unsigned number: \00"
@.str.1 = [3 x i8] c"%u\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @displayBits(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter an unsigned number: \00"
@.str.1 = [3 x i8] c"%u\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @displayBits(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int syscall(int, char *, int /*<<< orphan*/);
int chname() {
  char s[64];
  printf("input new name : ");
  gets(s);
  return syscall(2, s, 0);
}


x86 assembly (clang, -O0):
<chname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x40(%rbp),%rsi
mov    $0x2,%edi
xor    %edx,%edx
call   1040 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chname>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <syscall@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"input new name : \00"
define i32 @chname() {
%1 = alloca [64 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%6 = call i32 @syscall(i32 2, i8* %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"input new name : \00"
define i32 @chname() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @syscall(i32 2, i8* %2, i32 0)
ret i32 %5
}
int func(char a, char b, char c) { int y; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @func(i8 signext %0, i8 signext %1, i8 signext %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ERRORprint2(int, int, int);
void ERRORprint3(int line) { ERRORprint2(0x0, 0x0, line); }


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

x86 assembly (clang, -O2):
<ERRORprint3>:
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <ERRORprint2@plt>

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

LLVM IR (-O2):
define void @ERRORprint3(i32 %0) {
%2 = tail call i32 @ERRORprint2(i32 0, i32 0, i32 %0)
ret void
}
/* Variables and functions */
double dcall(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ pass(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ stdout;
main() {
  double d1, d2, d3;
  int i;
  d1 = dcall(1.);
  printf("d1 = %e\n", d1);
  pass("double [OKI001]");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
call   1030 <dcall@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1040 <pass@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <dcall@plt>
lea    0xeae(%rip),%rdi
call   1050 <printf@plt>
lea    0xeab(%rip),%rdi
call   1040 <pass@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"d1 = %e\0A\00"
@.str.1 = [16 x i8] c"double [OKI001]\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = call double @dcall(i32 1)
store double %5, double* %1
%6 = load double, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call i32 @pass(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"d1 = %e\0A\00"
@.str.1 = [16 x i8] c"double [OKI001]\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call double @dcall(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call i32 @pass(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LINE;
int /*<<< orphan*/ glColor3f(float, float, float);
int /*<<< orphan*/ glLineWidth(int);
int /*<<< orphan*/ glPolygonMode(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glutSolidCube(double);
void DrawObject2(void) {
  glColor3f(1.0f, 0.2f, 0.2f);
  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
  glLineWidth(4);
  glutSolidCube(2.0);
}


x86 assembly (clang, -O0):
<DrawObject2>:
push   %rbp
mov    %rsp,%rbp
movss  0xebc(%rip),%xmm0
movss  0xeb8(%rip),%xmm2
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
call   1060 <glPolygonMode@plt>
mov    $0x4,%edi
call   1030 <glLineWidth@plt>
movsd  0xe7b(%rip),%xmm0
call   1040 <glutSolidCube@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawObject2>:
push   %rax
movss  0xeb7(%rip),%xmm0
movss  0xeb3(%rip),%xmm1
movaps %xmm1,%xmm2
call   1050 <glColor3f@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1060 <glPolygonMode@plt>
mov    $0x4,%edi
call   1030 <glLineWidth@plt>
movsd  0xe86(%rip),%xmm0
pop    %rax
jmp    1040 <glutSolidCube@plt>

LLVM IR (-O0):
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
define void @DrawObject2() {
%1 = call i32 @glColor3f(float 1.000000e+00, float 0x3FC99999A0000000, float 0x3FC99999A0000000)
%2 = load i32, i32* @GL_FRONT_AND_BACK
%3 = load i32, i32* @GL_LINE
%4 = call i32 @glPolygonMode(i32 %2, i32 %3)
%5 = call i32 @glLineWidth(i32 4)
%6 = call i32 @glutSolidCube(double 2.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
define void @DrawObject2() {
%1 = tail call i32 @glColor3f(float 1.000000e+00, float 0x3FC99999A0000000, float 0x3FC99999A0000000)
%2 = load i32, i32* @GL_FRONT_AND_BACK
%3 = load i32, i32* @GL_LINE
%4 = tail call i32 @glPolygonMode(i32 %2, i32 %3)
%5 = tail call i32 @glLineWidth(i32 4)
%6 = tail call i32 @glutSolidCube(double 2.000000e+00)
ret void
}
/* Variables and functions */
int scsi_request(char *, int /*<<< orphan*/, int /*<<< orphan*/, int,
                 int /*<<< orphan*/, int, int, int /*<<< orphan*/,
                 int /*<<< orphan*/, int /*<<< orphan*/, int,
                 int /*<<< orphan*/);
int set_removable(int removable) {
  return scsi_request("set_removable", 0, 0, 6, 0, 0x02, 0x1E, 0, 0, 0,
                      (removable ? 0 : 1), 0);
}


x86 assembly (clang, -O0):
<set_removable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xece(%rip),%rdi
xor    %r8d,%r8d
mov    $0x6,%ecx
mov    $0x2,%r9d
mov    %r8d,%esi
mov    %r8d,%edx
movl   $0x1e,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %eax,0x20(%rsp)
movl   $0x0,0x28(%rsp)
call   1030 <scsi_request@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_removable>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0xee1(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x6,%ecx
xor    %r8d,%r8d
mov    $0x2,%r9d
push   $0x0
push   %rax
push   $0x0
push   $0x0
push   $0x0
push   $0x1e
call   1030 <scsi_request@plt>
add    $0x30,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"set_removable\00"
define i32 @set_removable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 0, i32 1
%7 = call i32 @scsi_request(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 6, i32 0, i32 2, i32 30, i32 0, i32 0, i32 0, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"set_removable\00"
define i32 @set_removable(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @scsi_request(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 6, i32 0, i32 2, i32 30, i32 0, i32 0, i32 0, i32 %3, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fooA(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x;
  printf("the address of x is: %p\n", &x);
  fooA(&x);
  printf("the value of x is: %d\n", x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"the address of x is: %p\0A\00"
@.str.1 = [23 x i8] c"the value of x is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = call i32 @fooA(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"the address of x is: %p\0A\00"
@.str.1 = [23 x i8] c"the value of x is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @fooA(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time(void) {
  struct timeval curr;
  gettimeofday(&curr, NULL);
  return (curr.tv_sec + curr.tv_usec / 1e6);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
unsigned xrop3_192_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T & S;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_192_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
struct blk_zone_report {
  int dummy;
};

/* Variables and functions */
struct blk_zone_report *blkdev_get_zonereport(int fd, uint64_t sector,
                                              uint32_t nzones) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.blk_zone_report = type { i32 }
define %struct.blk_zone_report* @blkdev_get_zonereport(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret %struct.blk_zone_report* null
}

LLVM IR (-O2):
%struct.blk_zone_report = type { i32 }
define noalias %struct.blk_zone_report* @blkdev_get_zonereport(i32 %0, i32 %1, i32 %2) {
ret %struct.blk_zone_report* null
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmap_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xmap.window = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmap_window>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xmap_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void test_assert() {
  (__builtin_expect(!(0 && "unreachable"), 0)
       ? __myassert_rtn(
             __func__,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/Bootz/multicore-opimization/refs/heads/"
             "master/llvm/tools/clang/test/Sema/warn-unreachable.c",
             124, "0 && \"unreachable\"")
       : (void)0);
  return;
}


x86 assembly (clang, -O0):
<test_assert>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x7c,%edx
lea    0xf94(%rip),%rcx
mov    $0x0,%al
call   1030 <__myassert_rtn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf9d(%rip),%rcx
mov    $0x7c,%edx
xor    %eax,%eax
jmp    1030 <__myassert_rtn@plt>

LLVM IR (-O0):
@__func__.test_assert = [12 x i8] c"test_assert\00"
@.str = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Bootz/multicore-opimization/refs/heads/master/llvm/tools/clang/test/Sema/warn-unreachable.c\00"
@.str.1 = [19 x i8] c"0 && \22unreachable\22\00"
define void @test_assert() {
%1 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__myassert_rtn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.test_assert, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.test_assert = [12 x i8] c"test_assert\00"
@.str = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Bootz/multicore-opimization/refs/heads/master/llvm/tools/clang/test/Sema/warn-unreachable.c\00"
@.str.1 = [19 x i8] c"0 && \22unreachable\22\00"
define void @test_assert() {
%1 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__myassert_rtn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.test_assert, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c -= 'A' + 'a';
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1126 <ft_tolower+0x26>
cmpl   $0x5a,-0x4(%rbp)
jg     1126 <ft_tolower+0x26>
mov    -0x4(%rbp),%eax
sub    $0xa2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    -0xa2(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -162
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("x(x >= 0):");
  scanf("%d", &x);
  if (x < 0) {
    exit(1);
  }
  printf("x = %d\n", x);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1171 <main+0x41>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jns    1162 <main+0x32>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"x(x >= 0):\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"x(x >= 0):\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%11 = call i32 @exit(i32 0)
unreachable
}
void setup_selinux(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_selinux() {
ret void
}
char rot13(char c, int min, int max, int mod) {
  char temp = c + 13;
  if ((int)c + 13 > max) {
    temp = (char)(min + ((int)c + 12 - max));
  }
  return temp;
}


x86 assembly (clang, -O0):
<rot13>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xd,%eax
mov    %al,-0x11(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xd,%eax
cmp    -0xc(%rbp),%eax
jle    113f <rot13+0x3f>
mov    -0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
add    $0xc,%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot13>:
lea    0xd(%rdi),%ecx
add    %edi,%esi
sub    %edx,%esi
add    $0xc,%sil
cmp    %edx,%ecx
movzbl %sil,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @rot13(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, 13
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = add nsw i32 %15, 13
%17 = load i32, i32* %7
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %28
19: ; preds = %4
%20 = load i32, i32* %6
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 12
%24 = load i32, i32* %7
%25 = sub nsw i32 %23, %24
%26 = add nsw i32 %20, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %9
br label %28
28: ; preds = %19, %4
%29 = load i8, i8* %9
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @rot13(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i8 %0 to i32
%6 = add nsw i32 %5, 13
%7 = icmp sgt i32 %6, %2
%8 = add nsw i32 %5, 12
%9 = add i32 %8, %1
%10 = sub i32 %9, %2
%11 = select i1 %7, i32 %10, i32 %6
%12 = trunc i32 %11 to i8
ret i8 %12
}
/* Variables and functions */
int ILibInPlaceHTTPUnEscapeEx(char *, int);
scalar_t__ strlen(char *);
int ILibInPlaceHTTPUnEscape(char *data) {
  int length = (int)strlen(data);
  return ILibInPlaceHTTPUnEscapeEx(data, length);
}


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

x86 assembly (clang, -O2):
<ILibInPlaceHTTPUnEscape>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ILibInPlaceHTTPUnEscapeEx@plt>

LLVM IR (-O0):
define i32 @ILibInPlaceHTTPUnEscape(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = call i32 @ILibInPlaceHTTPUnEscapeEx(i8* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @ILibInPlaceHTTPUnEscape(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @ILibInPlaceHTTPUnEscapeEx(i8* %0, i32 %3)
ret i32 %4
}
void goto_sleep(delay) long delay;
{ usleep(delay); }


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

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

LLVM IR (-O0):
define void @goto_sleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 (i64, ...) bitcast (i32 (...)* @usleep to i32 (i64, ...)*)(i64 %3)
ret void
}

LLVM IR (-O2):
define void @goto_sleep(i64 %0) {
%2 = tail call i32 (i64, ...) bitcast (i32 (...)* @usleep to i32 (i64, ...)*)(i64 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ print_process_arg_list(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  pid_t pid = (pid_t)atoi(argv[1]);
  print_process_arg_list(pid);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <print_process_arg_list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @print_process_arg_list(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @print_process_arg_list(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void PRA_logMemoryError(const char *name) {
  printf("%s: out of memory.\n", name);
}


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

x86 assembly (clang, -O2):
<PRA_logMemoryError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%s: out of memory.\0A\00"
define void @PRA_logMemoryError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s: out of memory.\0A\00"
define void @PRA_logMemoryError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int foo(n, a)
int a[31][42];
int n;
{ return sizeof(a) + sizeof(a[14]) + n; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
add    $0xb0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xb0(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, [42 x i32]* %1) {
%3 = alloca i32
%4 = alloca [42 x i32]*
store i32 %0, i32* %3
store [42 x i32]* %1, [42 x i32]** %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = add i64 176, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0, [42 x i32]* nocapture readnone %1) {
%3 = add i32 %0, 176
ret i32 %3
}
/* Variables and functions */
int divideby3(int);
main() { return divideby3(6); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x6,%edi
jmp    1030 <divideby3@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @divideby3(i32 6)
ret i32 %1
}
int octiag_init() { return 1; }


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

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

LLVM IR (-O0):
define i32 @octiag_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @octiag_init() {
ret i32 1
}
int priority(char c) {
  switch (c) {
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
    return 2;
  case '$':
    return 3;
  case '^':
    return 4;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<priority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffdc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3a,%eax
ja     1164 <priority+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    116b <priority+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <priority+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <priority+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    116b <priority+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<priority>:
add    $0xffffffdc,%edi
cmp    $0x3a,%edi
ja     1129 <priority+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @priority(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 36, label %8
i32 94, label %9
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %11
7: ; preds = %1, %1
store i32 2, i32* %2
br label %11
8: ; preds = %1
store i32 3, i32* %2
br label %11
9: ; preds = %1
store i32 4, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @priority(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 43, label %7
i32 45, label %7
i32 42, label %3
i32 47, label %3
i32 36, label %4
i32 94, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 0, %6 ], [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ jlog(int, char *);
int /*<<< orphan*/ say(int, char *);
void err_time_readline(int fd) {
  jlog(2, "Timeout reached in readline()");
  say(fd, "500 Connection timed out\r\n");
}


x86 assembly (clang, -O0):
<err_time_readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
lea    0xec9(%rip),%rsi
call   1030 <jlog@plt>
mov    -0x4(%rbp),%edi
lea    0xed8(%rip),%rsi
call   1040 <say@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_time_readline>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
mov    $0x2,%edi
call   1030 <jlog@plt>
lea    0xee3(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <say@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Timeout reached in readline()\00"
@.str.1 = [27 x i8] c"500 Connection timed out\0D\0A\00"
define void @err_time_readline(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @jlog(i32 2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @say(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Timeout reached in readline()\00"
@.str.1 = [27 x i8] c"500 Connection timed out\0D\0A\00"
define void @err_time_readline(i32 %0) {
%2 = tail call i32 @jlog(i32 2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @say(i32 %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ismatch(char a, char b) { return a == b; }


x86 assembly (clang, -O0):
<ismatch>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismatch>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @ismatch(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ismatch(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
void *memalign(int, size_t);
int sysconf(int /*<<< orphan*/);
void *pvalloc(size_t size) {
  int page_size = sysconf(_SC_PAGESIZE);
  size /= page_size;
  size++;
  size *= page_size;
  return memalign(page_size, size);
}


x86 assembly (clang, -O0):
<pvalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movslq -0xc(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvalloc>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%edi
movslq %eax,%rcx
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     114d <pvalloc+0x2d>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
jmp    1153 <pvalloc+0x33>
mov    %ebx,%eax
xor    %edx,%edx
div    %edi
add    $0x1,%rax
imul   %rcx,%rax
mov    %rax,%rsi
pop    %rbx
jmp    1030 <memalign@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i8* @pvalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i32, i32* @_SC_PAGESIZE
%5 = call i32 @sysconf(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i64, i64* %2
%9 = udiv i64 %8, %7
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = add i64 %10, 1
store i64 %11, i64* %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = load i64, i64* %2
%15 = mul i64 %14, %13
store i64 %15, i64* %2
%16 = load i32, i32* %3
%17 = load i64, i64* %2
%18 = call i8* @memalign(i32 %16, i64 %17)
ret i8* %18
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define noalias i8* @pvalloc(i64 %0) {
%2 = load i32, i32* @_SC_PAGESIZE
%3 = tail call i32 @sysconf(i32 %2)
%4 = sext i32 %3 to i64
%5 = udiv i64 %0, %4
%6 = add i64 %5, 1
%7 = mul i64 %6, %4
%8 = tail call i8* @memalign(i32 %3, i64 %7)
ret i8* %8
}