xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int random_linear_product_system(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc(113, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<random_linear_product_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x71,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_linear_product_system>:
mov    $0x71,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @random_linear_product_system() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 113, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @random_linear_product_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 113, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void X11_GetDefaultAccel(int *pscale, int *pthresh) {
  *pscale = 3;
  *pthresh = 5;
}


x86 assembly (clang, -O0):
<X11_GetDefaultAccel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<X11_GetDefaultAccel>:
movl   $0x3,(%rdi)
movl   $0x5,(%rsi)
ret

LLVM IR (-O0):
define void @X11_GetDefaultAccel(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
store i32 3, i32* %5
%6 = load i32*, i32** %4
store i32 5, i32* %6
ret void
}

LLVM IR (-O2):
define void @X11_GetDefaultAccel(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 3, i32* %0
store i32 5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mvdisk(int /*<<< orphan*/, int, int, int);
int main() {
  mvdisk(0, 2, 1, 15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0xf,%ecx
call   1030 <mvdisk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mvdisk(i32 0, i32 2, i32 1, i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_stop(int sig) { printf("STOP\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"STOP\0A\00"
define void @catch_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"STOP\00"
define void @catch_stop(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double fmod(double, double);
double n180to180(double angle) {
  angle = fmod(angle, 360.0);
  if (angle > 180.0)
    angle += -360.0;
  else if (angle <= -180.0)
    angle += 360;
  return angle;
}


x86 assembly (clang, -O0):
<n180to180>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1162 <n180to180+0x52>
movsd  0xec5(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118c <n180to180+0x7c>
movsd  0xea6(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1187 <n180to180+0x77>
movsd  0xe8b(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118c <n180to180+0x7c>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n180to180>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
ucomisd 0xee2(%rip),%xmm0
jbe    1132 <n180to180+0x22>
addsd  0xee8(%rip),%xmm0
pop    %rax
ret
movsd  0xed6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     1148 <n180to180+0x38>
addsd  0xeb8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @n180to180(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fmod(double %3, double 3.600000e+02)
store double %4, double* %2
%5 = load double, double* %2
%6 = fcmp ogt double %5, 1.800000e+02
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fadd double %8, -3.600000e+02
store double %9, double* %2
br label %17
10: ; preds = %1
%11 = load double, double* %2
%12 = fcmp ole double %11, -1.800000e+02
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %2
%15 = fadd double %14, 3.600000e+02
store double %15, double* %2
br label %16
16: ; preds = %13, %10
br label %17
17: ; preds = %16, %7
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @n180to180(double %0) {
%2 = tail call double @fmod(double %0, double 3.600000e+02)
%3 = fcmp ogt double %2, 1.800000e+02
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = fadd double %2, -3.600000e+02
br label %10
6: ; preds = %1
%7 = fcmp ugt double %2, -1.800000e+02
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = fadd double %2, 3.600000e+02
br label %10
10: ; preds = %6, %8, %4
%11 = phi double [ %5, %4 ], [ %9, %8 ], [ %2, %6 ]
ret double %11
}
/* Variables and functions */
int INT_MIN;
int test1(int x) { return ~(x ^ INT_MIN); }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
xor    (%rcx),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    (%rcx),%eax
not    %eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @INT_MIN
%5 = xor i32 %3, %4
%6 = xor i32 %5, -1
ret i32 %6
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test1(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = xor i32 %2, %0
%4 = xor i32 %3, -1
ret i32 %4
}
void deselect_chip() { *((unsigned volatile long *)0x70200004) |= (1 << 1); }


x86 assembly (clang, -O0):
<deselect_chip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<deselect_chip>:
orq    $0x2,0x70200004
70 02
ret

LLVM IR (-O0):
define void @deselect_chip() {
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}

LLVM IR (-O2):
define void @deselect_chip() {
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This is a sandbox user program. You can use it for testing and "
         "experiments in userspace. Don't commit any useful kernel tests here, "
         "please place them in utest program.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"This is a sandbox user program. You can use it for testing and experiments in userspace. Don't commit any useful kernel tests here, please place them in utest program.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [168 x i8] c"This is a sandbox user program. You can use it for testing and experiments in userspace. Don't commit any useful kernel tests here, please place them in utest program.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int string_purge_candidate(void *entry_ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @string_purge_candidate(i8* nocapture readnone %0) {
ret i32 0
}
void read_barrier() { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @read_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_D8uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xD8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D8uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 927712935936
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ asprintf(char **, char *, int /*<<< orphan*/);
int /*<<< orphan*/ login_name();
int /*<<< orphan*/ system_error(char *);
const char *server_socket_name() {
  char *name;
  if (asprintf(&name, "/tmp/spdsend-server.%s", login_name()) < 0)
    system_error("memory allocation");
  return name;
}


x86 assembly (clang, -O0):
<server_socket_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <login_name@plt>
mov    %eax,%edx
lea    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0x0,%rax
jge    1167 <server_socket_name+0x37>
lea    0xeb5(%rip),%rdi
call   1040 <system_error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_socket_name>:
push   %rax
xor    %eax,%eax
call   1050 <login_name@plt>
lea    0xec1(%rip),%rsi
mov    %rsp,%rdi
mov    %eax,%edx
call   1030 <asprintf@plt>
test   %rax,%rax
jns    115a <server_socket_name+0x2a>
lea    0xec2(%rip),%rdi
call   1040 <system_error@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/tmp/spdsend-server.%s\00"
@.str.1 = [18 x i8] c"memory allocation\00"
define i8* @server_socket_name() {
%1 = alloca i8*
%2 = call i32 (...) @login_name()
%3 = call i64 @asprintf(i8** %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @system_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [23 x i8] c"/tmp/spdsend-server.%s\00"
@.str.1 = [18 x i8] c"memory allocation\00"
define i8* @server_socket_name() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i32 (...) @login_name()
%4 = call i64 @asprintf(i8** %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @system_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i8*, i8** %1
ret i8* %9
}
int builtin_env(int argc, const char **argv, char **env) {}


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

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

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

LLVM IR (-O2):
define i32 @builtin_env(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 undef
}
int tls13_client_certificate_send(struct tls13_ctx *ctx) { return 1; }


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

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

LLVM IR (-O0):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_send(%struct.tls13_ctx* %0) {
%2 = alloca %struct.tls13_ctx*
store %struct.tls13_ctx* %0, %struct.tls13_ctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ do_daemons(int /*<<< orphan*/);
int /*<<< orphan*/ do_fuses(int /*<<< orphan*/);
int /*<<< orphan*/ spread(int);
void waste_time() {
  do_daemons(spread(1));
  do_fuses(spread(1));
  do_daemons(spread(2));
  do_fuses(spread(2));
}


x86 assembly (clang, -O0):
<waste_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <spread@plt>
mov    %eax,%edi
call   1030 <do_daemons@plt>
mov    $0x1,%edi
call   1050 <spread@plt>
mov    %eax,%edi
call   1040 <do_fuses@plt>
mov    $0x2,%edi
call   1050 <spread@plt>
mov    %eax,%edi
call   1030 <do_daemons@plt>
mov    $0x2,%edi
call   1050 <spread@plt>
mov    %eax,%edi
call   1040 <do_fuses@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waste_time>:
push   %rax
mov    $0x1,%edi
call   1050 <spread@plt>
mov    %eax,%edi
call   1030 <do_daemons@plt>
mov    $0x1,%edi
call   1050 <spread@plt>
mov    %eax,%edi
call   1040 <do_fuses@plt>
mov    $0x2,%edi
call   1050 <spread@plt>
mov    %eax,%edi
call   1030 <do_daemons@plt>
mov    $0x2,%edi
call   1050 <spread@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <do_fuses@plt>

LLVM IR (-O0):
define void @waste_time() {
%1 = call i32 @spread(i32 1)
%2 = call i32 @do_daemons(i32 %1)
%3 = call i32 @spread(i32 1)
%4 = call i32 @do_fuses(i32 %3)
%5 = call i32 @spread(i32 2)
%6 = call i32 @do_daemons(i32 %5)
%7 = call i32 @spread(i32 2)
%8 = call i32 @do_fuses(i32 %7)
ret void
}

LLVM IR (-O2):
define void @waste_time() {
%1 = tail call i32 @spread(i32 1)
%2 = tail call i32 @do_daemons(i32 %1)
%3 = tail call i32 @spread(i32 1)
%4 = tail call i32 @do_fuses(i32 %3)
%5 = tail call i32 @spread(i32 2)
%6 = tail call i32 @do_daemons(i32 %5)
%7 = tail call i32 @spread(i32 2)
%8 = tail call i32 @do_fuses(i32 %7)
ret void
}
/* Variables and functions */
int DI_Internal_Set_Clk(int /*<<< orphan*/);
int di_internal_clk_disable(void) { return DI_Internal_Set_Clk(0); }


x86 assembly (clang, -O0):
<di_internal_clk_disable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <DI_Internal_Set_Clk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<di_internal_clk_disable>:
xor    %edi,%edi
jmp    1030 <DI_Internal_Set_Clk@plt>

LLVM IR (-O0):
define i32 @di_internal_clk_disable() {
%1 = call i32 @DI_Internal_Set_Clk(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @di_internal_clk_disable() {
%1 = tail call i32 @DI_Internal_Set_Clk(i32 0)
ret i32 %1
}
int test_imm_F7int8_reg(signed char val) {
  return ((val) & (-0xF7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F7int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -247
%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_F7int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -247
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long int opt_numint_gcd2(long long int a, long long int b) {
  while (b != 0 && a != b) {
    long long int tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<opt_numint_gcd2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     112a <opt_numint_gcd2+0x2a>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    113a <opt_numint_gcd2+0x3a>
jmp    115d <opt_numint_gcd2+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <opt_numint_gcd2+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_numint_gcd2>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1145 <opt_numint_gcd2+0x45>
mov    %rsi,%rdx
cmp    %rsi,%rax
jne    112d <opt_numint_gcd2+0x2d>
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <opt_numint_gcd2+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <opt_numint_gcd2+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <opt_numint_gcd2+0x25>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @opt_numint_gcd2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = icmp ne i64 %10, %11
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ false, %6 ], [ %12, %9 ]
br i1 %14, label %15, label %21
15: ; preds = %13
%16 = load i64, i64* %4
store i64 %16, i64* %5
%17 = load i64, i64* %3
%18 = load i64, i64* %4
%19 = srem i64 %17, %18
store i64 %19, i64* %4
%20 = load i64, i64* %5
store i64 %20, i64* %3
br label %6
21: ; preds = %13
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @opt_numint_gcd2(i64 %0, i64 %1) {
%3 = icmp ne i64 %1, 0
%4 = icmp ne i64 %0, %1
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i64 [ %8, %6 ], [ %0, %2 ]
%8 = phi i64 [ %9, %6 ], [ %1, %2 ]
%9 = srem i64 %7, %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = phi i64 [ %0, %2 ], [ %8, %6 ]
ret i64 %12
}
/* Variables and functions */
int i2cslave_Listen(int);
unsigned i2c1slave_Listen(void) { return i2cslave_Listen(1); }


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

x86 assembly (clang, -O2):
<i2c1slave_Listen>:
mov    $0x1,%edi
jmp    1030 <i2cslave_Listen@plt>

LLVM IR (-O0):
define i32 @i2c1slave_Listen() {
%1 = call i32 @i2cslave_Listen(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c1slave_Listen() {
%1 = tail call i32 @i2cslave_Listen(i32 1)
ret i32 %1
}
/* Type definitions */
struct lineFile {
  int dummy;
};

/* Variables and functions */
struct lineFile *netLineFileMayOpen(char *);
int /*<<< orphan*/ noWarnAbort();
struct lineFile *netLineFileOpen(char *url) {
  struct lineFile *lf = netLineFileMayOpen(url);
  if (lf == NULL)
    noWarnAbort();
  return lf;
}


x86 assembly (clang, -O0):
<netLineFileOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <netLineFileMayOpen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <netLineFileOpen+0x2b>
mov    $0x0,%al
call   1030 <noWarnAbort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netLineFileOpen>:
push   %rbx
call   1040 <netLineFileMayOpen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <netLineFileOpen+0x15>
xor    %eax,%eax
call   1030 <noWarnAbort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.lineFile = type { i32 }
define %struct.lineFile* @netLineFileOpen(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.lineFile*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.lineFile* @netLineFileMayOpen(i8* %4)
store %struct.lineFile* %5, %struct.lineFile** %3
%6 = load %struct.lineFile*, %struct.lineFile** %3
%7 = icmp eq %struct.lineFile* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @noWarnAbort()
br label %10
10: ; preds = %8, %1
%11 = load %struct.lineFile*, %struct.lineFile** %3
ret %struct.lineFile* %11
}

LLVM IR (-O2):
%struct.lineFile = type { i32 }
define %struct.lineFile* @netLineFileOpen(i8* %0) {
%2 = tail call %struct.lineFile* @netLineFileMayOpen(i8* %0)
%3 = icmp eq %struct.lineFile* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @noWarnAbort()
br label %6
6: ; preds = %4, %1
ret %struct.lineFile* %2
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
typedef int /*<<< orphan*/ query;

/* Variables and functions */
char *sqlQuickString(struct sqlConnection *, char *);
int /*<<< orphan*/ sqlSafef(char *, int, char *, int);
char *visiGeneFixation(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select fixation.description from image,preparation,fixation "
           "where image.id = %d "
           "and image.preparation = preparation.id "
           "and preparation.fixation = fixation.id",
           id);
  return sqlQuickString(conn, query);
}


x86 assembly (clang, -O0):
<visiGeneFixation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x100,%esi
lea    0xeb8(%rip),%rdx
call   1040 <sqlSafef@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <sqlQuickString@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneFixation>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <sqlSafef@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sqlQuickString@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [158 x i8] c"select fixation.description from image,preparation,fixation where image.id = %d and image.preparation = preparation.id and preparation.fixation = fixation.id\00"
define i8* @visiGeneFixation(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
%5 = alloca [256 x i8]
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sqlSafef(i8* %6, i32 256, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i8* @sqlQuickString(%struct.sqlConnection* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [158 x i8] c"select fixation.description from image,preparation,fixation where image.id = %d and image.preparation = preparation.id and preparation.fixation = fixation.id\00"
define i8* @visiGeneFixation(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sqlSafef(i8* %4, i32 256, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i8* @sqlQuickString(%struct.sqlConnection* %0, i8* %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int);
int main() {
  test(10, 13);
  test(56, 101);
  test(1030, 10009);
  test(1032, 10009);
  test(44402, 100049);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0xd,%esi
call   1030 <test@plt>
mov    $0x38,%edi
mov    $0x65,%esi
call   1030 <test@plt>
mov    $0x406,%edi
mov    $0x2719,%esi
call   1030 <test@plt>
mov    $0x408,%edi
mov    $0x2719,%esi
call   1030 <test@plt>
mov    $0xad72,%edi
mov    $0x186d1,%esi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0xd,%esi
call   1030 <test@plt>
mov    $0x38,%edi
mov    $0x65,%esi
call   1030 <test@plt>
mov    $0x406,%edi
mov    $0x2719,%esi
call   1030 <test@plt>
mov    $0x408,%edi
mov    $0x2719,%esi
call   1030 <test@plt>
mov    $0xad72,%edi
mov    $0x186d1,%esi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 10, i32 13)
%3 = call i32 @test(i32 56, i32 101)
%4 = call i32 @test(i32 1030, i32 10009)
%5 = call i32 @test(i32 1032, i32 10009)
%6 = call i32 @test(i32 44402, i32 100049)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 10, i32 13)
%2 = tail call i32 @test(i32 56, i32 101)
%3 = tail call i32 @test(i32 1030, i32 10009)
%4 = tail call i32 @test(i32 1032, i32 10009)
%5 = tail call i32 @test(i32 44402, i32 100049)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int __int8_t_decode_array(const void *_buf, int offset, int maxlen, int8_t *p,
                          int elements) {
  if (maxlen < elements)
    return -1;
  const int8_t *buf = (const int8_t *)_buf;
  memcpy(p, &buf[offset], elements);
  return elements;
}


x86 assembly (clang, -O0):
<__int8_t_decode_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1142 <__int8_t_decode_array+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <__int8_t_decode_array+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int8_t_decode_array>:
mov    $0xffffffff,%eax
cmp    %r8d,%edx
jl     1133 <__int8_t_decode_array+0x23>
push   %rbx
mov    %r8d,%ebx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rsi
mov    %rcx,%rdi
mov    %r8d,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__int8_t_decode_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32 %4, i32* %11
%13 = load i32, i32* %9
%14 = load i32, i32* %11
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %5
store i32 -1, i32* %6
br label %28
17: ; preds = %5
%18 = load i8*, i8** %7
%19 = bitcast i8* %18 to i32*
store i32* %19, i32** %12
%20 = load i32*, i32** %10
%21 = load i32*, i32** %12
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %11
%26 = call i32 @memcpy(i32* %20, i32* %24, i32 %25)
%27 = load i32, i32* %11
store i32 %27, i32* %6
br label %28
28: ; preds = %17, %16
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @__int8_t_decode_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = icmp slt i32 %2, %4
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = bitcast i8* %0 to i32*
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = tail call i32 @memcpy(i32* %3, i32* %10, i32 %4)
br label %12
12: ; preds = %5, %7
%13 = phi i32 [ %4, %7 ], [ -1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("Hello world, in libhello\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Hello world, in libhello\0A\00"
define void @say_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Hello world, in libhello\00"
define void @say_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
int tst_bit(const unsigned short bit, int off) {
  unsigned short mask = 1;
  if (off > 15 || off < 0)
    return -1;
  mask <<= off;
  if ((bit & mask) == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<tst_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
mov    %esi,-0xc(%rbp)
movw   $0x1,-0xe(%rbp)
cmpl   $0xf,-0xc(%rbp)
jg     1128 <tst_bit+0x28>
cmpl   $0x0,-0xc(%rbp)
jge    1134 <tst_bit+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <tst_bit+0x67>
mov    -0xc(%rbp),%ecx
movzwl -0xe(%rbp),%eax
shl    %cl,%eax
mov    %ax,-0xe(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0xe(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1160 <tst_bit+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1167 <tst_bit+0x67>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_bit>:
mov    %esi,%ecx
shr    %cl,%edi
and    $0x1,%edi
cmp    $0x10,%esi
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @tst_bit(i16 zeroext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
%6 = alloca i16
store i16 %0, i16* %4
store i32 %1, i32* %5
store i16 1, i16* %6
%7 = load i32, i32* %5
%8 = icmp sgt i32 %7, 15
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9, %2
store i32 -1, i32* %3
br label %27
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = shl i32 %16, %14
%18 = trunc i32 %17 to i16
store i16 %18, i16* %6
%19 = load i16, i16* %4
%20 = zext i16 %19 to i32
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = and i32 %20, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %13
store i32 0, i32* %3
br label %27
26: ; preds = %13
store i32 1, i32* %3
br label %27
27: ; preds = %26, %25, %12
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @tst_bit(i16 zeroext %0, i32 %1) {
%3 = icmp ugt i32 %1, 15
%4 = zext i16 %0 to i32
%5 = lshr i32 %4, %1
%6 = and i32 %5, 1
%7 = select i1 %3, i32 -1, i32 %6
ret i32 %7
}
int base64expansion(int len) { return (len / 3 + (len % 3 != 0)) * 4; }


x86 assembly (clang, -O0):
<base64expansion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64expansion>:
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
imul   $0xaaaaaaab,%ecx,%ecx
add    $0x2aaaaaaa,%ecx
cmp    $0x55555555,%ecx
sbb    $0xffffffff,%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @base64expansion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 3
%5 = load i32, i32* %2
%6 = srem i32 %5, 3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %4, %8
%10 = mul nsw i32 %9, 4
ret i32 %10
}

LLVM IR (-O2):
define i32 @base64expansion(i32 %0) {
%2 = sdiv i32 %0, 3
%3 = srem i32 %0, 3
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
%7 = shl nsw i32 %6, 2
ret i32 %7
}
int ft_word_len(char const *s, char c) {
  int len;
  len = 0;
  while (*s && *s != c) {
    len++;
    s++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_word_len>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     113d <ft_word_len+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114d <ft_word_len+0x4d>
jmp    1167 <ft_word_len+0x67>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <ft_word_len+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_word_len>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <ft_word_len+0x22>
cmp    %sil,%cl
je     1122 <ft_word_len+0x22>
xor    %eax,%eax
nop
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1122 <ft_word_len+0x22>
cmp    %sil,%cl
jne    1110 <ft_word_len+0x10>
ret

LLVM IR (-O0):
define i32 @ft_word_len(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %14, %16
br label %18
18: ; preds = %11, %6
%19 = phi i1 [ false, %6 ], [ %17, %11 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %6
25: ; preds = %18
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @ft_word_len(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = icmp eq i8 %3, %1
%6 = or i1 %4, %5
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = phi i8* [ %11, %7 ], [ %0, %2 ]
%10 = add nuw nsw i32 %8, 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = icmp eq i8 %12, %1
%15 = or i1 %13, %14
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %10, %7 ]
ret i32 %17
}
void SSMR3HandleReportLivePercent(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleReportLivePercent() {
ret void
}
int main(void) {
  5 >> 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;

/* Variables and functions */
int X509_NAME_cmp(int /*<<< orphan*/ const *const,
                  int /*<<< orphan*/ const *const);
int ca_dn_cmp(const X509_NAME *const *a, const X509_NAME *const *b) {
  return (X509_NAME_cmp(*a, *b));
}


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

x86 assembly (clang, -O2):
<ca_dn_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <X509_NAME_cmp@plt>

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

LLVM IR (-O2):
define i32 @ca_dn_cmp(i32** nocapture %0, i32** nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32*, i32** %1
%5 = tail call i32 @X509_NAME_cmp(i32* %3, i32* %4)
ret i32 %5
}
void nil() {}


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

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

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

LLVM IR (-O2):
define void @nil() {
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void itimeofday(long *sec, long *usec) {
  struct timeval time;
  gettimeofday(&time, NULL);
  if (sec)
    *sec = time.tv_sec;
  if (usec)
    *usec = time.tv_usec;
}


x86 assembly (clang, -O0):
<itimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmpq   $0x0,-0x8(%rbp)
je     1143 <itimeofday+0x33>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     1159 <itimeofday+0x49>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itimeofday>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rbx,%rbx
je     1136 <itimeofday+0x26>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
test   %r14,%r14
je     1143 <itimeofday+0x33>
mov    0x10(%rsp),%rax
mov    %rax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @itimeofday(i64* writeonly %0, i64* writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = icmp eq i64* %0, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%9 = load i64, i64* %8
store i64 %9, i64* %0
br label %10
10: ; preds = %7, %2
%11 = icmp eq i64* %1, null
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%14 = load i64, i64* %13
store i64 %14, i64* %1
br label %15
15: ; preds = %12, %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
void lang_skipLine(FILE *lang_in) {
  char c;
  c = fgetc(lang_in);
  while (c != '\n' && c != EOF) {
    c = fgetc(lang_in);
  }
}


x86 assembly (clang, -O0):
<lang_skipLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xa(%rbp)
je     1150 <lang_skipLine+0x40>
movsbl -0x9(%rbp),%eax
mov    0x2ea3(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1160 <lang_skipLine+0x50>
jmp    1171 <lang_skipLine+0x61>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
jmp    1128 <lang_skipLine+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lang_skipLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     1141 <lang_skipLine+0x31>
mov    0x2ec1(%rip),%r14
nopw   0x0(%rax,%rax,1)
cmp    (%r14),%al
je     1141 <lang_skipLine+0x31>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1130 <lang_skipLine+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @lang_skipLine(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
store i8 %5, i8* %3
br label %6
6: ; preds = %18, %1
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i8, i8* @EOF
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %12, %14
br label %16
16: ; preds = %10, %6
%17 = phi i1 [ false, %6 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i32*, i32** %2
%20 = call signext i8 @fgetc(i32* %19)
store i8 %20, i8* %3
br label %6
21: ; preds = %16
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @lang_skipLine(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = icmp ne i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp ne i8 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = tail call signext i8 @fgetc(i32* %0)
%9 = icmp ne i8 %8, 10
%10 = load i8, i8* @EOF
%11 = icmp ne i8 %8, %10
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
int isZero(int x) { return !(x ^ 0); }


x86 assembly (clang, -O0):
<isZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x0,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isZero>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isZero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 0
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isZero(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void sgdt(void *ptr) { __asm__ __volatile__("sgdt (%0)" : : "r"(ptr)); }


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

x86 assembly (clang, -O2):
<sgdt>:
sgdt   (%rdi)
ret

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

LLVM IR (-O2):
define void @sgdt(i8* %0) {
tail call void asm sideeffect "sgdt ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
struct x11_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
void x11_map_window(int sock, struct x11_connection *conn, uint32_t id) {
  uint32_t packet[2];
  packet[0] = 0x08 | 2 << 16;
  packet[1] = id;
  write(sock, packet, 8);
  return;
  (void)conn;
}


x86 assembly (clang, -O0):
<x11_map_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x20008,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1c(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x11_map_window>:
push   %rax
movl   $0x20008,(%rsp)
mov    %edx,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.x11_connection = type { i32 }
define void @x11_map_window(i32 %0, %struct.x11_connection* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.x11_connection*
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 %0, i32* %4
store %struct.x11_connection* %1, %struct.x11_connection** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 131080, i32* %8
%9 = load i32, i32* %6
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%13 = call i32 @write(i32 %11, i32* %12, i32 8)
ret void
}

LLVM IR (-O2):
%struct.x11_connection = type { i32 }
define void @x11_map_window(i32 %0, %struct.x11_connection* nocapture readnone %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 131080, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %2, i32* %7
%8 = call i32 @write(i32 %0, i32* %6, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i;
  int a = 3;
  for (i = 0; i < 5; i++) {
    __print_int(a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 3)
%2 = tail call i32 @__print_int(i32 3)
%3 = tail call i32 @__print_int(i32 3)
%4 = tail call i32 @__print_int(i32 3)
%5 = tail call i32 @__print_int(i32 3)
ret i32 0
}