xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char s[30];
  scanf("%s", s);
  int chx(char str[]);
  printf("%d", chx(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <chx@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <chx@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @chx(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
void foo() {
  void *ptr;
label:
  ptr = &&label;
  goto *ptr;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    -0x7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i8*
br label %2
2: ; preds = %4, %0
store i8* blockaddress(@foo, %2), i8** %1
%3 = load i8*, i8** %1
br label %4
4: ; preds = %2
%5 = phi i8* [ %3, %2 ]
indirectbr i8* %5, [label %2]
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
int test_imm_B0uint8_reg(unsigned char val) {
  return ((val) & (0xB0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B0uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 176
%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_B0uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -80
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ remove_temporaries();
void fatal(void) {
  remove_temporaries();
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <remove_temporaries@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
xor    %eax,%eax
call   1040 <remove_temporaries@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @fatal() {
%1 = call i32 (...) @remove_temporaries()
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fatal() {
%1 = tail call i32 (...) @remove_temporaries()
%2 = tail call i32 @exit(i32 1)
unreachable
}
int f(int n) {
  __label__ n;
n:
  return n;
}


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

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
float CalcGflops(float computeTimeInSeconds, unsigned int iterations,
                 unsigned int nx, unsigned int ny) {
  return iterations * (double)((nx * ny) * 1e-9 * 8.0) / computeTimeInSeconds;
}


x86 assembly (clang, -O0):
<CalcGflops>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   %ecx,%eax
cvtsi2sd %rax,%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcGflops>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
imul   %edx,%esi
cvtsi2sd %rsi,%xmm2
mulsd  0xee9(%rip),%xmm2
mulsd  0xee9(%rip),%xmm2
mulsd  %xmm1,%xmm2
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @CalcGflops(float %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store float %0, float* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = uitofp i32 %9 to double
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = mul i32 %11, %12
%14 = uitofp i32 %13 to double
%15 = fmul double %14, 1.000000e-09
%16 = fmul double %15, 8.000000e+00
%17 = fmul double %10, %16
%18 = load float, float* %5
%19 = fpext float %18 to double
%20 = fdiv double %17, %19
%21 = fptrunc double %20 to float
ret float %21
}

LLVM IR (-O2):
define float @CalcGflops(float %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %1 to double
%6 = mul i32 %3, %2
%7 = uitofp i32 %6 to double
%8 = fmul double %7, 1.000000e-09
%9 = fmul double %8, 8.000000e+00
%10 = fmul double %9, %5
%11 = fpext float %0 to double
%12 = fdiv double %10, %11
%13 = fptrunc double %12 to float
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ do_all(int, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ putenv(char *);
int main(int argc, char *argv[]) {
  putenv("LANG=");
  do_all(argc, argv);
  perror(argv[0]);
  exit(1);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <putenv@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <do_all@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
call   1030 <putenv@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <do_all@plt>
mov    (%rbx),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"LANG=\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @putenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @do_all(i32 %7, i8** %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @perror(i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"LANG=\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @putenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @do_all(i32 %0, i8** %1)
%5 = load i8*, i8** %1
%6 = tail call i32 @perror(i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct evkeyvalq {
  int dummy;
};
struct evhttp_request {
  int dummy;
};

/* Variables and functions */
struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *);
struct evkeyvalq *get_request_input_headers(struct evhttp_request *req) {
  struct evkeyvalq *input_headers;
  input_headers = evhttp_request_get_input_headers(req);
  return input_headers;
}


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

x86 assembly (clang, -O2):
<get_request_input_headers>:
jmp    1030 <evhttp_request_get_input_headers@plt>

LLVM IR (-O0):
%struct.evkeyvalq = type { i32 }
%struct.evhttp_request = type { i32 }
define %struct.evkeyvalq* @get_request_input_headers(%struct.evhttp_request* %0) {
%2 = alloca %struct.evhttp_request*
%3 = alloca %struct.evkeyvalq*
store %struct.evhttp_request* %0, %struct.evhttp_request** %2
%4 = load %struct.evhttp_request*, %struct.evhttp_request** %2
%5 = call %struct.evkeyvalq* @evhttp_request_get_input_headers(%struct.evhttp_request* %4)
store %struct.evkeyvalq* %5, %struct.evkeyvalq** %3
%6 = load %struct.evkeyvalq*, %struct.evkeyvalq** %3
ret %struct.evkeyvalq* %6
}

LLVM IR (-O2):
%struct.evkeyvalq = type { i32 }
%struct.evhttp_request = type { i32 }
define %struct.evkeyvalq* @get_request_input_headers(%struct.evhttp_request* %0) {
%2 = tail call %struct.evkeyvalq* @evhttp_request_get_input_headers(%struct.evhttp_request* %0)
ret %struct.evkeyvalq* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strlen(char *);
void *thread_func(void *arg) {
  char *str = (char *)arg;
  printf("Thread get [%s].\n", str);
  return (void *)strlen(str);
}


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

x86 assembly (clang, -O2):
<thread_func>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Thread get [%s].\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
@.str = [18 x i8] c"Thread get [%s].\0A\00"
define i8* @thread_func(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void CRYPTO_destroy_dynlockid(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_destroy_dynlockid() {
ret void
}
/* Variables and functions */
scalar_t__ gsm_hex2int(char *, int);
char *pdu_get_tpdcs(char *body, char *tpdcs) {
  char *pBegin, *pEnd;
  pBegin = body;
  pEnd = pBegin + 2;
  *tpdcs = (char)gsm_hex2int(pBegin, 2);
  return pEnd;
}


x86 assembly (clang, -O0):
<pdu_get_tpdcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1030 <gsm_hex2int@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_get_tpdcs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0x2(%rdi),%rbx
mov    $0x2,%esi
call   1030 <gsm_hex2int@plt>
mov    %al,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @pdu_get_tpdcs(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8* %9, i8** %6
%10 = load i8*, i8** %5
%11 = call i64 @gsm_hex2int(i8* %10, i32 2)
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %4
store i8 %12, i8* %13
%14 = load i8*, i8** %6
ret i8* %14
}

LLVM IR (-O2):
define i8* @pdu_get_tpdcs(i8* %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i64 @gsm_hex2int(i8* %0, i32 2)
%5 = trunc i64 %4 to i8
store i8 %5, i8* %1
ret i8* %3
}
/* Variables and functions */
int date_minutes_between(char *, char *, char *, char *, int);
int /*<<< orphan*/ printf(char *, int);
void test_minutes_between(void) {
  printf("Should be 6: is %d\n",
         date_minutes_between("2011-07-20", "1530", "2011-07-20", "1535", 1));
}


x86 assembly (clang, -O0):
<test_minutes_between>:
push   %rbp
mov    %rsp,%rbp
lea    0xee9(%rip),%rdx
lea    0xeed(%rip),%rsi
lea    0xeeb(%rip),%rcx
mov    $0x1,%r8d
mov    %rdx,%rdi
call   1040 <date_minutes_between@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_minutes_between>:
push   %rax
lea    0xef7(%rip),%rsi
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rcx
mov    %rdi,%rdx
mov    $0x1,%r8d
call   1040 <date_minutes_between@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Should be 6: is %d\0A\00"
@.str.1 = [11 x i8] c"2011-07-20\00"
@.str.2 = [5 x i8] c"1530\00"
@.str.3 = [5 x i8] c"1535\00"
define void @test_minutes_between() {
%1 = call i32 @date_minutes_between(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Should be 6: is %d\0A\00"
@.str.1 = [11 x i8] c"2011-07-20\00"
@.str.2 = [5 x i8] c"1530\00"
@.str.3 = [5 x i8] c"1535\00"
define void @test_minutes_between() {
%1 = tail call i32 @date_minutes_between(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ntohb4(const uint8_t *network4) {
  return (uint32_t)network4[0] << 24 | (uint32_t)network4[1] << 16 |
         (uint32_t)network4[2] << 8 | network4[3];
}


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

x86 assembly (clang, -O2):
<ntohb4>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ntohb4(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, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @ntohb4(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blink1() {
  blinkdot();
  blinkdash();
  blinkdash();
  blinkdash();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blink1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
movsd  0xea8(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink1>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blink1() {
%1 = call i32 (...) @blinkdot()
%2 = call i32 (...) @blinkdash()
%3 = call i32 (...) @blinkdash()
%4 = call i32 (...) @blinkdash()
%5 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blink1() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdash()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
int driver_mstp_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @driver_mstp_init() {
ret i32 0
}
int whichOperatorIsThis(char letter) {
  switch (letter) {
  case '+':
    return 1;
  case '-':
    return 2;
  case '*':
    return 3;
  case '/':
    return 4;
  case '(':
    return 5;
  case ')':
    return 6;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<whichOperatorIsThis>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     117c <whichOperatorIsThis+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1183 <whichOperatorIsThis+0x83>
movl   $0x2,-0x4(%rbp)
jmp    1183 <whichOperatorIsThis+0x83>
movl   $0x3,-0x4(%rbp)
jmp    1183 <whichOperatorIsThis+0x83>
movl   $0x4,-0x4(%rbp)
jmp    1183 <whichOperatorIsThis+0x83>
movl   $0x5,-0x4(%rbp)
jmp    1183 <whichOperatorIsThis+0x83>
movl   $0x6,-0x4(%rbp)
jmp    1183 <whichOperatorIsThis+0x83>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whichOperatorIsThis>:
add    $0xffffffd8,%edi
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     111a <whichOperatorIsThis+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.whichOperatorIsThis = [8 x i32] [i32 5, i32 6, i32 3, i32 1, i32 -1, i32 2, i32 -1, i32 4]
define i32 @whichOperatorIsThis(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -40
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.whichOperatorIsThis, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %10
}
void rop3_107_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T | S;
  stk3 = *D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_107_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_107_0_0>:
mov    %edx,%eax
or     %sil,%al
and    (%rdi),%al
xor    %dl,%sil
xor    %al,%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_107_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %10
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = and i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8, i8* %6
%31 = zext i8 %30 to i32
%32 = load i8, i8* %8
%33 = zext i8 %32 to i32
%34 = xor i32 %31, %33
%35 = trunc i32 %34 to i8
store i8 %35, i8* %7
%36 = load i8, i8* %7
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = trunc i32 %38 to i8
store i8 %39, i8* %7
%40 = load i8, i8* %7
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_107_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %1, %2
%8 = xor i8 %7, %6
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EMACLPILinkSet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x400EC000);
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) |= 0x00020000;
}


x86 assembly (clang, -O0):
<EMACLPILinkSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x400ec000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
or     $0x20000,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACLPILinkSet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x400ec000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x20000,0x30(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @EMACLPILinkSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074708480
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 48
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 131072
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @EMACLPILinkSet(i32 %0) {
%2 = icmp eq i32 %0, 1074708480
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 48
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 131072
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ measure_diff_impl(int /*<<< orphan*/, char *);
int main() {
  measure_diff_impl(CLOCK_REALTIME, "CLOCK_REALTIME");
  measure_diff_impl(CLOCK_MONOTONIC, "CLOCK_MONOTONIC");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <measure_diff_impl@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <measure_diff_impl@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <measure_diff_impl@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1030 <measure_diff_impl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@CLOCK_REALTIME = global i32 0
@.str = [15 x i8] c"CLOCK_REALTIME\00"
@CLOCK_MONOTONIC = global i32 0
@.str.1 = [16 x i8] c"CLOCK_MONOTONIC\00"
define i32 @main() {
%1 = load i32, i32* @CLOCK_REALTIME
%2 = call i32 @measure_diff_impl(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @measure_diff_impl(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@CLOCK_REALTIME = global i32 0
@.str = [15 x i8] c"CLOCK_REALTIME\00"
@CLOCK_MONOTONIC = global i32 0
@.str.1 = [16 x i8] c"CLOCK_MONOTONIC\00"
define i32 @main() {
%1 = load i32, i32* @CLOCK_REALTIME
%2 = tail call i32 @measure_diff_impl(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = tail call i32 @measure_diff_impl(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int op_len(char const *);
int set_len(char const *, int);
int get_op_len(const char *re, int re_len) {
  return re[0] == '[' ? set_len(re + 1, re_len - 1) + 1 : op_len(re);
}


x86 assembly (clang, -O0):
<get_op_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    115d <get_op_len+0x3d>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <set_len@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <get_op_len+0x49>
mov    -0x8(%rbp),%rdi
call   1030 <op_len@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_op_len>:
push   %rax
cmpb   $0x5b,(%rdi)
jne    1137 <get_op_len+0x17>
add    $0x1,%rdi
add    $0xffffffff,%esi
call   1040 <set_len@plt>
add    $0x1,%eax
pop    %rcx
ret
pop    %rax
jmp    1030 <op_len@plt>

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

LLVM IR (-O2):
define i32 @get_op_len(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 91
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = add nsw i32 %1, -1
%8 = tail call i32 @set_len(i8* %6, i32 %7)
%9 = add nsw i32 %8, 1
br label %12
10: ; preds = %2
%11 = tail call i32 @op_len(i8* %0)
br label %12
12: ; preds = %10, %5
%13 = phi i32 [ %9, %5 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xfc() {
  Assert_real((isascii(252) == 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_isascii.c",
              1265, ("isascii should be 0 for 0xfc"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xfc>:
push   %rax
mov    $0xfc,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f1,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xfc\00"
define void @t_isascii_0xfc() {
%1 = call i64 @isascii(i32 252)
%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 1265, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xfc\00"
define void @t_isascii_0xfc() {
%1 = tail call i64 @isascii(i32 252)
%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 1265, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int mibb(void) { return 27; }


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

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

LLVM IR (-O0):
define i32 @mibb() {
ret i32 27
}

LLVM IR (-O2):
define i32 @mibb() {
ret i32 27
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void WatchdogIntUnregister(uint32_t ui32Base) {
  ;
  IntDisable(34);
  IntUnregister(34);
}


x86 assembly (clang, -O0):
<WatchdogIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x22,%edi
call   1030 <IntDisable@plt>
mov    $0x22,%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntUnregister>:
push   %rax
mov    $0x22,%edi
call   1030 <IntDisable@plt>
mov    $0x22,%edi
pop    %rax
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @WatchdogIntUnregister(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @IntDisable(i32 34)
%4 = call i32 @IntUnregister(i32 34)
ret void
}

LLVM IR (-O2):
define void @WatchdogIntUnregister(i32 %0) {
%2 = tail call i32 @IntDisable(i32 34)
%3 = tail call i32 @IntUnregister(i32 34)
ret void
}
int parse_numbers(char *s) {
  while (*s >= '0' && *s <= '9')
    *(s++) -= ('0' - 1);
  return *s == '\0';
}


x86 assembly (clang, -O0):
<parse_numbers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     112d <parse_numbers+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <parse_numbers+0x3d>
jmp    1159 <parse_numbers+0x59>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
sub    $0x2f,%ecx
mov    %cl,(%rax)
jmp    1108 <parse_numbers+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_numbers>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%eax
cmp    $0x9,%al
ja     1124 <parse_numbers+0x24>
add    $0x1,%rdi
nopl   (%rax)
add    $0xd1,%cl
mov    %cl,-0x1(%rdi)
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%eax
add    $0x1,%rdi
cmp    $0xa,%al
jb     1110 <parse_numbers+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @parse_numbers(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %13
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %2, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nsw i8 %6, -47
store i8 %9, i8* %7
%10 = load i8, i8* %8
%11 = add i8 %10, -48
%12 = icmp ult i8 %11, 10
br i1 %12, label %5, label %13
13: ; preds = %5, %1
%14 = phi i8 [ %2, %1 ], [ %10, %5 ]
%15 = icmp eq i8 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}
int foo(int unknown_parm, int a, int b) {
  int p;
  if (unknown_parm) {
    p = a + 2;
  } else {
    p = b + 1;
  }
  while (p)
    p--;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1125 <foo+0x25>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <foo+0x2e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <foo+0x33>
cmpl   $0x0,-0x14(%rbp)
je     114b <foo+0x4b>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <foo+0x33>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ enough_mem(char *);
char *strdup(char const *);
char *strnulldup(const char *str) {
  char *s;
  if (!str) {
    return (char *)0;
  }
  s = strdup(str);
  enough_mem(s);
  return s;
}


x86 assembly (clang, -O0):
<strnulldup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <strnulldup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1162 <strnulldup+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <enough_mem@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnulldup>:
push   %rbx
test   %rdi,%rdi
je     1138 <strnulldup+0x18>
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <enough_mem@plt>
jmp    113a <strnulldup+0x1a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strnulldup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @enough_mem(i8* %11)
%13 = load i8*, i8** %4
store i8* %13, i8** %2
br label %14
14: ; preds = %8, %7
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @strnulldup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = tail call i32 @enough_mem(i8* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %7
}
int suma(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<suma>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @suma(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int tmult_ok(int x, int y) {
  long long result = (long long)x * (long long)y;
  int iresult = x * y;
  return result == iresult;
}


x86 assembly (clang, -O0):
<tmult_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmult_ok>:
movslq %edi,%rax
movslq %esi,%rcx
mov    %rcx,%rdx
imul   %rax,%rdx
imul   %eax,%ecx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    %rcx,%rdx
sete   %al
ret

LLVM IR (-O0):
define i32 @tmult_ok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %8, %10
store i64 %11, i64* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %6
%15 = load i64, i64* %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = icmp eq i64 %15, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @tmult_ok(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = mul nsw i32 %1, %0
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int subt(int a, int b) { return a - b; }


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

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

LLVM IR (-O0):
define i32 @subt(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subt(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int strspn(char *, char *);
void strspnTest() {
  int i;
  char strtext[] = "129th";
  char cset[] = "1234567890";
  i = strspn(strtext, cset);
  printf("The length of initial number in '%s' is %d.\n", strtext, i);
}


x86 assembly (clang, -O0):
<strspnTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x15(%rbp)
mov    0xec0(%rip),%ax
mov    %ax,-0xd(%rbp)
mov    0xeb8(%rip),%al
mov    %al,-0xb(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0x15(%rbp),%rsi
call   1040 <strspn@plt>
mov    %eax,-0x4(%rbp)
lea    -0xa(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strspnTest>:
push   %rbx
sub    $0x10,%rsp
movw   $0x68,0xc(%rsp)
movl   $0x74393231,0x8(%rsp)
74
lea    0xecb(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strspn@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strspnTest.strtext = [6 x i8] c"129th\00"
@__const.strspnTest.cset = [11 x i8] c"1234567890\00"
@.str = [45 x i8] c"The length of initial number in '%s' is %d.\0A\00"
define void @strspnTest() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [11 x i8]
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [11 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%8 = call i32 @strspn(i8* %6, i8* %7)
store i32 %8, i32* %1
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@__const.strspnTest.strtext = [6 x i8] c"129th\00"
@__const.strspnTest.cset = [11 x i8] c"1234567890\00"
@.str = [45 x i8] c"The length of initial number in '%s' is %d.\0A\00"
define void @strspnTest() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @strspn(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__const.strspnTest.cset, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret void
}
int reconnect_delay(int i) {
  if (i < 10) {
    return 3;
  }
  if (i < 20)
    return 60;
  return 600;
}


x86 assembly (clang, -O0):
<reconnect_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111d <reconnect_delay+0x1d>
movl   $0x3,-0x4(%rbp)
jmp    113a <reconnect_delay+0x3a>
cmpl   $0x14,-0x8(%rbp)
jge    1133 <reconnect_delay+0x33>
movl   $0x3c,-0x4(%rbp)
jmp    113a <reconnect_delay+0x3a>
movl   $0x258,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reconnect_delay>:
cmp    $0x14,%edi
mov    $0x3c,%eax
mov    $0x258,%ecx
cmovl  %eax,%ecx
cmp    $0xa,%edi
mov    $0x3,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @reconnect_delay(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = icmp slt i32 %0, 20
%4 = select i1 %3, i32 60, i32 600
%5 = select i1 %2, i32 3, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drawSquare(int, int);
int /*<<< orphan*/ glColor3f(int, int, int);
void eraseSquare(int posx, int posy) {
  glColor3f(0, 0, 0);
  drawSquare(posx, posy);
  glColor3f(1, 1, 1);
}


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

x86 assembly (clang, -O2):
<eraseSquare>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <glColor3f@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <drawSquare@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glColor3f@plt>

LLVM IR (-O0):
define void @eraseSquare(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @glColor3f(i32 0, i32 0, i32 0)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @drawSquare(i32 %6, i32 %7)
%9 = call i32 @glColor3f(i32 1, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @eraseSquare(i32 %0, i32 %1) {
%3 = tail call i32 @glColor3f(i32 0, i32 0, i32 0)
%4 = tail call i32 @drawSquare(i32 %0, i32 %1)
%5 = tail call i32 @glColor3f(i32 1, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int gettimeofday(void *tp, void *tzp) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<gettimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @gettimeofday(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @gettimeofday(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}