xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ asn1_perror(int);
char *asn1_strerror(int);
int main(int argc, char *argv[]) {
  int ec = 0;
  const char *errstr;
  int verbose = 0;
  if (argc > 1)
    verbose = 1;
  do {
    errstr = asn1_strerror(ec);
    if (verbose != 0)
      asn1_perror(ec);
    ec++;
  } while (errstr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x35>
movl   $0x1,-0x24(%rbp)
jmp    115a <main+0x3a>
mov    -0x14(%rbp),%edi
call   1030 <asn1_strerror@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1178 <main+0x58>
mov    -0x14(%rbp),%edi
call   1040 <asn1_perror@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115a <main+0x3a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %ebp,%ebp
jmp    1138 <main+0x18>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
test   %rbx,%rbx
je     1151 <main+0x31>
mov    %ebp,%edi
call   1030 <asn1_strerror@plt>
mov    %rax,%rbx
cmp    $0x2,%r14d
jl     1130 <main+0x10>
mov    %ebp,%edi
call   1040 <asn1_perror@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br label %4
4: ; preds = %9, %2
%5 = phi i32 [ 0, %2 ], [ %10, %9 ]
%6 = tail call i8* @asn1_strerror(i32 %5)
br i1 %3, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @asn1_perror(i32 %5)
br label %9
9: ; preds = %7, %4
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i8* %6, null
br i1 %11, label %12, label %4
12: ; preds = %9
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  if (2 * y < 1) {
    return 0;
  }
  while (x >= 0) {
    x = x - 2 * y + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cmp    $0x1,%eax
jge    114e <main+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    117a <main+0x6a>
jmp    1153 <main+0x43>
cmpl   $0x0,-0x8(%rbp)
jl     1173 <main+0x63>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 2, %6
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %21
10: ; preds = %0
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = mul nsw i32 2, %16
%18 = sub nsw i32 %15, %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %11
20: ; preds = %11
store i32 0, i32* %1
br label %21
21: ; preds = %20, %9
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xd1() {
  Assert_real((islower(209) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1050, ("islower should be 0 for 0xd1"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xd1\00"
define void @t_islower_0xd1() {
%1 = tail call i64 @islower(i32 209)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1050, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void fn2EC2() { return; }


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

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

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

LLVM IR (-O2):
define void @fn2EC2() {
ret void
}
/* Type definitions */
typedef int suseconds_t;
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
suseconds_t timevaldiff(struct timeval const *starttime,
                        struct timeval const *finishtime) {
  suseconds_t diff = finishtime->tv_usec - starttime->tv_usec;
  diff += 1000000 * (finishtime->tv_sec - starttime->tv_sec);
  return diff;
}


x86 assembly (clang, -O0):
<timevaldiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
sub    0x4(%rcx),%eax
imul   $0xf4240,%eax,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timevaldiff>:
mov    (%rsi),%ecx
mov    0x4(%rsi),%eax
sub    (%rdi),%ecx
sub    0x4(%rdi),%eax
imul   $0xf4240,%eax,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timevaldiff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.timeval*, %struct.timeval** %3
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load %struct.timeval*, %struct.timeval** %4
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timeval*, %struct.timeval** %3
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = mul nsw i32 1000000, %19
%21 = load i32, i32* %5
%22 = add nsw i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @timevaldiff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub i32 %4, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
%13 = mul nsw i32 %12, 1000000
%14 = add nsw i32 %7, %13
ret i32 %14
}
void emit_sigma(struct processor_explicatory_state *process_state,
                struct modern_stream *stream, void *stream_state,
                struct modern_vfile *vfile, void *vfile_state) {}


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

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_sigma(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_sigma(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int get_field_pos1(char *, char const *, char const *, int *);
int get_field_pos2(char *, int, char const *, char const *, int *);
int get_field_pos(char *str, int len, const char *prejumpset,
                  const char *delemiters, int *field_start) {
  if (len <= 0) {
    return get_field_pos1(str, prejumpset, delemiters, field_start);
  } else {
    return get_field_pos2(str, len, prejumpset, delemiters, field_start);
  }
}


x86 assembly (clang, -O0):
<get_field_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1162 <get_field_pos+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1030 <get_field_pos1@plt>
mov    %eax,-0x4(%rbp)
jmp    117d <get_field_pos+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <get_field_pos2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_field_pos>:
test   %esi,%esi
jle    1129 <get_field_pos+0x9>
jmp    1040 <get_field_pos2@plt>
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <get_field_pos1@plt>

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

LLVM IR (-O2):
define i32 @get_field_pos(i8* %0, i32 %1, i8* %2, i8* %3, i32* %4) {
%6 = icmp slt i32 %1, 1
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @get_field_pos1(i8* %0, i8* %2, i8* %3, i32* %4)
br label %11
9: ; preds = %5
%10 = tail call i32 @get_field_pos2(i8* %0, i32 %1, i8* %2, i8* %3, i32* %4)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
int f_bgt_mr1(float *a1, float a2) { return (__builtin_isgreater(*a1, a2)); }


x86 assembly (clang, -O0):
<f_bgt_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_mr1>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @f_bgt_mr1(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp ogt float %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_bgt_mr1(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ogt float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
toedit(count) int count;
{
  if (count > 1) {
    printi(count);
    prints(" files to edit; ");
  }
}


x86 assembly (clang, -O0):
<toedit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114d <toedit+0x2d>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <printi@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <prints@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toedit>:
cmp    $0x2,%edi
jl     113f <toedit+0x1f>
push   %rax
xor    %eax,%eax
call   1030 <printi@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <prints@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c" files to edit; \00"
define i32 @toedit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @printi to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @prints to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c" files to edit; \00"
define i32 @toedit(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @printi to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @prints to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
int linux_which(char *, char *);
int wsys_which(char *exactname, char *exename) {
  return (linux_which(exactname, exename));
}


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

x86 assembly (clang, -O2):
<wsys_which>:
jmp    1030 <linux_which@plt>

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

LLVM IR (-O2):
define i32 @wsys_which(i8* %0, i8* %1) {
%3 = tail call i32 @linux_which(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lmc_does_file_exist(char *);
int /*<<< orphan*/ lmc_file_path_for_namespace(char *, char const *);
int lmc_file_size(char *);
int lmc_namespace_size(const char *ns) {
  char fn[1024];
  lmc_file_path_for_namespace((char *)&fn, ns);
  if (!lmc_does_file_exist(fn)) {
    return 0;
  }
  return lmc_file_size(fn);
}


x86 assembly (clang, -O0):
<lmc_namespace_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <lmc_file_path_for_namespace@plt>
lea    -0x410(%rbp),%rdi
call   1030 <lmc_does_file_exist@plt>
cmp    $0x0,%eax
jne    1170 <lmc_namespace_size+0x40>
movl   $0x0,-0x4(%rbp)
jmp    117f <lmc_namespace_size+0x4f>
lea    -0x410(%rbp),%rdi
call   1050 <lmc_file_size@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_namespace_size>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <lmc_file_path_for_namespace@plt>
mov    %rbx,%rdi
call   1030 <lmc_does_file_exist@plt>
test   %eax,%eax
je     115c <lmc_namespace_size+0x2c>
mov    %rsp,%rdi
call   1050 <lmc_file_size@plt>
jmp    115e <lmc_namespace_size+0x2e>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lmc_namespace_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1024 x i8]
store i8* %0, i8** %3
%5 = bitcast [1024 x i8]* %4 to i8*
%6 = load i8*, i8** %3
%7 = call i32 @lmc_file_path_for_namespace(i8* %5, i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = call i32 @lmc_does_file_exist(i8* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %1
store i32 0, i32* %2
br label %15
12: ; preds = %1
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%14 = call i32 @lmc_file_size(i8* %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @lmc_namespace_size(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @lmc_file_path_for_namespace(i8* %3, i8* %0)
%5 = call i32 @lmc_does_file_exist(i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @lmc_file_size(i8* %3)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ %8, %7 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *);
main() {
  printf("Init...\n");
  init();
  printf("Init Complete.\n");
  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>
mov    $0x0,%al
call   1040 <init@plt>
lea    0xec0(%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 <puts@plt>
xor    %eax,%eax
call   1040 <init@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"Init...\00"
@str.2 = [15 x i8] c"Init Complete.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @init()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(void) {
  static int a;
  a++;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f09(%rip)
mov    0x2f03(%rip),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2f16(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f0d(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@foo.a = internal global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @foo() {
%1 = load i32, i32* @foo.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.a
%3 = load i32, i32* @foo.a
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@foo.a = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @foo() {
%1 = load i32, i32* @foo.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.a
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int vprintf(char *, unsigned int *);
int putchar(int c) {
  unsigned valist[1];
  c = (unsigned char)c;
  valist[0] = c;
  int ret = vprintf("%c", valist);
  if (ret < 0)
    c = -1;
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1030 <vprintf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114e <putchar+0x3e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
sub    $0x10,%rsp
movzbl %dil,%ebx
mov    %ebx,0xc(%rsp)
lea    0xedc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <vprintf@plt>
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i32]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
%7 = zext i8 %6 to i32
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %8, i32* %9
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%11 = call i32 @vprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 -1, i32* %2
br label %15
15: ; preds = %14, %1
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @putchar(i32 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = and i32 %0, 255
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @vprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = icmp sgt i32 %6, -1
%8 = select i1 %7, i32 %4, i32 -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void serialWrite(unsigned char c) { printf("tx 0x%x\n", c); }


x86 assembly (clang, -O0):
<serialWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialWrite>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"tx 0x%x\0A\00"
define void @serialWrite(i8 zeroext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
void string_trunc(char *str, int len) {
  int i;
  for (i = len - 1; isspace(str[i]); --i)
    ;
  str[i + 1] = '\0';
}


x86 assembly (clang, -O0):
<string_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1156 <string_trunc+0x46>
jmp    1148 <string_trunc+0x38>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <string_trunc+0x18>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_trunc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rax
lea    (%rax,%rdi,1),%rbx
add    $0xffffffffffffffff,%rbx
shl    $0x20,%rax
movabs $0x100000000,%r15
add    %rax,%r15
movabs $0xffffffff00000000,%r12
ff ff ff
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %r12,%r15
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1150 <string_trunc+0x40>
sar    $0x20,%r15
movb   $0x0,(%r14,%r15,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @string_trunc(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %6, %4 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = shl i64 %5, 32
%13 = ashr exact i64 %12, 32
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int htonl(int);
uint64_t htonll(uint64_t value) {
  static const int num = 23;
  if (*(const char *)(&num) != num)
    return value;
  uint32_t high_part = htonl((uint32_t)(value >> 32));
  uint32_t low_part = htonl((uint32_t)(value & 0xffffffffLL));
  return ((uint64_t)low_part << 32) | high_part;
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movsbl 0xede(%rip),%eax
cmp    $0x17,%eax
je     1136 <htonll+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <htonll+0x63>
mov    -0x8(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
movslq -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
mov    %edi,%ebx
call   1030 <htonl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <htonl@plt>

LLVM IR (-O0):
@htonll.num = internal constant i32 23
define i32 @htonll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i8, i8* bitcast (i32* @htonll.num to i8*)
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 23
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %24
11: ; preds = %1
%12 = load i32, i32* %3
%13 = ashr i32 %12, 32
%14 = call i32 @htonl(i32 %13)
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = and i64 %16, 4294967295
%18 = trunc i64 %17 to i32
%19 = call i32 @htonl(i32 %18)
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = shl i32 %20, 32
%22 = load i32, i32* %4
%23 = or i32 %21, %22
store i32 %23, i32* %2
br label %24
24: ; preds = %11, %9
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @htonll(i32 %0) {
%2 = tail call i32 @htonl(i32 poison)
%3 = tail call i32 @htonl(i32 %0)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argv, char **args) {
  int i;
  for (i = 1; i < argv; i++) {
    printf("Hello %s\n", args[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
void platform_user_set(const struct platform_state_user *state) {}


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

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

LLVM IR (-O0):
%struct.platform_state_user = type opaque
define void @platform_user_set(%struct.platform_state_user* %0) {
%2 = alloca %struct.platform_state_user*
store %struct.platform_state_user* %0, %struct.platform_state_user** %2
ret void
}

LLVM IR (-O2):
%struct.platform_state_user = type opaque
define void @platform_user_set(%struct.platform_state_user* nocapture %0) {
ret void
}
void __debugbreak() {}


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

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

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

LLVM IR (-O2):
define void @__debugbreak() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int yyerror(const char *s) {
  fprintf(stderr, "%s\n", s);
  return 0;
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: mrlogin [ -%s]%s[-e char] [ -l username ] [-M munge_socket] "
          "[-P service_port] host\n",
          "8EL", " ");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xf20(%rip),%rdx
lea    0xf1d(%rip),%rcx
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
lea    0xf23(%rip),%rdx
lea    0xf20(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"usage: mrlogin [ -%s]%s[-e char] [ -l username ] [-M munge_socket] [-P service_port] host\0A\00"
@.str.1 = [4 x i8] c"8EL\00"
@.str.2 = [2 x i8] c" \00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"usage: mrlogin [ -%s]%s[-e char] [ -l username ] [-M munge_socket] [-P service_port] host\0A\00"
@.str.1 = [4 x i8] c"8EL\00"
@.str.2 = [2 x i8] c" \00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ print_info(char const *);
void console_init(void) {
  static const char console_test[] = "\r\n\r\nLinuxBIOS-"
                                     "1.1.0"
                                     ".0Fallback"
                                     " "
                                     "Fri Jun 13 21:02:41 MDT 2003"
                                     " starting...\r\n";
  print_info(console_test);
}


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

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

LLVM IR (-O0):
@console_init.console_test = internal constant [73 x i8] c"\0D\0A\0D\0ALinuxBIOS-1.1.0.0Fallback Fri Jun 13 21:02:41 MDT 2003 starting...\0D\0A\00"
define void @console_init() {
%1 = call i32 @print_info(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @console_init.console_test, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@console_init.console_test = internal constant [73 x i8] c"\0D\0A\0D\0ALinuxBIOS-1.1.0.0Fallback Fri Jun 13 21:02:41 MDT 2003 starting...\0D\0A\00"
define void @console_init() {
%1 = tail call i32 @print_info(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @console_init.console_test, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_tifd();
void Reset_Tiff_IFD() { reset_tifd(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Tiff_IFD() {
%1 = tail call i32 (...) @reset_tifd()
ret void
}
void GPMCFclkDividerSelect(unsigned int baseAddr, unsigned int csNum,
                           unsigned int divideVal) {
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) &=
      ~(0x00000003u);
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) |=
      ((divideVal << (0x00000000u)) & (0x00000003u));
}


x86 assembly (clang, -O0):
<GPMCFclkDividerSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x0,%edx
and    $0x3,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCFclkDividerSelect>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x60,%eax
andl   $0xfffffffc,(%rax)
and    $0x3,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCFclkDividerSelect(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 96, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -4
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 0
%18 = and i32 %17, 3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 96, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCFclkDividerSelect(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 96
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -4
store volatile i32 %10, i32* %8
%11 = and i32 %2, 3
%12 = load volatile i32, i32* %8
%13 = or i32 %12, %11
store volatile i32 %13, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MixerStatusHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void MixerStatusRequestUpdate() { UAVObjRequestUpdate(MixerStatusHandle()); }


x86 assembly (clang, -O0):
<MixerStatusRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <MixerStatusHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MixerStatusRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <MixerStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @MixerStatusRequestUpdate() {
%1 = call i32 (...) @MixerStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @MixerStatusRequestUpdate() {
%1 = tail call i32 (...) @MixerStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
void delete_user(int uid) {
  char del[50];
  sprintf(del, "userdel u%d", uid);
  fprintf(stderr, del);
  fprintf(stderr, "\n");
  system(del);
}


x86 assembly (clang, -O0):
<delete_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1050 <sprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
call   1040 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_user>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %edi,%edx
lea    0xec0(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    0x2e8e(%rip),%rbx
mov    (%rbx),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
mov    %r14,%rdi
call   1030 <system@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"userdel u%d\00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define void @delete_user(i32 %0) {
%2 = alloca i32
%3 = alloca [50 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stderr
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%9 = call i32 @fprintf(i32 %7, i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%13 = call i32 @system(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"userdel u%d\00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define void @delete_user(i32 %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* %3)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ehrpwm_pwm_stop(int /*<<< orphan*/);
int /*<<< orphan*/ mdaq_pwm_set_duty(int /*<<< orphan*/, int /*<<< orphan*/);
int mdaq_pwm_stop(uint8_t channel) {
  mdaq_pwm_set_duty(channel, 0);
  return ehrpwm_pwm_stop(channel);
}


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

x86 assembly (clang, -O2):
<mdaq_pwm_stop>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1040 <mdaq_pwm_set_duty@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ehrpwm_pwm_stop@plt>

LLVM IR (-O0):
define i32 @mdaq_pwm_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mdaq_pwm_set_duty(i32 %3, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @ehrpwm_pwm_stop(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @mdaq_pwm_stop(i32 %0) {
%2 = tail call i32 @mdaq_pwm_set_duty(i32 %0, i32 0)
%3 = tail call i32 @ehrpwm_pwm_stop(i32 %0)
ret i32 %3
}
/* Type definitions */
struct tm {
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void break_display(struct tm *current_time) {
  printf("%02i:%02i:%02i\n", current_time->tm_hour, current_time->tm_min,
         current_time->tm_sec);
}


x86 assembly (clang, -O0):
<break_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<break_display>:
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"%02i:%02i:%02i\0A\00"
define void @break_display(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.tm*, %struct.tm** %2
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.tm*, %struct.tm** %2
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 2
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"%02i:%02i:%02i\0A\00"
define void @break_display(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7)
ret void
}