xunge/DecIR huggingface dataset:
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_CHILDREN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
int /*<<< orphan*/ print_rusage(struct rusage *);
int system(char *);
void with_system(int argc, char **argv) {
  int ret = system(argv[1]);
  struct rusage ru;
  getrusage(RUSAGE_CHILDREN, &ru);
  if (ret != 0) {
    exit(1);
  }
  print_rusage(&ru);
  exit(0);
}


x86 assembly (clang, -O0):
<with_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <system@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1050 <getrusage@plt>
cmpl   $0x0,-0x14(%rbp)
je     1185 <with_system+0x45>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    -0x18(%rbp),%rdi
call   1040 <print_rusage@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<with_system>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rdi
call   1030 <system@plt>
mov    %eax,%ebx
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1050 <getrusage@plt>
test   %ebx,%ebx
jne    1178 <with_system+0x38>
lea    0x8(%rsp),%rdi
call   1040 <print_rusage@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
@RUSAGE_CHILDREN = global i32 0
define void @with_system(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca %struct.rusage
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @system(i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* @RUSAGE_CHILDREN
%12 = call i32 @getrusage(i32 %11, %struct.rusage* %6)
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = call i32 @print_rusage(%struct.rusage* %6)
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@RUSAGE_CHILDREN = global i32 0
define void @with_system(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.rusage
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @system(i8* %5)
%7 = bitcast %struct.rusage* %3 to i8*
%8 = load i32, i32* @RUSAGE_CHILDREN
%9 = call i32 @getrusage(i32 %8, %struct.rusage* %3)
%10 = icmp eq i32 %6, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = call i32 @print_rusage(%struct.rusage* %3)
%15 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 70;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 70, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 70)
ret i32 0
}
void input_read(float *x, float *y, float *z) {}


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

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

LLVM IR (-O0):
define void @input_read(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
ret void
}

LLVM IR (-O2):
define void @input_read(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ lowerstr(char *);
scalar_t__ strdup(char const *);
scalar_t__ strstr(char *, char *);
char *strnstr(const char *HAYSTACK, const char *NEEDLE) {
  char *h, *n, *res;
  h = (char *)strdup(HAYSTACK);
  n = (char *)strdup(NEEDLE);
  lowerstr(h);
  lowerstr(n);
  res = (char *)strstr(h, n);
  free(h);
  free(n);
  return res;
}


x86 assembly (clang, -O0):
<strnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <lowerstr@plt>
mov    -0x20(%rbp),%rdi
call   1040 <lowerstr@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnstr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
call   1050 <strdup@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <lowerstr@plt>
mov    %rbx,%rdi
call   1040 <lowerstr@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <strstr@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strnstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i64 @strdup(i8* %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %4
%12 = call i64 @strdup(i8* %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = load i8*, i8** %5
%15 = call i32 @lowerstr(i8* %14)
%16 = load i8*, i8** %6
%17 = call i32 @lowerstr(i8* %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = call i64 @strstr(i8* %18, i8* %19)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %7
%22 = load i8*, i8** %5
%23 = call i32 @free(i8* %22)
%24 = load i8*, i8** %6
%25 = call i32 @free(i8* %24)
%26 = load i8*, i8** %7
ret i8* %26
}

LLVM IR (-O2):
define i8* @strnstr(i8* %0, i8* %1) {
%3 = tail call i64 @strdup(i8* %0)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @strdup(i8* %1)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @lowerstr(i8* %4)
%8 = tail call i32 @lowerstr(i8* %6)
%9 = tail call i64 @strstr(i8* %4, i8* %6)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @free(i8* %4)
%12 = tail call i32 @free(i8* %6)
ret i8* %10
}
/* Variables and functions */
float powf(float, float);
void __hv_pow_f(float bIn0, float bIn1, float *bOut) {
  *bOut = powf(bIn0, bIn1);
}


x86 assembly (clang, -O0):
<__hv_pow_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <powf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_pow_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <powf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_pow_f(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call float @powf(float %7, float %8)
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @__hv_pow_f(float %0, float %1, float* nocapture writeonly %2) {
%4 = tail call float @powf(float %0, float %1)
store float %4, float* %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t unaligned16_be(const uint8_t *ptr) {
  return (int16_t)((ptr[0] << 8) | ptr[1]);
}


x86 assembly (clang, -O0):
<unaligned16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned16_be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @unaligned16_be(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @unaligned16_be(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ hex(char);
bool match_vx(char *w) { return (*w == 'V') && hex(*(w + 1)); }


x86 assembly (clang, -O0):
<match_vx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x56,%ecx
mov    %al,-0x9(%rbp)
jne    1148 <match_vx+0x38>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <hex@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_vx>:
push   %rax
xor    %eax,%eax
cmpb   $0x56,(%rdi)
jne    112c <match_vx+0x1c>
movsbl 0x1(%rdi),%edi
call   1030 <hex@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @match_vx(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 86
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i64 @hex(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %7, %1
%14 = phi i1 [ false, %1 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @match_vx(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 86
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i64 @hex(i8 signext %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %11
}
int test_imm_9Dint16_reg(short val) {
  return ((val) & (0x9D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 157
%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_9Dint16_reg(i16 signext %0) {
%2 = and i16 %0, 157
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int cmpint(void const **, void const **);
int intcmp(const void *x, const void *y) { return cmpint(&x, &y); }


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

x86 assembly (clang, -O2):
<intcmp>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <cmpint@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @intcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @cmpint(i8** %3, i8** %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @cmpint(i8** %3, i8** %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ get_glyph_gen(char const *, char *, char, int, int /*<<< orphan*/,
                         int /*<<< orphan*/);
const char *get_glyph(const char *iptr, char *optr, char mchar) {
  return (const char *)get_glyph_gen(iptr, optr, mchar, 1, 0, 0);
}


x86 assembly (clang, -O0):
<get_glyph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%ecx
xor    %r9d,%r9d
movsbl -0x11(%rbp),%edx
mov    %r9d,%r8d
call   1030 <get_glyph_gen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_glyph>:
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <get_glyph_gen@plt>

LLVM IR (-O0):
define i8* @get_glyph(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = call i64 @get_glyph_gen(i8* %7, i8* %8, i8 signext %9, i32 1, i32 0, i32 0)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @get_glyph(i8* %0, i8* %1, i8 signext %2) {
%4 = tail call i64 @get_glyph_gen(i8* %0, i8* %1, i8 signext %2, i32 1, i32 0, i32 0)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int _write_sysfs_int(char const *, char const *, int, int /*<<< orphan*/,
                     int /*<<< orphan*/, int /*<<< orphan*/);
int write_sysfs_int(const char *filename, const char *basedir, int val) {
  return _write_sysfs_int(filename, basedir, val, 0, 0, 0);
}


x86 assembly (clang, -O0):
<write_sysfs_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <_write_sysfs_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_int>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_write_sysfs_int@plt>

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

LLVM IR (-O2):
define i32 @write_sysfs_int(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_write_sysfs_int(i8* %0, i8* %1, i32 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
long sz() { return 0xffff0000L; }


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

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

LLVM IR (-O0):
define i64 @sz() {
ret i64 4294901760
}

LLVM IR (-O2):
define i64 @sz() {
ret i64 4294901760
}
/* Variables and functions */
unsigned char __builtin_inl(unsigned short);
unsigned char inl(unsigned short port) { return __builtin_inl(port); }


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <__builtin_inl@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
jmp    1030 <__builtin_inl@plt>

LLVM IR (-O0):
define zeroext i8 @inl(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i8 @__builtin_inl(i16 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @inl(i16 zeroext %0) {
%2 = tail call zeroext i8 @__builtin_inl(i16 zeroext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putchar_err(char c) {
  ft_putstr("\x1B[31m");
  ft_putchar(c);
  ft_putstr("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putchar_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xecb(%rip),%rdi
call   1040 <ft_putstr@plt>
movsbl -0x1(%rbp),%edi
call   1030 <ft_putchar@plt>
lea    0xebc(%rip),%rdi
call   1040 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar_err>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    %ebx,%edi
call   1030 <ft_putchar@plt>
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1040 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putchar_err(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = call i32 @ft_putchar(i8 signext %4)
%6 = call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putchar_err(i8 signext %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putchar(i8 signext %0)
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void sum_data(char char1, int *accumulator) {
  *accumulator = *accumulator + (int)char1;
}


x86 assembly (clang, -O0):
<sum_data>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
movsbl -0x1(%rbp),%eax
add    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_data>:
add    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @sum_data(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @sum_data(i8 signext %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i8 %0 to i32
%5 = add nsw i32 %3, %4
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  int resto;
  printf("\nentre com num:");
  scanf("%d", &num);
  resto = num % 2;
  if (resto == 0) {
    printf("\nnumero par");
  } else {
    printf("\nnumero impar");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1174 <main+0x54>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0Aentre com num:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"\0Anumero par\00"
@.str.3 = [14 x i8] c"\0Anumero impar\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0Aentre com num:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"\0Anumero par\00"
@.str.3 = [14 x i8] c"\0Anumero impar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
void RTRandAdvBytes(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay_ms(uint32_t delay) { usleep(delay * 1000); }


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

x86 assembly (clang, -O2):
<delay_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int main() { 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void fillArr(char val, char *arr, int length) {
  int i;
  for (i = 0; i < length; i++) {
    arr[i] = val;
  }
}


x86 assembly (clang, -O0):
<fillArr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1140 <fillArr+0x40>
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <fillArr+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillArr>:
test   %edx,%edx
jle    1129 <fillArr+0x19>
push   %rax
mov    %edx,%edx
movzbl %dil,%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @fillArr(i8 signext %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zcm_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<zcm_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @zcm_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int ceph_osd_op_mode_subop(int op) { return (op & 0xf000) == 0x4000; }


x86 assembly (clang, -O0):
<ceph_osd_op_mode_subop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf000,%eax
cmp    $0x4000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_osd_op_mode_subop>:
and    $0xf000,%edi
xor    %eax,%eax
cmp    $0x4000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ceph_osd_op_mode_subop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 61440
%5 = icmp eq i32 %4, 16384
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ceph_osd_op_mode_subop(i32 %0) {
%2 = and i32 %0, 61440
%3 = icmp eq i32 %2, 16384
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(char *, size_t);
scalar_t__ malloc(size_t);
char *ft_strnew(size_t size) {
  char *result;
  result = (char *)malloc(size + 1);
  if (result == NULL) {
    return (result);
  }
  ft_bzero(result, size + 1);
  return (result);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <ft_strnew+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <ft_strnew+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1146 <ft_strnew+0x26>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <ft_bzero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i8*, i8** %4
store i8* %12, i8** %2
br label %19
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i64, i64* %3
%16 = add i64 %15, 1
%17 = call i32 @ft_bzero(i8* %14, i64 %16)
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %13, %11
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @ft_bzero(i8* %4, i64 %2)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_lock_t;

/* Variables and functions */
int c_pomp_test_lock_(omp_lock_t *s) { (void)0; }


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

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

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

LLVM IR (-O2):
define i32 @c_pomp_test_lock_(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int socketWrite(int, char *, int);
int strlen(char *);
int socketWriteString(int handle, char *string) {
  int len = strlen(string);
  return (socketWrite(handle, string, len));
}


x86 assembly (clang, -O0):
<socketWriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <socketWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketWriteString>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <socketWrite@plt>

LLVM IR (-O0):
define i32 @socketWriteString(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @socketWrite(i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @socketWriteString(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @socketWrite(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "ssgl_gameclient_example gametype\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"ssgl_gameclient_example gametype\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"ssgl_gameclient_example gametype\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int8_t Function1Int8(int8_t x) { return x + 42; }


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

x86 assembly (clang, -O2):
<Function1Int8>:
lea    0x2a(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @Function1Int8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 42
ret i64 %4
}

LLVM IR (-O2):
define i64 @Function1Int8(i64 %0) {
%2 = add nsw i64 %0, 42
ret i64 %2
}
int test_imm_01uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x01 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_01uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ProcessFile(char *);
void ExifReadInfo(char *filename) { ProcessFile(filename); }


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

x86 assembly (clang, -O2):
<ExifReadInfo>:
jmp    1030 <ProcessFile@plt>

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

LLVM IR (-O2):
define void @ExifReadInfo(i8* %0) {
%2 = tail call i32 @ProcessFile(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((constructor)) __attribute__((used)) C12(void) {
  printf("Test3\n");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Test3\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @C12, i8* null }]
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @C12 to i8*)], section "llvm.metadata"
define void @C12() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @C12, i8* null }]
@str = [6 x i8] c"Test3\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @C12 to i8*)], section "llvm.metadata"
define void @C12() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
unsigned short func_1(void) {
  short l_2 = 1L;
  step_hash(1);
  return l_2;
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x1,-0x2(%rbp)
mov    $0x1,%edi
call   1030 <step_hash@plt>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @func_1() {
%1 = alloca i16
store i16 1, i16* %1
%2 = call i32 @step_hash(i32 1)
%3 = load i16, i16* %1
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @func_1() {
%1 = tail call i32 @step_hash(i32 1)
ret i16 1
}
int execute_statvfs64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_statvfs64() {
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
int outcap(int i) {
  char c = i;
  return write(1, &c, 1);
}


x86 assembly (clang, -O0):
<outcap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outcap>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @outcap(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = call i32 @write(i32 1, i8* %3, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @outcap(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 %4
}
void unsigned_char_xor_signed_char_signed_int(unsigned char *LHS,
                                              signed int RHS) {
  (*LHS) ^= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_xor_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_xor_signed_char_signed_int>:
xor    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @unsigned_char_xor_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = xor i8 %3, %4
store i8 %5, i8* %0
ret void
}
/* Type definitions */
typedef int volatile uint32_t;

/* Variables and functions */
void clear_fifo(volatile uint32_t *reg) {
  uint32_t mask = ~(3 << 4);
  *reg &= mask;
  mask = (3 << 4);
  *reg |= mask;
}


x86 assembly (clang, -O0):
<clear_fifo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffcf,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
movl   $0x30,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_fifo>:
movl   $0xffffffcf,-0x4(%rsp)
ff
mov    -0x4(%rsp),%eax
and    %eax,(%rdi)
movl   $0x30,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clear_fifo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store volatile i32 -49, i32* %3
%4 = load volatile i32, i32* %3
%5 = load i32*, i32** %2
%6 = load volatile i32, i32* %5
%7 = and i32 %6, %4
store volatile i32 %7, i32* %5
store volatile i32 48, i32* %3
%8 = load volatile i32, i32* %3
%9 = load i32*, i32** %2
%10 = load volatile i32, i32* %9
%11 = or i32 %10, %8
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @clear_fifo(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 -49, i32* %2
%4 = load volatile i32, i32* %2
%5 = load volatile i32, i32* %0
%6 = and i32 %5, %4
store volatile i32 %6, i32* %0
store volatile i32 48, i32* %2
%7 = load volatile i32, i32* %2
%8 = load volatile i32, i32* %0
%9 = or i32 %8, %7
store volatile i32 %9, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wcscpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
wchar_t *Loopr_wcscpy(wchar_t *dest, wchar_t *src) { return wcscpy(dest, src); }


x86 assembly (clang, -O0):
<Loopr_wcscpy>:
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 <wcscpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Loopr_wcscpy>:
jmp    1030 <wcscpy@plt>

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

LLVM IR (-O2):
define i32* @Loopr_wcscpy(i32* %0, i32* %1) {
%3 = tail call i32* @wcscpy(i32* %0, i32* %1)
ret i32* %3
}
/* Type definitions */
struct uwsgi_buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ uwsgi_buffer_append(struct uwsgi_buffer *, char *, int);
int uwsgi_webdav_multistatus_propstat_close(struct uwsgi_buffer *ub) {
  if (uwsgi_buffer_append(ub, "</D:propstat>\n", 14))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<uwsgi_webdav_multistatus_propstat_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0xe,%edx
call   1030 <uwsgi_buffer_append@plt>
cmp    $0x0,%rax
je     1147 <uwsgi_webdav_multistatus_propstat_close+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <uwsgi_webdav_multistatus_propstat_close+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_webdav_multistatus_propstat_close>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0xe,%edx
call   1030 <uwsgi_buffer_append@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.uwsgi_buffer = type { i32 }
@.str = [15 x i8] c"</D:propstat>\0A\00"
define i32 @uwsgi_webdav_multistatus_propstat_close(%struct.uwsgi_buffer* %0) {
%2 = alloca i32
%3 = alloca %struct.uwsgi_buffer*
store %struct.uwsgi_buffer* %0, %struct.uwsgi_buffer** %3
%4 = load %struct.uwsgi_buffer*, %struct.uwsgi_buffer** %3
%5 = call i64 @uwsgi_buffer_append(%struct.uwsgi_buffer* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.uwsgi_buffer = type { i32 }
@.str = [15 x i8] c"</D:propstat>\0A\00"
define i32 @uwsgi_webdav_multistatus_propstat_close(%struct.uwsgi_buffer* %0) {
%2 = tail call i64 @uwsgi_buffer_append(%struct.uwsgi_buffer* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _ln_error(char const *message, int ret) {
  fputs("ln"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_ln_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ln_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ln: \00"
@stderr = global i32 0
define i32 @_ln_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"ln: \00"
@stderr = global i32 0
define i32 @_ln_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
__attribute__((warn_unused_result)) uint8_t modbusMaskRead(const uint8_t *mask,
                                                           uint16_t n) {
  return (mask[n >> 3] & (1 << (n & 7))) != 0;
}


x86 assembly (clang, -O0):
<modbusMaskRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbusMaskRead>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @modbusMaskRead(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 7
%13 = shl i32 1, %12
%14 = and i32 %10, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @modbusMaskRead(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
void should_terminate() {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<should_terminate>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <should_terminate+0x9>
jmp    1109 <should_terminate+0x9>

x86 assembly (clang, -O2):
<should_terminate>:
jmp    1100 <should_terminate>

LLVM IR (-O0):
define void @should_terminate() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @should_terminate() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
uint64_t int32_to_uint64(int32_t x) { return (uint64_t)x; }


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

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

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

LLVM IR (-O2):
define i32 @int32_to_uint64(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void baz(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @baz() {
%1 = tail call i32 (...) @bar()
ret void
}
void RTTarFileWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileWrite() {
ret void
}