xunge/DecIR huggingface dataset:
char *mkupper(str)
char *str;
{
  char *sp;
  sp = str;
  while (*sp)
    uppercase(sp++);
  return (str);
}


x86 assembly (clang, -O0):
<mkupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <mkupper+0x3c>
mov    -0x10(%rbp),%rdi
mov    %rdi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <uppercase@plt>
jmp    1124 <mkupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkupper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
cmpb   $0x0,(%rdi)
je     1137 <mkupper+0x27>
mov    %r14,%rbx
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <uppercase@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <mkupper+0x10>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mkupper(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @uppercase to i32 (i8*, ...)*)(i8* %10)
br label %5
13: ; preds = %5
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @mkupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @uppercase to i32 (i8*, ...)*)(i8* %5)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i8* %0
}
void set_value(unsigned char *buf, unsigned int val) {
  unsigned int *arr = (unsigned int *)buf;
  arr[0] = val;
}


x86 assembly (clang, -O0):
<set_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_value>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_value(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 i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
ret void
}

LLVM IR (-O2):
define void @set_value(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int c() { printf("in c\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"in c\00"
define i32 @c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SplitString(int /*<<< orphan*/, int);
int /*<<< orphan*/ lr_eval_string(char *);
int /*<<< orphan*/ lr_save_string(char *, char *);
Action() {
  lr_save_string("1234567890abcdefghijklmnopqrstuvwxyz", "cParameterToSplit");
  SplitString(lr_eval_string("{cParameterToSplit}"), 10);
  return 0;
}


x86 assembly (clang, -O0):
<Action>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xee9(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %eax,%edi
mov    $0xa,%esi
call   1040 <SplitString@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Action>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1050 <lr_save_string@plt>
lea    0xeec(%rip),%rdi
call   1030 <lr_eval_string@plt>
mov    %eax,%edi
mov    $0xa,%esi
call   1040 <SplitString@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"1234567890abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [18 x i8] c"cParameterToSplit\00"
@.str.2 = [20 x i8] c"{cParameterToSplit}\00"
define i32 @Action() {
%1 = call i32 @lr_save_string(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @lr_eval_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @SplitString(i32 %2, i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"1234567890abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [18 x i8] c"cParameterToSplit\00"
@.str.2 = [20 x i8] c"{cParameterToSplit}\00"
define i32 @Action() {
%1 = tail call i32 @lr_save_string(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @lr_eval_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @SplitString(i32 %2, i32 10)
ret i32 0
}
__attribute((__gnu___)) extern int h(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @h(i32 returned %0) {
ret i32 %0
}
int pci_config_type(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @pci_config_type() {
ret i32 1
}

LLVM IR (-O2):
define i32 @pci_config_type() {
ret i32 1
}
int decimal(char roman) {
  switch (roman) {
  case 'I':
    return 1;
  case 'V':
    return 5;
  case 'X':
    return 10;
  case 'L':
    return 50;
  case 'C':
    return 100;
  }
  return 0;
}


x86 assembly (clang, -O0):
<decimal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1170 <decimal+0x70>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1177 <decimal+0x77>
movl   $0x5,-0x4(%rbp)
jmp    1177 <decimal+0x77>
movl   $0xa,-0x4(%rbp)
jmp    1177 <decimal+0x77>
movl   $0x32,-0x4(%rbp)
jmp    1177 <decimal+0x77>
movl   $0x64,-0x4(%rbp)
jmp    1177 <decimal+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1123 <decimal+0x23>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
xor    %eax,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @decimal(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 %11 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
]
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
store i32 5, i32* %2
br label %12
8: ; preds = %1
store i32 10, i32* %2
br label %12
9: ; preds = %1
store i32 50, i32* %2
br label %12
10: ; preds = %1
store i32 100, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @decimal(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 73, label %8
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 0, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x4d() {
  Assert_real((isalnum(77)),
              "/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_isalnum.c",
              390, ("isalnum should be 1 for M"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x4d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4d,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x186,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x4d>:
push   %rax
mov    $0x4d,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x186,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for M\00"
define void @t_isalnum_0x4d() {
%1 = call i32 @isalnum(i32 77)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for M\00"
define void @t_isalnum_0x4d() {
%1 = tail call i32 @isalnum(i32 77)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *path) {
  char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void sif_platform_irq_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @sif_platform_irq_deinit() {
ret void
}
int array_comparisons() {
  int array1[2];
  int array2[2];
  return array1 == array1;
  return array1 != array1;
  return array1 < array1;
  return array1 <= array1;
  return array1 > array1;
  return array1 >= array1;
  return array1 == array2;
  return array1 != array2;
  return array1 < array2;
  return array1 <= array2;
  return array1 > array2;
  return array1 >= array2;
}


x86 assembly (clang, -O0):
<array_comparisons>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
lea    -0x8(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @array_comparisons() {
%1 = alloca [2 x i32]
%2 = alloca [2 x i32]
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = icmp eq i32* %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @array_comparisons() {
ret i32 1
}
void gtk_notebook_set_tab_label_packing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_set_tab_label_packing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char const *);
void cfilesystem_remove(const char *filepath) { remove(filepath); }


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

x86 assembly (clang, -O2):
<cfilesystem_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @cfilesystem_remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
void cam_glint_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @cam_glint_disable() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct zbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ __zbuf_push(struct zbuf *, int, int);
void zbuf_put8(struct zbuf *zb, uint8_t val) {
  uint8_t *dst = ((uint8_t *)__zbuf_push(zb, sizeof(uint8_t), 1));
  if (dst)
    *dst = val;
}


x86 assembly (clang, -O0):
<zbuf_put8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <__zbuf_push@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <zbuf_put8+0x3a>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zbuf_put8>:
push   %rbx
mov    %esi,%ebx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <__zbuf_push@plt>
test   %rax,%rax
je     1129 <zbuf_put8+0x19>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
%struct.zbuf = type { i32 }
define void @zbuf_put8(%struct.zbuf* %0, i32 %1) {
%3 = alloca %struct.zbuf*
%4 = alloca i32
%5 = alloca i32*
store %struct.zbuf* %0, %struct.zbuf** %3
store i32 %1, i32* %4
%6 = load %struct.zbuf*, %struct.zbuf** %3
%7 = call i64 @__zbuf_push(%struct.zbuf* %6, i32 4, i32 1)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32*, i32** %5
store i32 %12, i32* %13
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.zbuf = type { i32 }
define void @zbuf_put8(%struct.zbuf* %0, i32 %1) {
%3 = tail call i64 @__zbuf_push(%struct.zbuf* %0, i32 4, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = inttoptr i64 %3 to i32*
store i32 %1, i32* %6
br label %7
7: ; preds = %5, %2
ret void
}
int main(void) {
  int i;
  for (i = 0; i < 1;) {
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1123 <main+0x23>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(stderr, "Usage: r40 -e string [string ...] - encode ascii strings "
                  "into R40 values\n"
                  "       r40 [-d] value [value ...] - decode R40 values into "
                  "ascii string\n"
                  "\n"
                  "R40 encodes 3 characters into one 16-bit integer.\n"
                  "Characters allowed in R40 code are: A-Z, 0-9, _, %%, #.\n"
                  "Lowercase letters are encoded in uppercase.\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [297 x i8] c"Usage: r40 -e string [string ...] - encode ascii strings into R40 values\0A r40 [-d] value [value ...] - decode R40 values into ascii string\0A\0AR40 encodes 3 characters into one 16-bit integer.\0ACharacters allowed in R40 code are: A-Z, 0-9, _, %%, #.\0ALowercase letters are encoded in uppercase.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([297 x i8], [297 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [297 x i8] c"Usage: r40 -e string [string ...] - encode ascii strings into R40 values\0A r40 [-d] value [value ...] - decode R40 values into ascii string\0A\0AR40 encodes 3 characters into one 16-bit integer.\0ACharacters allowed in R40 code are: A-Z, 0-9, _, %%, #.\0ALowercase letters are encoded in uppercase.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([297 x i8], [297 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gotoxy(int /*<<< orphan*/, int /*<<< orphan*/);
void home() { gotoxy(0, 0); }


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

x86 assembly (clang, -O2):
<home>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <gotoxy@plt>

LLVM IR (-O0):
define void @home() {
%1 = call i32 @gotoxy(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @home() {
%1 = tail call i32 @gotoxy(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_daemon();
int main(void) {
  setup_daemon();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <setup_daemon@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_daemon()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ x();
main() {
  for (int i = 0; i < 5; i++) {
    x();
    int j = 3;
    printf("%d, %d\n", i, j);
    j;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    116e <main+0x4e>
mov    $0x0,%al
call   1030 <x@plt>
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <x@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <x@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <x@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <x@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <x@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @x()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
%3 = tail call i32 (...) @x()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1, i32 3)
%5 = tail call i32 (...) @x()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 2, i32 3)
%7 = tail call i32 (...) @x()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 3, i32 3)
%9 = tail call i32 (...) @x()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 3)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int encoding_utf8(char *encoding) { return (strcmp(encoding, "UTF-8") == 0); }


x86 assembly (clang, -O0):
<encoding_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoding_utf8>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"UTF-8\00"
define i32 @encoding_utf8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i32 @encoding_utf8(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int __test_and_change_bit(int nr, volatile void *addr) {
  int oldbit;
  asm volatile("btcl %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit), "=m"((*(volatile long *)addr))
               : "Ir"(nr), "m"((*(volatile long *)addr))
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rdx
btc    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_change_bit>:
btc    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_change_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
%11 = call i32 asm sideeffect "btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i32 %8, i64* elementtype(i64) %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @__test_and_change_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
%4 = tail call i32 asm sideeffect "btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0, i64* elementtype(i64) %3)
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  for (;;) {
    if ((c = getchar()) == EOF)
      break;
    c ^= 0xff;
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
jne    114d <main+0x2d>
jmp    1165 <main+0x45>
mov    -0x8(%rbp),%eax
xor    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1157 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    $0xff,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %3
br label %13
8: ; preds = %3
%9 = load i32, i32* %2
%10 = xor i32 %9, 255
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @putchar(i32 %11)
br label %3
13: ; preds = %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = xor i32 %5, 255
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
int _INHERENT_fork() { return 1; }


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

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

LLVM IR (-O0):
define i32 @_INHERENT_fork() {
ret i32 1
}

LLVM IR (-O2):
define i32 @_INHERENT_fork() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ printf(char *, char const *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void tinfo(const char *title) {
  printf("%s pid:%lu tid:%lu\n", title, getpid(), pthread_self());
}


x86 assembly (clang, -O0):
<tinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tinfo>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%s pid:%lu tid:%lu\0A\00"
define void @tinfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @getpid()
%5 = call i32 (...) @pthread_self()
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s pid:%lu tid:%lu\0A\00"
define void @tinfo(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @pthread_self()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i32 %3)
ret void
}
int hash_key(int key, int nr_slots) { return (key & (nr_slots - 1)); }


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

x86 assembly (clang, -O2):
<hash_key>:
lea    -0x1(%rsi),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hash_key(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 %6, 1
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_key(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef unsigned long uint32_t;

/* Variables and functions */
void volatile_set_bit_u32(uint32_t *mask, uint8_t bit) {
  *((volatile uint32_t *)mask) |= 1UL << bit;
}


x86 assembly (clang, -O0):
<volatile_set_bit_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_set_bit_u32>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
or     %rax,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_set_bit_u32(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = shl i64 1, %5
%7 = load i64*, i64** %3
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %6
store volatile i64 %9, i64* %7
ret void
}

LLVM IR (-O2):
define void @volatile_set_bit_u32(i64* %0, i64 %1) {
%3 = shl nuw i64 1, %1
%4 = load volatile i64, i64* %0
%5 = or i64 %4, %3
store volatile i64 %5, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logMsg(int, char *, char *, int);
int strlen(char *);
int isValueLenOk(char *value, int maxlen) {
  if (strlen(value) > maxlen) {
    logMsg(4,
           "Attempt to change config value to %s - value too long (maxlen=%d)",
           value, maxlen);
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isValueLenOk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0x14(%rbp),%eax
jle    1165 <isValueLenOk+0x45>
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x4,%edi
lea    0xeac(%rip),%rsi
call   1040 <logMsg@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <isValueLenOk+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValueLenOk>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ebp,%ecx
jle    1150 <isValueLenOk+0x30>
lea    0xec1(%rip),%rsi
mov    $0x4,%edi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1040 <logMsg@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [66 x i8] c"Attempt to change config value to %s - value too long (maxlen=%d)\00"
define i32 @isValueLenOk(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = call i32 @logMsg(i32 4, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
store i32 0, i32* %3
br label %15
14: ; preds = %2
store i32 1, i32* %3
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [66 x i8] c"Attempt to change config value to %s - value too long (maxlen=%d)\00"
define i32 @isValueLenOk(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @logMsg(i32 4, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
int main() {
  int X;
  X++;
  ++X;
  --X;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int func_a(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func_a() {
ret i32 0
}
void htc_pm_monitor_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @htc_pm_monitor_init() {
ret void
}
/* Variables and functions */
int checker_read_long_long(int /*<<< orphan*/, char const *, int, long long *);
int checker_read_in_long_long(const char *name, int eof_error_flag,
                              long long *p_val) {
  return checker_read_long_long(0, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_in_long_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <checker_read_long_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_in_long_long>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <checker_read_long_long@plt>

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

LLVM IR (-O2):
define i32 @checker_read_in_long_long(i8* %0, i32 %1, i64* %2) {
%4 = tail call i32 @checker_read_long_long(i32 0, i8* %0, i32 %1, i64* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, int, char *);
int /*<<< orphan*/ parseQuotedString(char *, char *, char **);
void readQuotedString(char *fileName, int lineIx, char *in, char *out,
                      char **retNext) {
  if (!parseQuotedString(in, out, retNext))
    errAbort("Line %d of %s\n", lineIx, fileName);
}


x86 assembly (clang, -O0):
<readQuotedString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <parseQuotedString@plt>
cmp    $0x0,%eax
jne    1168 <readQuotedString+0x48>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xe9d(%rip),%rdi
call   1030 <errAbort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readQuotedString>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
call   1040 <parseQuotedString@plt>
test   %eax,%eax
je     1141 <readQuotedString+0x21>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb8(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <errAbort@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Line %d of %s\0A\00"
define void @readQuotedString(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8**
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8** %4, i8*** %10
%11 = load i8*, i8** %8
%12 = load i8*, i8** %9
%13 = load i8**, i8*** %10
%14 = call i32 @parseQuotedString(i8* %11, i8* %12, i8** %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %5
%17 = load i32, i32* %7
%18 = load i8*, i8** %6
%19 = call i32 @errAbort(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %17, i8* %18)
br label %20
20: ; preds = %16, %5
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Line %d of %s\0A\00"
define void @readQuotedString(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = tail call i32 @parseQuotedString(i8* %2, i8* %3, i8** %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @errAbort(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
g(int i) { f((signed)i >> 31); }


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

x86 assembly (clang, -O2):
<g>:
sar    $0x1f,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 31
%6 = call i32 @f(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = ashr i32 %0, 31
%3 = tail call i32 @f(i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void arpr(int *a) {
  int i;
  for (i = 0; *(a + i) != '\0'; i++) {
    printf("%d\t", *(a + i));
  }
}


x86 assembly (clang, -O0):
<arpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     115a <arpr+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <arpr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arpr>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%esi
test   %esi,%esi
je     1142 <arpr+0x32>
mov    %rdi,%rbx
add    $0x4,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
test   %esi,%esi
jne    1130 <arpr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @arpr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void av_format_set_opaque() {}


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

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

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

LLVM IR (-O2):
define void @av_format_set_opaque() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *zstrdup(char const *);
void zstrcpy(char **dest, const char *source) {
  if (*dest != NULL)
    free(*dest);
  *dest = zstrdup(source);
}


x86 assembly (clang, -O0):
<zstrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <zstrcpy+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <zstrdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zstrcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <zstrcpy+0x17>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <zstrdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @zstrcpy(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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = call i8* @zstrdup(i8* %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
ret void
}

LLVM IR (-O2):
define void @zstrcpy(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i8* @zstrdup(i8* %1)
store i8* %8, i8** %0
ret void
}
int outbyte(byte)
unsigned char byte;
{ return putchar(byte); }


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
movzbl %dil,%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @outbyte(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @outbyte(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
typedef int uint;

/* Variables and functions */
uint rounddiv(uint64_t a, uint64_t b) { return (a + (b / 2)) / b; }


x86 assembly (clang, -O0):
<rounddiv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounddiv>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @rounddiv(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 = sdiv i32 %6, 2
%8 = add nsw i32 %5, %7
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rounddiv(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = add nsw i32 %3, %0
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
main() {
  pid_t pidFils = fork();
  if (pidFils != 0) {
    printf("je tourne en boucle\n");
    while (1)
      ;
    {}
  } else {
    printf("fils\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <main+0x2f>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    114a <main+0x2a>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1142 <main+0x22>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
nopl   0x0(%rax)
jmp    1140 <main+0x20>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"je tourne en boucle\0A\00"
@.str.1 = [6 x i8] c"fils\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %7
br label %7
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"fils\00"
@str.2 = [20 x i8] c"je tourne en boucle\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
br label %5
5: ; preds = %5, %3
br label %5
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void gtk_selection_add_target() {}


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

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

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

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