xunge/DecIR huggingface dataset:
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  int value = getchar();
  printf("You entered '%c'\n", (char)value);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"You entered '%c'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"You entered '%c'\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = trunc i32 %1 to i8
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doubles_mat44_to_xyt(double *, double *);
int /*<<< orphan*/ doubles_quat_xyz_to_mat44(double const *, double const *,
                                             double *);
void doubles_quat_xyz_to_xyt(const double q[4], const double xyz[3],
                             double xyt[3]) {
  double M[16];
  doubles_quat_xyz_to_mat44(q, xyz, M);
  doubles_mat44_to_xyt(M, xyt);
}


x86 assembly (clang, -O0):
<doubles_quat_xyz_to_xyt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1030 <doubles_quat_xyz_to_mat44@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <doubles_mat44_to_xyt@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_quat_xyz_to_xyt>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdx,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1030 <doubles_quat_xyz_to_mat44@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <doubles_mat44_to_xyt@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @doubles_quat_xyz_to_xyt(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [16 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = load double*, double** %5
%10 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 0
%11 = call i32 @doubles_quat_xyz_to_mat44(double* %8, double* %9, double* %10)
%12 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 0
%13 = load double*, double** %6
%14 = call i32 @doubles_mat44_to_xyt(double* %12, double* %13)
ret void
}

LLVM IR (-O2):
define void @doubles_quat_xyz_to_xyt(double* %0, double* %1, double* %2) {
%4 = alloca [16 x double]
%5 = bitcast [16 x double]* %4 to i8*
%6 = getelementptr inbounds [16 x double], [16 x double]* %4, i64 0, i64 0
%7 = call i32 @doubles_quat_xyz_to_mat44(double* %0, double* %1, double* %6)
%8 = call i32 @doubles_mat44_to_xyt(double* %6, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2wcube(float, float, float, float, float, float);
void s2wcube_(float *xmin, float *xmax, float *ymin, float *ymax, float *zmin,
              float *zmax) {
  s2wcube(*xmin, *xmax, *ymin, *ymax, *zmin, *zmax);
}


x86 assembly (clang, -O0):
<s2wcube_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm3
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm4
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm5
call   1030 <s2wcube@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2wcube_>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  (%rdx),%xmm2
movss  (%rcx),%xmm3
movss  (%r8),%xmm4
movss  (%r9),%xmm5
jmp    1030 <s2wcube@plt>

LLVM IR (-O0):
define void @s2wcube_(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store float* %4, float** %11
store float* %5, float** %12
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = load float*, float** %8
%16 = load float, float* %15
%17 = load float*, float** %9
%18 = load float, float* %17
%19 = load float*, float** %10
%20 = load float, float* %19
%21 = load float*, float** %11
%22 = load float, float* %21
%23 = load float*, float** %12
%24 = load float, float* %23
%25 = call i32 @s2wcube(float %14, float %16, float %18, float %20, float %22, float %24)
ret void
}

LLVM IR (-O2):
define void @s2wcube_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4, float* nocapture %5) {
%7 = load float, float* %0
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = load float, float* %4
%12 = load float, float* %5
%13 = tail call i32 @s2wcube(float %7, float %8, float %9, float %10, float %11, float %12)
ret void
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
int vmbuf_resize_if_full(struct vmbuf *);
int /*<<< orphan*/ vmbuf_wseek_no_resize(struct vmbuf *, size_t);
int vmbuf_wseek(struct vmbuf *vmbuf, size_t by) {
  vmbuf_wseek_no_resize(vmbuf, by);
  return vmbuf_resize_if_full(vmbuf);
}


x86 assembly (clang, -O0):
<vmbuf_wseek>:
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 <vmbuf_wseek_no_resize@plt>
mov    -0x8(%rbp),%rdi
call   1040 <vmbuf_resize_if_full@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmbuf_wseek>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vmbuf_wseek_no_resize@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vmbuf_resize_if_full@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i32 @vmbuf_wseek(%struct.vmbuf* %0, i64 %1) {
%3 = alloca %struct.vmbuf*
%4 = alloca i64
store %struct.vmbuf* %0, %struct.vmbuf** %3
store i64 %1, i64* %4
%5 = load %struct.vmbuf*, %struct.vmbuf** %3
%6 = load i64, i64* %4
%7 = call i32 @vmbuf_wseek_no_resize(%struct.vmbuf* %5, i64 %6)
%8 = load %struct.vmbuf*, %struct.vmbuf** %3
%9 = call i32 @vmbuf_resize_if_full(%struct.vmbuf* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i32 @vmbuf_wseek(%struct.vmbuf* %0, i64 %1) {
%3 = tail call i32 @vmbuf_wseek_no_resize(%struct.vmbuf* %0, i64 %1)
%4 = tail call i32 @vmbuf_resize_if_full(%struct.vmbuf* %0)
ret i32 %4
}
int test_imm_6Cint8_reg(signed char val) {
  return ((val) & (-0x6C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Cint8_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, -108
%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_6Cint8_reg(i8 signext %0) {
%2 = and i8 %0, -108
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void g_io_channel_read_unichar() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_read_unichar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_print(char *);
void cleanup_module() { console_print("Short is the life of an LKM\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Short is the life of an LKM\0A\00"
define void @cleanup_module() {
%1 = call i32 @console_print(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Short is the life of an LKM\0A\00"
define void @cleanup_module() {
%1 = tail call i32 @console_print(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void x_cgo_setenv(char **arg) { setenv(arg[0], arg[1], 1); }


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

x86 assembly (clang, -O2):
<x_cgo_setenv>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
jmp    1030 <setenv@plt>

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

LLVM IR (-O2):
define void @x_cgo_setenv(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @setenv(i8* %2, i8* %4, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le16(int, int /*<<< orphan*/ *);
void __put_unaligned_le32(uint32_t val, uint8_t *p) {
  __put_unaligned_le16(val >> 16, p + 2);
  __put_unaligned_le16(val, p);
}


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

x86 assembly (clang, -O2):
<__put_unaligned_le32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
add    $0x8,%rsi
call   1030 <__put_unaligned_le16@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_le16@plt>

LLVM IR (-O0):
define void @__put_unaligned_le32(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 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = call i32 @__put_unaligned_le16(i32 %6, i32* %8)
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @__put_unaligned_le16(i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_le32(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = tail call i32 @__put_unaligned_le16(i32 %3, i32* %4)
%6 = tail call i32 @__put_unaligned_le16(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test03(void) { return test_sat_parser_should_fail("()"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"()\00"
define i32 @test03() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [3 x i8] c"()\00"
define i32 @test03() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void nullEntry() {}


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

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

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

LLVM IR (-O2):
define void @nullEntry() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int work_queue_destroy_data_(int *shmid) {
  if (shmctl(*shmid, IPC_RMID, NULL) == -1) {
    perror("shmctl");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<work_queue_destroy_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    1173 <work_queue_destroy_data_+0x43>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work_queue_destroy_data_>:
push   %rax
mov    (%rdi),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
je     114c <work_queue_destroy_data_+0x1c>
xor    %eax,%eax
pop    %rcx
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmctl\00"
define i32 @work_queue_destroy_data_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = load i32, i32* @IPC_RMID
%4 = tail call i32 @shmctl(i32 %2, i32 %3, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i32 0
}
void udpclient() {}


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

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

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

LLVM IR (-O2):
define void @udpclient() {
ret void
}
int debug_break() { return 0; }


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

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

LLVM IR (-O0):
define i32 @debug_break() {
ret i32 0
}

LLVM IR (-O2):
define i32 @debug_break() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
void test_uint32_comparison() {
  uint32_t x = 0xFFFFFFFF;
  assertTrue("x > 0", x > 0);
  ;
  assertTrue("x > 100", x > 100);
  ;
  assertTrue("0 < x", 0 < x);
  ;
}


x86 assembly (clang, -O0):
<test_uint32_comparison>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xece(%rip),%rdi
call   1030 <assertTrue@plt>
cmpl   $0x64,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebc(%rip),%rdi
call   1030 <assertTrue@plt>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeab(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_uint32_comparison>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xee0(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xeda(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"x > 0\00"
@.str.1 = [8 x i8] c"x > 100\00"
@.str.2 = [6 x i8] c"0 < x\00"
define void @test_uint32_comparison() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = icmp sgt i32 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assertTrue(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 100
%8 = zext i1 %7 to i32
%9 = call i32 @assertTrue(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = icmp slt i32 0, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assertTrue(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"x > 0\00"
@.str.1 = [8 x i8] c"x > 100\00"
@.str.2 = [6 x i8] c"0 < x\00"
define void @test_uint32_comparison() {
%1 = tail call i32 @assertTrue(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @assertTrue(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @assertTrue(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BlinkC__Leds__led1Toggle();
void BlinkC__Timer1__fired(void) {
  ;
  BlinkC__Leds__led1Toggle();
}


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

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

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

LLVM IR (-O2):
define void @BlinkC__Timer1__fired() {
%1 = tail call i32 (...) @BlinkC__Leds__led1Toggle()
ret void
}
int strcmp(const char *cs, const char *ct) {
  for (; *cs == *ct; cs++, ct++)
    if (*cs == '\0')
      return (0);
  return (*cs - *ct);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <strcmp+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <strcmp+0x73>
jmp    1143 <strcmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeString(void *elemAddr) {
  char *s = *(char **)elemAddr;
  free(s);
}


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

x86 assembly (clang, -O2):
<FreeString>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeString(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getlineKR(char *, int);
int /*<<< orphan*/ printf(char *, double);
main(void) {
  double r, atof(char[]);
  char line[1000];
  getlineKR(line, 1000);
  r = atof(line);
  printf("%g\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getlineKR@plt>
lea    -0x400(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe90(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getlineKR@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
lea    0xea9(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getlineKR(i8* %2, i32 1000)
%4 = call double @atof(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
unsigned xrop3_102_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = D ^ S;
  return stk1;
}


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

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

LLVM IR (-O0):
define i32 @xrop3_102_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = xor i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @xrop3_102_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, 255
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _cd_usage(void) {
  fputs("Usage: cd [-L | -P] directory\n       cd -\n  -L	resolve "
        "symbolic links after parent directories\n  -P	resolve symbolic links "
        "before parent directories\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_cd_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cd_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"Usage: cd [-L | -P] directory\0A cd -\0A -L\09resolve symbolic links after parent directories\0A -P\09resolve symbolic links before parent directories\0A\00"
@stderr = global i32 0
define i32 @_cd_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [150 x i8] c"Usage: cd [-L | -P] directory\0A cd -\0A -L\09resolve symbolic links after parent directories\0A -P\09resolve symbolic links before parent directories\0A\00"
@stderr = global i32 0
define i32 @_cd_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
ttyowait() {}


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

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

LLVM IR (-O0):
define i32 @ttyowait() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @ttyowait() {
ret i32 undef
}
/* Variables and functions */
int in_mandel(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", in_mandel(1., 2., 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <in_mandel@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <in_mandel@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
scalar_t__ skb_transport_header(struct sk_buff const *);
struct ip_comp_hdr *ip_comp_hdr(const struct sk_buff *skb) {
  return (struct ip_comp_hdr *)skb_transport_header(skb);
}


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

x86 assembly (clang, -O2):
<ip_comp_hdr>:
jmp    1030 <skb_transport_header@plt>

LLVM IR (-O0):
%struct.ip_comp_hdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.ip_comp_hdr* @ip_comp_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_transport_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.ip_comp_hdr*
ret %struct.ip_comp_hdr* %5
}

LLVM IR (-O2):
%struct.ip_comp_hdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.ip_comp_hdr* @ip_comp_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_transport_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.ip_comp_hdr*
ret %struct.ip_comp_hdr* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ComparatorIntEnable(uint32_t ui32Base, uint32_t ui32Comp) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 1 << ui32Comp;
}


x86 assembly (clang, -O0):
<ComparatorIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntEnable>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %edi,%rcx
or     %eax,0x8(%rcx)
ret

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

LLVM IR (-O2):
define void @ComparatorIntEnable(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = add nsw i32 %0, 8
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, %3
store volatile i32 %8, i32* %6
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t sqrt_int32_t(int32_t x) {
  int32_t f = x, g = 0;
  while (f) {
    int32_t h = f + g;
    if (h * h <= x)
      g += f;
    f >>= 1;
  }
  return g;
}


x86 assembly (clang, -O0):
<sqrt_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <sqrt_int32_t+0x4e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1140 <sqrt_int32_t+0x40>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <sqrt_int32_t+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_int32_t>:
xor    %eax,%eax
test   %edi,%edi
je     112b <sqrt_int32_t+0x2b>
mov    %edi,%ecx
jmp    111b <sqrt_int32_t+0x1b>
nopw   0x0(%rax,%rax,1)
mov    %ecx,%edx
sar    %edx
cmp    $0x1,%ecx
mov    %edx,%ecx
jbe    112b <sqrt_int32_t+0x2b>
lea    (%rcx,%rax,1),%edx
mov    %edx,%esi
imul   %edx,%esi
cmp    %edi,%esi
jg     1110 <sqrt_int32_t+0x10>
mov    %edx,%eax
jmp    1110 <sqrt_int32_t+0x10>
ret

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

LLVM IR (-O2):
define i32 @sqrt_int32_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, %5
%7 = mul nsw i32 %6, %6
%8 = icmp sgt i32 %7, %0
%9 = select i1 %8, i32 %5, i32 %6
%10 = ashr i32 %4, 1
%11 = icmp ult i32 %4, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
void ff_hevc_put_hevc_uni_epel_h24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h24_10_avx2() {
ret void
}
int duplicate_func() { return 4; }


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

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

LLVM IR (-O0):
define i32 @duplicate_func() {
ret i32 4
}

LLVM IR (-O2):
define i32 @duplicate_func() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ RETURN_IF_FALSE(int /*<<< orphan*/);
int /*<<< orphan*/ assert_exit(char *);
int /*<<< orphan*/ config_token_verbose_p();
int /*<<< orphan*/ log_print(char *, char *);
void tk_lang_c_optr_print(char *buf) {
  assert_exit(buf);
  RETURN_IF_FALSE(config_token_verbose_p());
  log_print("[TK] try operator on '%s'\n", buf);
}


x86 assembly (clang, -O0):
<tk_lang_c_optr_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert_exit@plt>
mov    $0x0,%al
call   1060 <config_token_verbose_p@plt>
mov    %eax,%edi
call   1040 <RETURN_IF_FALSE@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <log_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tk_lang_c_optr_print>:
push   %rbx
mov    %rdi,%rbx
call   1050 <assert_exit@plt>
xor    %eax,%eax
call   1060 <config_token_verbose_p@plt>
mov    %eax,%edi
call   1040 <RETURN_IF_FALSE@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <log_print@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"[TK] try operator on '%s'\0A\00"
define void @tk_lang_c_optr_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert_exit(i8* %3)
%5 = call i32 (...) @config_token_verbose_p()
%6 = call i32 @RETURN_IF_FALSE(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @log_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"[TK] try operator on '%s'\0A\00"
define void @tk_lang_c_optr_print(i8* %0) {
%2 = tail call i32 @assert_exit(i8* %0)
%3 = tail call i32 (...) @config_token_verbose_p()
%4 = tail call i32 @RETURN_IF_FALSE(i32 %3)
%5 = tail call i32 @log_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned char clearBit_fun_uchar(unsigned char x, unsigned i) {
  return x & ~(1 << i);
}


x86 assembly (clang, -O0):
<clearBit_fun_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBit_fun_uchar>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
not    %al
and    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @clearBit_fun_uchar(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @clearBit_fun_uchar(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = xor i8 %4, -1
%6 = and i8 %5, %0
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double sancus_frf(double v, double a, double b) {
  assert((v >= a) && (v <= b));
  return (double)v;
}


x86 assembly (clang, -O0):
<sancus_frf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x19(%rbp)
jb     1150 <sancus_frf+0x40>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_frf>:
push   %rax
movsd  %xmm0,(%rsp)
ucomisd %xmm1,%xmm0
setae  %al
ucomisd %xmm0,%xmm2
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sancus_frf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp oge double %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load double, double* %4
%12 = load double, double* %6
%13 = fcmp ole double %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load double, double* %4
ret double %18
}

LLVM IR (-O2):
define double @sancus_frf(double returned %0, double %1, double %2) {
%4 = fcmp oge double %0, %1
%5 = fcmp ole double %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 5000; i >= 0; i--) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1388,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1388,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 5000, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nsw i32 %2, -1
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int test_imm_92int64_lowword_reg(long long val) {
  return ((val) & (0x92 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_92int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 146
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fcfs();
int /*<<< orphan*/ input();
int /*<<< orphan*/ printf(char *);
main() {
  printf("\nCPU SCHEDULLING\n");
  printf("METODE FCFS\n\n");
  input();
  fcfs();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <input@plt>
mov    $0x0,%al
call   1050 <fcfs@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <input@plt>
xor    %eax,%eax
call   1050 <fcfs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0ACPU SCHEDULLING\0A\00"
@.str.1 = [14 x i8] c"METODE FCFS\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @input()
%4 = call i32 (...) @fcfs()
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"\0ACPU SCHEDULLING\00"
@str.2 = [13 x i8] c"METODE FCFS\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @input()
%4 = tail call i32 (...) @fcfs()
ret i32 0
}
int mips_cpu_caps(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @mips_cpu_caps() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mips_cpu_caps() {
ret i32 0
}
int isoperator(char c) {
  if (c == '*' || c == '+' || c == '-' || c == '/')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isoperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     113e <isoperator+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     113e <isoperator+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     113e <isoperator+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    114a <isoperator+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <isoperator+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isoperator>:
add    $0xd6,%dil
xor    %eax,%eax
cmp    $0x5,%dil
ja     111a <isoperator+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isoperator(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
%6 = icmp eq i32 %5, 42
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 43
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@switch.table.isoperator = [6 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @isoperator(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.isoperator, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int test_imm_92uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x92 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_92uint64_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, 146
%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_92uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 627065225216
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}